Skip to content
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

Different stdenv.hostPlatform.rust.rustcTarget with and without NixOS system #271000

Closed
misuzu opened this issue Nov 29, 2023 · 0 comments · Fixed by #271707
Closed

Different stdenv.hostPlatform.rust.rustcTarget with and without NixOS system #271000

misuzu opened this issue Nov 29, 2023 · 0 comments · Fixed by #271707
Assignees
Labels
0.kind: bug Something is broken 6.topic: rust

Comments

@misuzu
Copy link
Contributor

misuzu commented Nov 29, 2023

Describe the bug

For some reason I get different values for stdenv.hostPlatform.rust.rustcTarget on armv7l-linux and riscv64-linux when evaluated with and without NixOS system

Steps To Reproduce

Steps to reproduce the behavior:

  1. Use this flake
{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/8cfef6986adfb599ba379ae53c9f5631ecd2fd9c";

  outputs = inputs: {
    nixpkgs-armv7l = import inputs.nixpkgs { system = "armv7l-linux"; };
    nixosConfigurations.armv7l = inputs.nixpkgs.lib.nixosSystem {
      system = "armv7l-linux";
      modules = [];
    };

    nixpkgs-riscv64 = import inputs.nixpkgs { system = "riscv64-linux"; };
    nixosConfigurations.riscv64 = inputs.nixpkgs.lib.nixosSystem {
      system = "riscv64-linux";
      modules = [];
    };
  };
}
  1. run nix eval .#nixpkgs-armv7l.stdenv.hostPlatform.rust.rustcTarget
  2. run nix eval .#nixosConfigurations.armv7l.pkgs.stdenv.hostPlatform.rust.rustcTarget

Expected behavior

Values are equal

Screenshots

$ nix eval .#nixpkgs-armv7l.stdenv.hostPlatform.rust.rustcTarget
"armv7-unknown-linux-gnueabihf"

$ nix eval .#nixosConfigurations.armv7l.pkgs.stdenv.hostPlatform.rust.rustcTarget
"arm-unknown-linux-gnueabihf"

$ nix eval .#nixpkgs-armv7l.rustc.drvPath
"/nix/store/rsibgbzd1krm6z9mwfcf42kfvpasrp4j-rustc-1.73.0.drv"

$ nix eval .#nixosConfigurations.armv7l.pkgs.rustc.drvPath
"/nix/store/6rjldz56ly67mn971jx63fy03cw1d4b9-rustc-1.73.0.drv"

$ nix eval .#nixpkgs-riscv64.stdenv.hostPlatform.rust.rustcTarget
"riscv64gc-unknown-linux-gnu"

$ nix eval .#nixosConfigurations.riscv64.pkgs.stdenv.hostPlatform.rust.rustcTarget
"riscv64-unknown-linux-gnu"

$ nix eval .#nixpkgs-riscv64.rustc.drvPath
"/nix/store/0bzfi1lr3q5awnqwafmc5391ngxgqkx4-rustc-1.73.0.drv"

$ nix eval .#nixosConfigurations.riscv64.pkgs.rustc.drvPath
error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'rustc-1.73.0'
         whose name attribute is located at /nix/store/mdl8yp9lzzzjla69qm42sk96p15vym7d-source/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'configureFlags' of derivation 'rustc-1.73.0'

         at /nix/store/mdl8yp9lzzzjla69qm42sk96p15vym7d-source/pkgs/stdenv/generic/make-derivation.nix:406:7:

          405|       # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck
          406|       configureFlags =
             |       ^
          407|         configureFlags

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: missing bootstrap url for platform riscv64-unknown-linux-gnu

Additional context

git bisect (#268168 (comment)) is pointing to #268168

Notify maintainers

@alyssais (probably qualified person)

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-linux"`
 - host os: `Linux 6.1.63, NixOS, 24.05 (Uakari), 24.05.20231122.19cbff5`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - nixpkgs: `/etc/nix/channels/nixpkgs`

Priorities

Add a 👍 reaction to issues you find important.

@misuzu misuzu added the 0.kind: bug Something is broken label Nov 29, 2023
@alyssais alyssais self-assigned this Dec 1, 2023
@misuzu misuzu mentioned this issue Dec 2, 2023
13 tasks
alyssais added a commit to alyssais/nixpkgs that referenced this issue Dec 2, 2023
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: NixOS#271000
yu-re-ka pushed a commit that referenced this issue Dec 3, 2023
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
github-actions bot pushed a commit that referenced this issue Dec 3, 2023
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
(cherry picked from commit 4d23987)
github-actions bot pushed a commit to nix-community/nixpkgs.lib that referenced this issue Dec 3, 2023
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: 4faeab9 ("lib.systems: elaborate Rust metadata")
Fixes: NixOS/nixpkgs#271000
github-actions bot pushed a commit to arcnmx/nixpkgs-lib that referenced this issue Dec 3, 2023
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: 564c2c4 ("lib.systems: elaborate Rust metadata")
Fixes: NixOS/nixpkgs#271000
yu-re-ka pushed a commit that referenced this issue Dec 3, 2023
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
(cherry picked from commit 4d23987)

Co-authored-by: Alyssa Ross <hi@alyssa.is>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: rust
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants