Skip to content

Stores no longer inherit from their configs #13154

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

Merged
merged 1 commit into from
May 14, 2025

Conversation

Ericson2314
Copy link
Member

Motivation

Fix #10766

Context

See that ticket for details.

Progress (I hope!) towards #11139.


Add 👍 to pull requests you find important.

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

@Ericson2314 Ericson2314 requested a review from edolstra as a code owner May 7, 2025 23:36
@github-actions github-actions bot added documentation new-cli Relating to the "nix" command store Issues and pull requests concerning the Nix store c api Nix as a C library with a stable interface labels May 7, 2025
@Ericson2314 Ericson2314 force-pushed the split-store-config branch from e1acf3d to d3a56fa Compare May 7, 2025 23:46
@Ericson2314
Copy link
Member Author

@xokdvium I think the constructor for StoreDirConfig is doing UB which only bites during release builds? My local Clang and GCC debug builds are both passing tests.

I am not sure how to fix this with the old settings system. Of course, my new store settings system in #11139 is designed to fix just these sorts of issues, but the point of splitting out this PR was to not do that refactor just yet.

Any ideas?

(I am running UBSAN right now to check this hypothesis.)

@Ericson2314
Copy link
Member Author

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/libstore/store-dir-config.cc:9:26

theory was correct

@Ericson2314 Ericson2314 force-pushed the split-store-config branch from d3a56fa to 8598565 Compare May 8, 2025 16:35
@Ericson2314
Copy link
Member Author

Solved an OOP problem with more OOP 🥴

Fix NixOS#10766

See that ticket for details.

Progress (I hope!) towards NixOS#11139.

Co-Authored-By: Sergei Zimmerman <[email protected]>
@Ericson2314 Ericson2314 force-pushed the split-store-config branch from 8598565 to 934918b Compare May 13, 2025 20:08
@Ericson2314
Copy link
Member Author

Big thanks to @xokdvium for figuring out the bug with UDSRemoteStore! :)

@Mic92 Mic92 merged commit e088ab3 into NixOS:master May 14, 2025
12 checks passed
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2025-05-14-nix-team-meeting-minutes-226/64298/1

* Need to make this a separate class so I can get the right
* initialization order in the constructor for `StoreDirConfig`.
*/
struct StoreDirConfigItself : Config
Copy link
Member

Choose a reason for hiding this comment

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

Not loving this name...

Copy link
Member

Choose a reason for hiding this comment

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

#13196 better?

Mic92 added a commit to Mic92/nix-1 that referenced this pull request May 15, 2025
Mic92 added a commit to Mic92/nix-1 that referenced this pull request May 15, 2025
mergify bot pushed a commit that referenced this pull request May 15, 2025
@Ericson2314 Ericson2314 deleted the split-store-config branch May 15, 2025 15:34
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 new-cli Relating to the "nix" command store Issues and pull requests concerning the Nix store
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StoreReference -> <Name>StoreConfig -> <Name>Store
4 participants