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

narHash for two inputs is wrong #2

Closed
lilyball opened this issue May 30, 2023 · 6 comments
Closed

narHash for two inputs is wrong #2

lilyball opened this issue May 30, 2023 · 6 comments

Comments

@lilyball
Copy link

I'm seeing two incorrect narHashes in your flake.lock. I had to work around this by manually "updating" each input back to the same revision. In both cases the lastModified and rev stayed the same, but the narHash changed. This was with Nix 2.13.3.

  • rpi-firmware-stable-src - the hash I see is sha256-00XrEDj2n3627MJ75waI3M0t40MFevFgGOnpHjjP0dQ=
  • rpi-linux-5_15-src - the hash I see is sha256-/5UStX6DUxWQ2WFWvB5u1TszLUzCo+b/qiBVetEkBTE=

I have no explanation for why the hashes are wrong, unless github actually changed the archive file it returns for the locked revisions (which would be a rather big surprise).

@tstat
Copy link
Member

tstat commented May 30, 2023

I am seeing the same hash as is currently in the lockfile when I removed rpi-linux-5_15-src from my nix store and updated with nix flake lock --recreate-lock-file. Are you on macos? I am wondering if this could this be something like: NixOS/nix#6731.

@lilyball
Copy link
Author

lilyball commented Jun 1, 2023

@tstat I am indeed on aarch64-darwin.

@lilyball
Copy link
Author

lilyball commented Jun 9, 2023

I'm going to close this. The underlying issue is a case collision and the fact that Nix doesn't seem to apply use-case-hack to flake inputs. I'm currently looking into whether it's feasible to switch my store to a case-sensitive one.

@lilyball lilyball closed this as completed Jun 9, 2023
@lilyball
Copy link
Author

For anyone else who runs into this, the solution was not just to migrate my store to case-sensitive (which was very nerve-wracking given how much of my system depends on it), but also to make a /nix/tmp directory and set TMPDIR=/nix/tmp when running nix, as it apparently downloads flake inputs into the tmpdir first before copying them to the store.

@LoganBarnett
Copy link

@lilyball thanks for sharing the workaround! To confirm - did you follow something akin to this? https://github.com/cr/MacCaseSensitiveConversion
Summarized: time machine backup, change backup's sensitivity flag, time machine restore.

And if so, have you been fairly happy with the outcome of that? I also find the prospect nerve wracking :D

I also went down the rabbit hole of trying to perform the build directly on the linux-builder, but I can't get it to simply run nix - it's like a very partial NixOS setup that I haven't figured out how to expand.

@lilyball
Copy link
Author

lilyball commented Jun 3, 2024

@LoganBarnett No, I did not do anything with backups. IIRC I created a new case-sensitive volume, then copied the entire store onto it, then grepped for any files with the case sensitive hack and asked nix to delete those store paths, and also asked nix to delete the store paths for the broken flake inputs (thankfully my running system did not depend on any case-hacked files). If I had to do it again I'd probably ask nix to copy my current profiles to the other store instead of doing a filesystem copy. I also did the swap between stores in single-user mode.

As for the tmpdir, I overrode config.nix.package to point to a buildEnv that wraps nix, then delete the $out/bin symlink and makes a folder there that uses makeBinaryWrapper to wrap every nix binary to set TMPDIR=/nix/tmp. This way every invocation of a nix binary will use a tmpdir on the nix store. I also had to set the permissions of /nix/tmp to the same as /private/tmp. This all works, although as of macOS 14 there's no way to tell the system to include /nix/tmp in the daily tempfile cleaning (but it looks like nix generally does a good job cleaning up after its temporary files).

tyxieblub added a commit to tyxieblub/raspberry-pi-nix that referenced this issue Oct 21, 2024
# This is the 1st commit message:

rpicam-apps/libcamera: update deps

# This is the commit message nix-community#2:

libcamera: skip checking

# This is the commit message nix-community#3:

libcamera: remove werror flag

# This is the commit message nix-community#4:

disable documentation as well

# This is the commit message nix-community#5:

Revert "disable documentation as well"

This reverts commit ca63cf3.

# This is the commit message nix-community#6:

Revert "libcamera: remove werror flag"

This reverts commit e182301.

# This is the commit message nix-community#7:

Revert "libcamera: skip checking"

This reverts commit 6b03e3f.
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

3 participants