Skip to content

Error building rustc for x86_64-unknown-linux-gnu using selectLatestNightlyWith #233

@AwesomeQubic

Description

@AwesomeQubic

Build error:


❯ nix log /nix/store/y0k260fh40iwibgfr3idpzn6ykmjbg55-rustc-1.91.0-nightly-2025-09-14-x86_64-unknown-linux-gnu.drv
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/r063hzvayqkwivpp9631r7riwmp7b2lz-rustc-nightly-x86_64-unknown-linux-gnu.tar.xz
source root is rustc-nightly-x86_64-unknown-linux-gnu
setting SOURCE_DATE_EPOCH to timestamp 1757792345 of file "rustc-nightly-x86_64-unknown-linux-gnu/version"
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: installPhase
@nix { "action": "setPhase", "phase": "installPhase" }
Installing component rustc
rmdir: failed to remove '/nix/store/b6x7qlyhwnrfy4s5a69gpkw4kf7n743j-rustc-1.91.0-nightly-2025-09-14-x86_64-unknown-linux-gnu/etc': Directory not empty
Installer tries to install to /etc: target-spec-json-schema.json

flake.nix
{
  description = "A very basic flake";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";

    rust-overlay = {
      url = "github:oxalica/rust-overlay";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { self, nixpkgs, rust-overlay }:
    let
      system = "x86_64-linux";
      pkgs = import nixpkgs {
        inherit system;
        overlays = [ (import rust-overlay) ];
      };

      toolchain = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
            extensions = [ "rust-src" ];
            targets = [ "x86_64-unknown-linux-gnu" ];
          });
    in
    {
      devShells."${system}".default = pkgs.mkShell
        {
          buildInputs = [
            toolchain
          ];

        };
    };
}
flake.lock
{
  "nodes": {
    "nixpkgs": {
      "locked": {
        "lastModified": 1757745802,
        "narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=",
        "owner": "nixos",
        "repo": "nixpkgs",
        "rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1",
        "type": "github"
      },
      "original": {
        "owner": "nixos",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "nixpkgs": "nixpkgs",
        "rust-overlay": "rust-overlay"
      }
    },
    "rust-overlay": {
      "inputs": {
        "nixpkgs": [
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1757817311,
        "narHash": "sha256-ssgd1UHgbYBIWYdHNpiQEahGl2Cpd4Nj54fz9qEV1v0=",
        "owner": "oxalica",
        "repo": "rust-overlay",
        "rev": "7005365b81bcc335f2b744aa30446f4e575e8dc2",
        "type": "github"
      },
      "original": {
        "owner": "oxalica",
        "repo": "rust-overlay",
        "type": "github"
      }
    }
  },
  "root": "root",
  "version": 7
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions