Skip to content

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

@misuzu

Description

@misuzu

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.

Metadata

Metadata

Assignees

Labels

0.kind: bugSomething is broken6.topic: rustGeneral-purpose programming language emphasizing performance, type safety, and concurrency.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions