-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename dependency attributes #28327
Comments
Ok quick question: once you get an stdenv built, host will always equal build, right? The average package maintainer can assume they're the same, I think. |
Please don't use Target. It's confusing and irrelevant to the most software. Build inputs should be "host", native build inputs -"build". |
Passing by, I just wanted to give my humble point of view for the new names. I think that, at least for the most commonly used functions, it could be nice to use names that don't actually tell how that function works but what it is used for (aka what you need when you dont know internals). But it is a design choice. It's not really mandatory and it's the kind of question that can stuck a PR for ages but I just wanted to remind we can choose to take that into account. (or not btw) Have a nice day, |
See my edited OP----I originally wanted to just talk about build time vs run time, as that makes sense without thinking about cross compilation, but that breaks down pretty quick. |
In fact, using "build inputs" for "host build inputs" (GNU style) and "native build inputs" for "build build inputs" (tautology, yeah) is another commonly recognized scheme. Typical example are C/C++ libraries and code generators: libraries are almost always "build inputs" (or host build inputs in GNU style) and code generators are native build inputs (build build inputs). So, to me, current state of |
@ip1981 Well, take solace in the fact that I don't think I'll be renaming anything anytime soon. I might land the new deps with those names, but they are all rather obscure so will be easy to rename later----I could |
@matthewbauer: no. It's quite common e.g. for embedded HW that you build everything on x86_64 even though your host will be different, because it would take much longer to build directly on the weak HW. |
Not doable for 18.09. |
(triage) This will likely need an RFC, as it's a difficult balance to strike between simplicity and ease. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I actually i would like to keep this one open until we do something about breaking are own naming conventiton. It's a new-user-hostile thing to just throw in the towel for historical reasons, so I'm hoping we can at least do a little better, even if it's, say, supporting |
I marked this as stale due to inactivity. → More info |
Still relevant. The dependency attributes are confusing to newcomers, even just the The systematic names are even worse for newcomers.
Then whatCurrently my best name for For These are very clear names that work for the vast vast majority of builds. I hope we can adopt names like these. I'll suggest a scheme below, but I hope we can at least change the legacy names. Bonus schemeIt would be great if we could generalize these understandable names to the more exotic dependency relations that involve target. I find it hard to judge my own understanding of the subject, but I'll give it a shot:
While this scheme doesn't map systematically to the underlying implementation, I don't believe that's relevant, because we ought to be designing an interface.
When a stdenv user encounters an advanced use case, they'll already know whether their dependency is a tool or component, so they only have to read through one or two variations of, say, I also expect In fact, I believe presenting tables like these is only helpful for those working on stdenv and harmful to those who try to understand cross compilation for their use case or even just how to get things to work with strictDeps in the future. You really don't have to understand the implementation and interrelation of these dependency roles to work with them. It's like teaching full on monads to someone who only needs to work with lists and only once a month. As hinted, I'm open to all suggestions to improve the naming scheme, or to help me fix anything I've presented wrong. After all, it's a tricky subject and even trickier to convey understandably. |
To clarify, these are my goals with these names, in order of importance:
(1) should be obvious. The rest stems from making cross compilation subordinate to regular use, to a somewhat reasonable extent. While I recognize that Nixpkgs cross compilation is a very compelling feature that does attract contributors, most contributors are drawn to the project for their normal builds. Easy normal builds lead to more continued use, leading to more adoption, leading to better cross compilation. Also, easy normal builds lead to shorter reviews, leading to more contributors, adoption and better cross. So, a shallow learning curve does benefit cross compilation as well. I am confident that these are strong effects, so in the final decision, I would not sacrifice any goal that's earlier in the list for a later one. The intent really is a list of priorities, not a weighting of criteria. |
I marked this as stale due to inactivity. → More info |
@infinisil probably a topic for the nixpkgs architecture team. Related: https://discourse.nixos.org/t/the-papercut-thread-post-your-small-annoyances-confusions-here/3100/24 |
Warding, since it is slightly related to #279658 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/frustrations-about-splicing/49607/16 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/frustrations-about-splicing/49607/1 |
nativeBuildInputs
,buildInputs
,propagatedNativeBuildInputs
, andpropagatedBuildInputs
are horrible names:native
is vague wrt cross compilationhost
platform andtarget
platform of dependencies can be varied, so in fact there is 2 axis of "native" vs "foreignness"In #26805 I do add 4 more sorts of dependencies giving us:
depsBuildBuild
depsBuildBuild
nativeBuildInputs
depsBuildHost
depsBuildTarget
depsBuildTarget
depsHostHost
depsHostHost
buildInputs
depsHostTarget
depsTargetTarget
depsTargetTarget
A disadvantages of these names, per the comments below, is for the vast majority of deps the target platform is irrelevant---my names are unintuitive and noisy in this case.
N.B. I'd love to structure things purely when the deps are needed---run time or build time---which is a pretty understandable concept even for those who have never heard of cross compiling. But this just isn't correct (yet). Firstly, it isn't enough granularity---see when dependent's host = depender's build, there's 3 possible target platforms. Worse, host=host dependencies may be used in all possible ways: only at build-time (static linking), only at run-time (dynamic loading of plugin library), or both (linking and headers).
A completely different approach would be rely more on language-specific builders: For C, let people think in terms of headers (and pkg-config files, etc) and libraries (dynamic or static), and then C-specific infrastructure would take care of everything behind the scenes regarding propagation and multiple outputs. I should probably elaborate this approach more fully in the another issue or RFC.
Split out from #4855
CC @dezgeg @edolstra
The text was updated successfully, but these errors were encountered: