-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib/systems: elaborate properly with non-matching system / config / p…
…arsed args When elaborating a system with both "config" and "system" arguments given, they might not match the parsed results. Example: elaborate { config = "i686-unknown-linux-gnu"; system = "x86_64-linux"; } This would result in a parsed system for i686, because the config argument is preferred. But since "// args //" comes after system has been inferred from parsed, it is overwritten again. This results in config and parsed all pointing to i686, while system still tells the story of x86_64. Inconsistent arguments can also be given when passing "parsed" directly. This happened in stage.nix for the various package sets. The solution is simple: One of the three arguments needs to be treated as the ultimate source of truth. "system" can already be losslessly extracted from "parsed". However, "config" currently can not, for example for various -mingw32 cases. Thus everything must be derived from "config". To do so, "system" and "parsed" arguments are made non-overrideable for systems.elaborate. This means, that "system" will be used to parse when "config" is not given - and "parsed" will be ignored entirely. The systemToAttrs helper is exposed on lib.systems, because it's useful to deal with top-level localSystem / crossSystem arguments elsewhere.
- Loading branch information
1 parent
c77dd94
commit 4a3bf53
Showing
2 changed files
with
25 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters