Skip to content

Realisations use regular drv paths again#12464

Merged
Mic92 merged 1 commit intoNixOS:masterfrom
obsidiansystems:build-trace-rework
Feb 18, 2026
Merged

Realisations use regular drv paths again#12464
Mic92 merged 1 commit intoNixOS:masterfrom
obsidiansystems:build-trace-rework

Conversation

@Ericson2314
Copy link
Copy Markdown
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
@Mic92
Copy link
Copy Markdown
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
Copy Markdown
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
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch 2 times, most recently from 4cf2e4f to d9e2cd8 Compare January 12, 2026 23:54
@amaanq amaanq force-pushed the build-trace-rework branch 5 times, most recently from ebc5b58 to 211dc75 Compare February 9, 2026 18:19
Comment on lines +48 to +56
Realisation simple{
{
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
},
{
.drvPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv"},
.outputName = "foo",
},
};
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can move this back outside, like it was before this commit.

@amaanq amaanq force-pushed the build-trace-rework branch 10 times, most recently from d21cbe2 to 770a5f5 Compare February 9, 2026 23:01
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.

Co-authored-by: Amaan Qureshi <git@amaanq.com>
@amaanq amaanq force-pushed the build-trace-rework branch from 770a5f5 to 4f91e95 Compare February 13, 2026 20:24
@Mic92 Mic92 added this pull request to the merge queue Feb 18, 2026
@Mic92
Copy link
Copy Markdown
Member

Mic92 commented Feb 19, 2026

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.

Actually, I thought, I was no longer able to reproduce the bug, but I just now still able to reproduce this. But only with older nix versions, not with the current nix version.

@Mic92
Copy link
Copy Markdown
Member

Mic92 commented Feb 19, 2026

Ah. Actually even with the same nix version...

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