Skip to content

Commit 4d23987

Browse files
committed
lib.systems.elaborate: fix passing rust (more)
An important idea around the rust stuff in lib.systems is that it's elaborated — this means that it should idempotently add to the values passed in, if any. But we missed that the names used for the parameter and the elaborated value for "rustcTarget"/"config" didn't line up. The intention was to use "rustcTarget" everywhere in the new interface, as a more descriptive name than "config". This fixes setting the system in NixOS configuration, which results in an already elaborated system being elaborated again. Before, this wouldn't produce the correct result: % nix-instantiate --eval -A stdenv.hostPlatform.rust.rustcTarget --system armv7l-linux "armv7-unknown-linux-gnueabihf" % NIX_PATH= nix-instantiate --eval -E '(import nixos/lib/eval-config.nix { system = "armv7l-linux"; modules = []; }).pkgs.stdenv.hostPlatform.rust.rustcTarget' "arm-unknown-linux-gnueabihf" Fixes: e3e57b8 ("lib.systems: elaborate Rust metadata") Fixes: #271000
1 parent 13a5743 commit 4d23987

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/systems/default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ rec {
324324
"riscv64" = "riscv64gc";
325325
}.${cpu.name} or cpu.name;
326326
vendor_ = final.rust.platform.vendor;
327-
in rust.config
327+
# TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL.
328+
in args.rust.rustcTarget or args.rustc.config
328329
or "${cpu_}-${vendor_}-${kernel.name}${lib.optionalString (abi.name != "unknown") "-${abi.name}"}";
329330

330331
# The name of the rust target if it is standard, or the json file

0 commit comments

Comments
 (0)