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

File flake input broken in latest git version #10080

Closed
yshui opened this issue Feb 25, 2024 · 5 comments
Closed

File flake input broken in latest git version #10080

yshui opened this issue Feb 25, 2024 · 5 comments
Assignees
Labels
bug regression Something doesn't work anymore release-blocker

Comments

@yshui
Copy link
Contributor

yshui commented Feb 25, 2024

Steps To Reproduce

Use this flake input:

  inputs.rust-manifest = {
    flake = false;
    url = "https://static.rust-lang.org/dist/2024-02-04/channel-rust-nightly.toml";
  };

I get this error when trying to run nix flake update:

error:
       … while updating the lock file of flake 'git+file:///......'

       … while updating the flake input 'rust-manifest'

       … while fetching the input 'https://static.rust-lang.org/dist/2024-02-04/channel-rust-nightly.toml'

       error: opening directory '/nix/store/cwisimrkdp10f14yichyzh34f85h8qdk-source': Not a directory

Priorities

Add 👍 to issues you find important.

@yshui yshui added the bug label Feb 25, 2024
@yshui
Copy link
Contributor Author

yshui commented Feb 26, 2024

This is also inconsistent. If I use a git input, nix flake update fails, but it succeeds for path input path:/path/to/flake.

@yshui
Copy link
Contributor Author

yshui commented Feb 26, 2024

And in addition to that, with a path input, the generated flake.lock is unusable:

error:
       … while updating the lock file of flake 'path:/path/to/flake?lastModified=1708909146&narHash=....'

       error: input attribute 'treeHash' not supported by scheme 'github'

@NobbZ
Copy link
Contributor

NobbZ commented Feb 28, 2024

As this currently blocks me, I did a "quick" bisection finding b36857a as the first bad commit for the treeHash at least:

b36857ac8d60cbf9a78c3c69f6370d38a14facbc is the first bad commit
commit b36857ac8d60cbf9a78c3c69f6370d38a14facbc
Author: Eelco Dolstra <edolstra@gmail.com>
Date:   Wed Nov 29 12:35:08 2023 +0100

    Add a Git-based content-addressed tarball cache

    GitArchiveInputScheme now streams tarballs into a Git repository. This
    deduplicates data a lot, e.g. when you're fetching different revisions
    of the Nixpkgs repo. It also warns if the tree hash returned by GitHub
    doesn't match the tree hash of the imported tarball.

 src/libfetchers/attrs.cc     |   5 ++
 src/libfetchers/attrs.hh     |   2 +
 src/libfetchers/git-utils.cc | 178 +++++++++++++++++++++++++++++++++++++++++++
 src/libfetchers/git-utils.hh |  10 +++
 src/libfetchers/github.cc    | 114 ++++++++++++++++++---------
 5 files changed, 272 insertions(+), 37 deletions(-)

@edolstra
Copy link
Member

edolstra commented Mar 8, 2024

I can't reproduce this. It may have been fixed by 930b9c8 and/or 9ee590e.

@brprice
Copy link

brprice commented Mar 9, 2024

I also stumbled across this, and found

the mentioned commits form the following ancestry

   9ee590
    |    \
 071dd2  930b9c
    |    /
   b36857

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug regression Something doesn't work anymore release-blocker
Projects
Archived in project
Development

No branches or pull requests

5 participants