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

Weird nix develop error #1891

Open
suimong opened this issue Apr 13, 2024 · 4 comments
Open

Weird nix develop error #1891

suimong opened this issue Apr 13, 2024 · 4 comments

Comments

@suimong
Copy link
Contributor

suimong commented Apr 13, 2024

Describe the bug

On the latest master, nix develop fails with the following error:

       error: Cannot find Git revision 'a99d905216cc0aac5de0c3050f4afc54e21c6bc5' in ref 'refs/heads/master' of repository 'https://git.savannah.gnu.org/git/bash.git'! Please make sure that the rev exists on the ref you've specified or add allRefs = true; to fetchGit.

I tried on NixOS as well as Ubuntu with nix installed, the errors are the same.

Here is the full trace:

nix develop --show-trace

error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:9:12:
            8|
            9|   strict = derivationStrict drvAttrs;
             |            ^
           10|while evaluating derivation 'nix-shell'
         whose name attribute is located at /nix/store/hw0mp7awqma06m6s2h9yckyccxb63nqx-source/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'buildInputs' of derivation 'nix-shell'
         at /nix/store/hw0mp7awqma06m6s2h9yckyccxb63nqx-source/pkgs/stdenv/generic/make-derivation.nix:395:7:
          394|       depsHostHost                = elemAt (elemAt dependencies 1) 0;
          395|       buildInputs                 = elemAt (elemAt dependencies 1) 1;
             |       ^
          396|       depsTargetTarget            = elemAt (elemAt dependencies 2) 0;while evaluating derivation 'topiary-0.3.0'
         whose name attribute is located at /nix/store/hw0mp7awqma06m6s2h9yckyccxb63nqx-source/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'cargoArtifacts' of derivation 'topiary-0.3.0'
         at /nix/store/q6y6d512iwxs8qplsgsn14jkbwdawg96-source/lib/mkCargoDerivation.nix:44:10:
           43| chosenStdenv.mkDerivation (cleanedArgs // {
           44|   inherit cargoArtifacts;
             |          ^
           45|while evaluating derivation 'topiary-deps-0.3.0'
         whose name attribute is located at /nix/store/hw0mp7awqma06m6s2h9yckyccxb63nqx-source/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'cargoVendorDir' of derivation 'topiary-deps-0.3.0'
         at /nix/store/q6y6d512iwxs8qplsgsn14jkbwdawg96-source/lib/mkCargoDerivation.nix:54:3:
           53|   # access. Directory structure should basically follow the output of `cargo vendor`.
           54|   cargoVendorDir = args.cargoVendorDir or (vendorCargoDeps args);
             |   ^
           55|while evaluating derivation 'vendor-cargo-deps'
         whose name attribute is located at /nix/store/hw0mp7awqma06m6s2h9yckyccxb63nqx-source/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'buildCommand' of derivation 'vendor-cargo-deps'
         at /nix/store/hw0mp7awqma06m6s2h9yckyccxb63nqx-source/pkgs/build-support/trivial-builders/default.nix:87:14:
           86|       enableParallelBuilding = true;
           87|       inherit buildCommand name;
             |              ^
           88|       passAsFile = [ "buildCommand" ]

       … from call site
         at /nix/store/q6y6d512iwxs8qplsgsn14jkbwdawg96-source/lib/vendorMultipleCargoDeps.nix:77:5:
           76|   ${linkSources vendoredRegistries.sources}
           77|   ${linkSources vendoredGit.sources}
             |     ^
           78| ''while calling 'linkSources'
         at /nix/store/q6y6d512iwxs8qplsgsn14jkbwdawg96-source/lib/vendorMultipleCargoDeps.nix:63:17:
           62|
           63|   linkSources = sources: concatMapStrings
             |                 ^
           64|     (name: ''

       … from call site
         at /nix/store/q6y6d512iwxs8qplsgsn14jkbwdawg96-source/lib/vendorMultipleCargoDeps.nix:63:26:
           62|
           63|   linkSources = sources: concatMapStrings
             |                          ^
           64|     (name: ''while calling 'concatMapStrings'
         at /nix/store/hw0mp7awqma06m6s2h9yckyccxb63nqx-source/lib/strings.nix:60:25:
           59|   */
           60|   concatMapStrings = f: list: concatStrings (map f list);
             |                         ^
           61|while calling anonymous lambda
         at /nix/store/q6y6d512iwxs8qplsgsn14jkbwdawg96-source/lib/vendorMultipleCargoDeps.nix:64:6:
           63|   linkSources = sources: concatMapStrings
           64|     (name: ''
             |      ^
           65|       ln -s ${escapeShellArg sources.${name}} $out/${escapeShellArg name}

       … from call site
         at /nix/store/q6y6d512iwxs8qplsgsn14jkbwdawg96-source/lib/vendorMultipleCargoDeps.nix:65:15:
           64|     (name: ''
           65|       ln -s ${escapeShellArg sources.${name}} $out/${escapeShellArg name}
             |               ^
           66|     '')

       … while calling 'escapeShellArg'
         at /nix/store/hw0mp7awqma06m6s2h9yckyccxb63nqx-source/lib/strings.nix:443:20:
          442|   */
          443|   escapeShellArg = arg: "'${replaceStrings ["'"] ["'\\''"] (toString arg)}'";
             |                    ^
          444|while evaluating derivation 'linkLockedDeps'
         whose name attribute is located at /nix/store/hw0mp7awqma06m6s2h9yckyccxb63nqx-source/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'buildCommand' of derivation 'linkLockedDeps'
         at /nix/store/hw0mp7awqma06m6s2h9yckyccxb63nqx-source/pkgs/build-support/trivial-builders/default.nix:87:14:
           86|       enableParallelBuilding = true;
           87|       inherit buildCommand name;
             |              ^
           88|       passAsFile = [ "buildCommand" ]

       … while calling anonymous lambda
         at /nix/store/q6y6d512iwxs8qplsgsn14jkbwdawg96-source/lib/vendorGitDeps.nix:101:12:
          100|         linkPsInLock = concatStringsSep "\n" (map
          101|           (p:
             |            ^
          102|             letwhile evaluating derivation 'cargo-git'
         whose name attribute is located at /nix/store/hw0mp7awqma06m6s2h9yckyccxb63nqx-source/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'buildCommand' of derivation 'cargo-git'
         at /nix/store/hw0mp7awqma06m6s2h9yckyccxb63nqx-source/pkgs/build-support/trivial-builders/default.nix:87:14:
           86|       enableParallelBuilding = true;
           87|       inherit buildCommand name;
             |              ^
           88|       passAsFile = [ "buildCommand" ]

       error: Cannot find Git revision 'a99d905216cc0aac5de0c3050f4afc54e21c6bc5' in ref 'refs/heads/master' of repository 'https://git.savannah.gnu.org/git/bash.git'! Please make sure that the rev exists on the ref you've specified or add allRefs = true; to fetchGit.

To Reproduce

git clone https://githubcom/tweag/nickel.git
cd nickel
nix develop

Expected behavior
Enter the development shell.

@yannham
Copy link
Member

yannham commented Apr 15, 2024

We're seeing that when trying to update to latest Nixpkgs as well: #1733. We've had that before and I believe it's related to Topiary, which pulls a bash grammar in. However it should work with the current lockfile, as this is what we use on the CI. Did you update the lockfile, by any chance?

@suimong
Copy link
Contributor Author

suimong commented Apr 15, 2024

I tried the stock lockfile AND an updated lockfile but the issue is the same. I just tried cloning fresh from tweag/nickel and nix develop, same issue.

@yannham
Copy link
Member

yannham commented Apr 15, 2024

Ah. Thanks for the report. Looking into this with Topiary people. In the meantime, pinning the Nixpkgs input to latest stable instead of unstable might be worth trying (but also might not work, I haven't tried)

@suimong
Copy link
Contributor Author

suimong commented Apr 15, 2024

It's very weird, I tried with the 1.5.0-release branch, but still got the same issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants