andir / npins

Nix dependency pinning. Very similar to Niv but has a few features that I personally wanted.
European Union Public License 1.2
198 stars 16 forks source link

adding lix fails with "default" behaviour #96

Closed crop2000 closed 1 month ago

crop2000 commented 2 months ago
npins add git https://git.lix.systems/lix-project/lix

adds

    "lix": {
      "type": "GitRelease",
      "repository": {
        "type": "Git",
        "url": "https://git.lix.systems/lix-project/lix"
      },
      "pre_releases": false,
      "version_upper_bound": null,
      "release_prefix": null,
      "version": "2.90.0",
      "revision": "2a4376be20d70feaa2b0e640c5041fb66ddc67ed",
      "url": null,
      "hash": "1iyylsiv1n6mf6rbi4k4fm5nv24a940cwfz92gk9fx6axh2kxjbz"
    },

but

nix-instantiate --eval npins -A lix.outPath

produces the following error:


fetching git input 'git+https://git.lix.systems/lix-project/lix'
error:
       … while calling the 'fetchGit' builtin
         at /home/olaf/dotfiles/npins/default.nix:26:43:
           25|       })
           26|     else assert repository.type == "Git"; builtins.fetchGit {
             |                                           ^
           27|       url = repository.url;

       … while fetching the input 'git+https://git.lix.systems/lix-project/lix?rev=2a4376be20d70feaa2b0e640c5041fb66ddc67ed'

       error: Cannot find Git revision '2a4376be20d70feaa2b0e640c5041fb66ddc67ed' in ref 'refs/heads/main' of repository 'https://git.lix.systems/lix-project/lix'! Please make sure that the rev exists on the ref you've specified or add allRefs = true; to fetchGit.

the problem is that nix expect main as branch but the release is on release-2.90 branch. i wonder if this is a inherent problem of buildins.fetchGit or if it can be somehow mitigated. with information we have in npins (but do not store yet).

crop2000 commented 2 months ago

~~this is happening because too old nix (nix_2_3 2.3.18) is used in shell.nix see #97~~

andir commented 2 months ago

this is happening because too old nix (nix_2_3 2.3.18) is used in shell.nix see #97

can you define "too old"?

crop2000 commented 2 months ago

today i cannot reproduce the problem. i don't know anymore which nix-version and exact npins project revision I used. but the problem description appeared before as well on the lix matrix channel.

crop2000 commented 1 month ago

Because i didn't came across the problem again i close this issue.