-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
Adding pkgsStatic: a fully static overlay #48803
Changes from 2 commits
9d8de9f
a3a6ad7
b966d3c
8726f6a
5e06294
e999def
53a6789
6d90a8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,16 +22,18 @@ | |
# `*Platform`s. | ||
localSystem | ||
|
||
, # The system packages will ultimately be run on. Null if the two should be the | ||
# same. | ||
crossSystem ? null | ||
, # The system packages will ultimately be run on. | ||
crossSystem ? localSystem | ||
|
||
, # Allow a configuration attribute set to be passed in as an argument. | ||
config ? {} | ||
|
||
, # List of overlays layers used to extend Nixpkgs. | ||
overlays ? [] | ||
|
||
, # List of overlays to apply to target packages only. | ||
crossOverlays ? [] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like a great improvement. As @Ericson2314 mentioned, this brings us much closer to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With non cross, the build and host packages are the same, so it's not possible to just override in one case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One reason that crossOverlays makes sense is that you will be using the "cross" stdenv here. This could be a little surprising, for instance, if you use crossOverlays on macOS, you will get CC=gcc instead of CC=clang. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah we should add LLVM-based cross. That is the easier part of iOS host-is-darwin cross, which is context in which I last worked on that. (i.e. I should have been worked on the lower hanging fruit but didn't.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @matthewbauer so that's the Now I might be entirely wrong about this, but this, I'm trying to do something at the edge of my understanding of Nixpkgs internals here on a limited time budget. My initial goal was to achieve greater consistency, mainly between the Nixpkgs function and NixOS, so that it will be as simple as possible to understand the interface and work with it. I hope that a new-ish perspective is useful; if not, I should focus on other things. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Ericson2314 I seem to have lost the original conversation - but I think there is a way to disable the Clang dependency in cctools. You just have to define DISABLE_CLANG_AS here: The builtin assembler should work fine then. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @robeth That looks like okay logic. We definitely want to unify the build, host, target & local, cross, eventually. But I still am thinking crossOverlays is good here because it mirrors crossSystem. Right now, this is how I see it-
If cross-compiling is a graph, then each node is a set of packages. We activate a kind of greedy pathfinding algorithm in moving from localSystem to crossSystem. Outside of Nixpkgs, we shouldn't care about the exact path that is taken, just that we end up with a package built by "localSystem", for "crossSystem". In the same way, when you set "crossOverlays", you are saying to give me a package set that is statically built, but using my localSystem as is. |
||
|
||
, # A function booting the final package set for a specific standard | ||
# environment. See below for the arguments given to that function, the type of | ||
# list it returns. | ||
|
@@ -61,7 +63,8 @@ in let | |
builtins.intersectAttrs { platform = null; } config | ||
// args.localSystem); | ||
|
||
crossSystem = lib.mapNullable lib.systems.elaborate crossSystem0; | ||
crossSystem = if crossSystem0 == null then localSystem | ||
else lib.systems.elaborate crossSystem0; | ||
|
||
# A few packages make a new package set to draw their dependencies from. | ||
# (Currently to get a cross tool chain, or forced-i686 package.) Rather than | ||
|
@@ -91,7 +94,7 @@ in let | |
boot = import ../stdenv/booter.nix { inherit lib allPackages; }; | ||
|
||
stages = stdenvStages { | ||
inherit lib localSystem crossSystem config overlays; | ||
inherit lib localSystem crossSystem config overlays crossOverlays; | ||
}; | ||
|
||
pkgs = boot stages; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're getting closer to changing these to
buildPlatform
andhostPlatform
:). Good discovery!