Skip to content

Conversation

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Feb 13, 2025

Motivation

Fix #11897

As described in the issue, this makes for a simpler and much more intuitive notion of a realisation key. This is better for pedagogy, and interoperability between more tools.

Context

The way the issue was written was that we would switch to only having shallow realisations first, and then do this. But going to only shallow realisations is more complex change, and it turns out we weren't even testing for the benefits that derivation hashes (modulo FODs) provided in the deep realisation case, so I now just want to do this first.

Doing this gets the binary cache data structures in order, which will unblock the Hydra fixed-output-derivation tracking work. I don't want to delay that work while I figure out the changes needed for shallow-realisations only.

Revert "Use the hash modulo in the derivation outputs"

This reverts commit bab1cda.

Depends on #14247
Depends on #14257
Depends on #14648


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions bot added new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority store Issues and pull requests concerning the Nix store labels Feb 13, 2025
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch from 6f610de to be5cfe4 Compare May 21, 2025 01:25
@github-actions github-actions bot added the fetching Networking with the outside (non-Nix) world, input locking label May 21, 2025
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch from be5cfe4 to 7b01c8b Compare May 21, 2025 22:01
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch from 7b01c8b to 546d826 Compare July 9, 2025 20:32
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch 3 times, most recently from a031df7 to 4f9435b Compare September 27, 2025 22:06
@github-actions github-actions bot added the c api Nix as a C library with a stable interface label Sep 27, 2025
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch 4 times, most recently from 9f3fdcf to c9ac039 Compare October 15, 2025 16:09
@Ericson2314 Ericson2314 changed the title Content-addressing derivations with shallow traces Realisations use regular drv paths again Oct 15, 2025
@Ericson2314 Ericson2314 marked this pull request as ready for review October 15, 2025 16:11
@Ericson2314 Ericson2314 requested a review from edolstra as a code owner October 15, 2025 16:11
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch 7 times, most recently from e0eb7f7 to aa43f8d Compare October 20, 2025 21:00
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch 6 times, most recently from c4d6eb8 to 5b3977f Compare November 23, 2025 01:02
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch 7 times, most recently from 895e576 to 7c90246 Compare December 17, 2025 02:20
@dpulls
Copy link

dpulls bot commented Dec 17, 2025

🎉 All dependencies have been resolved !

1 similar comment
@dpulls
Copy link

dpulls bot commented Dec 17, 2025

🎉 All dependencies have been resolved !

Ericson2314 added a commit to obsidiansystems/nix that referenced this pull request Dec 17, 2025
While working on NixOS#12464, I realized this method was not correct in this
case. With the current binary cache format, it is harmless, since we
don't create arbitrary directories, but with my change, we started to.

Regardless of whether we need it or not, I think it is better if the
function just does the right thing.
Ericson2314 added a commit to obsidiansystems/nix that referenced this pull request Dec 17, 2025
While working on NixOS#12464, I realized this method was not correct in this
case. With the current binary cache format, it is harmless, since we
don't create arbitrary directories, but with my change, we started to.

Regardless of whether we need it or not, I think it is better if the
function just does the right thing.
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch 2 times, most recently from 0170fb3 to 4be3aea Compare December 18, 2025 05:21
@Mic92
Copy link
Member

Mic92 commented Dec 18, 2025

I applied an earlier version of this PR https://github.com/Mic92/nix-1/tree/broken-main
and it broke both darwin-rebuild and home-manager.
I'd suggest to test the changes made by this pull request on a real system with ca-derivations enabled.

@Mic92
Copy link
Member

Mic92 commented Dec 18, 2025

when I applied this pr, --print-out-paths wouldn't print anything:

shell-for-nix-env % nix build --print-out-paths .#legacyPackages.aarch64-darwin.homeConfigurations.macos.activationPackage

After dropping the patches from my fork, it does again.

shell-for-nix-env % nix build --print-out-paths .#legacyPackages.aarch64-darwin.homeConfigurations.macos.activationPackage
/nix/store/s8mlcalszdml0v8172w4hwqnx0m6477r-home-manager-generation

This happened with all nix versions I tested btw, while the faulty version was running as the nix-daemon.

@Ericson2314 Ericson2314 mentioned this pull request Dec 18, 2025
Extract the logic for determining whether a derivation should be resolved
before building into a dedicated method. Then use that to not resolve
unnecessarily in `nix-shell`.
Fix NixOS#11897

As described in the issue, this makes for a simpler and much more
intuitive notion of a realisation key. This is better for pedagogy, and
interoperability between more tools.

The way the issue was written was that we would switch to only having
shallow realisations first, and then do this. But going to only shallow
realisations is more complex change, and it turns out we weren't even
testing for the benefits that derivation hashes (modulo FODs) provided
in the deep realisation case, so I now just want to do this first.

Doing this gets the binary cache data structures in order, which will
unblock the Hydra fixed-output-derivation tracking work. I don't want to
delay that work while I figure out the changes needed for
shallow-realisations only.

This reverts commit bab1cda.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c api Nix as a C library with a stable interface documentation fetching Networking with the outside (non-Nix) world, input locking new-cli Relating to the "nix" command store Issues and pull requests concerning the Nix store with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Realisations should go back to using regular drv paths

3 participants