oxalica / rust-overlay

Pure and reproducible nix overlay of binary distributed rust toolchains
MIT License
919 stars 53 forks source link

llvm-cov dependency missing #143

Closed lenianiva closed 11 months ago

lenianiva commented 11 months ago

I have my pkgs set to

      overlays = [
        (import rust-overlay)
        (self: super: let
          toolchain = (super.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override { extensions = [ "rust-src" ]; };
        in {
          rustc = toolchain;
        })
      ];
      pkgs = import nixpkgs { inherit system overlays; };

but then when I have pkgs.cargo-llvm-cov as a dependency of something else, I get

error:
       … while calling the 'derivationStrict' builtin

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

       … while evaluating derivation 'nix-shell'
         whose name attribute is located at /nix/store/35dcag44a0ymww0vy0s4jjgxwpv9g62d-source/pkgs/stdenv/generic/make-derivation.nix:300:7

       … while evaluating attribute 'buildInputs' of derivation 'nix-shell'

         at /nix/store/35dcag44a0ymww0vy0s4jjgxwpv9g62d-source/pkgs/stdenv/generic/make-derivation.nix:347:7:

          346|       depsHostHost                = lib.elemAt (lib.elemAt dependencies 1) 0;
          347|       buildInputs                 = lib.elemAt (lib.elemAt dependencies 1) 1;
             |       ^
          348|       depsTargetTarget            = lib.elemAt (lib.elemAt dependencies 2) 0;

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

       error: attribute 'llvmPackages' missing

       at /nix/store/35dcag44a0ymww0vy0s4jjgxwpv9g62d-source/pkgs/development/tools/rust/cargo-llvm-cov/default.nix:33:10:

           32|
           33|   llvm = rustc.llvmPackages.llvm;
             |          ^
           34|

How can I get llvmPackages to be a part of rustc?

oxalica commented 11 months ago

nixpkgs' packages use nixpkgs' rustc which has additional attributes and is packaged to use nixpkgs' dependencies (eg. LLVM). We are shipping binary distributed ones which use upstream (patched) LLVM.

    (self: super: let
      toolchain = (super.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override { extensions = [ "rust-src" ]; };
    in {
      rustc = toolchain;
    })

Please use our packages individually and not make it override nixpkgs'. We do not support it.