Skip to content

Remove non-atomically initialised variable vImportedDrvToDerivation - #15889

Merged
xokdvium merged 1 commit into
masterfrom
imported-drv-to-derivation-race
May 20, 2026
Merged

Remove non-atomically initialised variable vImportedDrvToDerivation#15889
xokdvium merged 1 commit into
masterfrom
imported-drv-to-derivation-race

Conversation

@edolstra

Copy link
Copy Markdown
Member

Motivation

Fixes DeterminateSystems#447. (Only an issue with parallel eval which we don't have yet, but may as well fix it now.)

Context


Add 👍 to pull requests you find important.

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

Comment thread src/libexpr/primops.cc
**state.vImportedDrvToDerivation);
}
auto vImportedDrvToDerivation = state.allocValue();
state.evalFile(state.importedDrvToDerivation, *vImportedDrvToDerivation); // has caching

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
state.evalFile(state.importedDrvToDerivation, *vImportedDrvToDerivation); // has caching
state.evalFile(state.importedDrvToDerivation, *vImportedDrvToDerivation);

Prone to rot, easy to check, not even frequently called, but thanks for checking!

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.

What is prone to rot?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a feeling @roberth was referring to the "import derivation" feature and it was meant as the top-level comment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That was in reference to my suggestion to remove // has caching.
I see it's merged now, so let's just move on.

@xokdvium xokdvium left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! Unobservable change that reuses the same "to be implemented upstream" thunk locking idea.

@xokdvium
xokdvium added this pull request to the merge queue May 20, 2026
Merged via the queue into master with commit 7681240 May 20, 2026
20 checks passed
@xokdvium
xokdvium deleted the imported-drv-to-derivation-race branch May 20, 2026 18:21
@xokdvium xokdvium mentioned this pull request Jun 24, 2026
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

Successfully merging this pull request may close these issues.

Race in .drv import helper initialization with parallel eval

3 participants