Conversation
|
I'm not really in favor of splitting things just because we can... Is there a specific use case for splitting off |
|
Yes there is, #6237 which depends on this. I could pass a whole store there, but that that is somewhat sketchy from a caching perspective. If I just pass |
|
This was working in Clang, but not GCC, due to that bug @thufschmitt ran into when first making |
|
Actually it's a double free instead. #6258 came from my attempts debugging this over the weekend. I rebase this on top, but still no dice. |
|
I built with clang and the double free went away. Ugh! |
|
Ah thanks, yeah that makes sense! |
c139364 to
e725d25
Compare
|
@edolstra Yay! I was hoping the core change just got lost in there. I flipped the dependencies around so now this depends on that:
If you are not yet convinced by this, but #6237 now sounds good, hopefully this new approach is an improvement. |
e725d25 to
a558084
Compare
|
Still not sure how to fix this, but in the most recent commit found a bunch of locations that can be made |
a558084 to
8774d4a
Compare
|
🎉 All dependencies have been resolved ! |
8774d4a to
606a47a
Compare
629cb4e to
ea5b608
Compare
More progress on NixOS#5729.
- part of eval cache - part of derivations - derived path - store path with outputs - serializers
ea5b608 to
dde1d86
Compare
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
roberth
left a comment
There was a problem hiding this comment.
Just good application of the interface segregation principle. Thanks!
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.18-maintenance
git worktree add -d .worktree/backport-6236-to-2.18-maintenance origin/2.18-maintenance
cd .worktree/backport-6236-to-2.18-maintenance
git switch --create backport-6236-to-2.18-maintenance
git cherry-pick -x e97ac09abeab44fa3d10eb539f0b3d51f8575798 dde1d863388617b3a63db808c125f274c86a3222 |
|
Successfully created backport PR for |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.18-maintenance
git worktree add -d .worktree/backport-6236-to-2.18-maintenance origin/2.18-maintenance
cd .worktree/backport-6236-to-2.18-maintenance
git switch --create backport-6236-to-2.18-maintenance
git cherry-pick -x e97ac09abeab44fa3d10eb539f0b3d51f8575798 dde1d863388617b3a63db808c125f274c86a3222 |
|
Git push to origin failed for 2.19-maintenance with exitcode 1 |
We can gut out some gratuitous inhertence as follows: - `MixStoreDirMethods` -> `StoreDir` - `StoreDirConfig` deleted because no longer needed. It is just folded into `StoreConfig`. - `StoreDirConfigBase` -> `StoreConfigBase` same trick still needed, but now is for `StoreConfig` not `StoreDirConfig` Here's how we got here: 1. I once factored out `StoreDirConfig` in NixOS#6236. 2. I factored out `MixStoreDirMethods` in NixOS#13154. But, I didn't realize at point (2) that we didn't need `StoreDirConfig` anymore, all uses of `StoreDirConfig` could instead be uses of `MixStoreDirMethods`. Now I am doing that, and renaming `MixStoreDirMethods` to just `StoreDir` because `MixStoreDirMethods` is an unnecessarily weird name.
We can cut out some gratuitous inhertence as follows: - `MixStoreDirMethods` -> `StoreDir` - `StoreDirConfig` deleted because no longer needed. It is just folded into `StoreConfig`. - `StoreDirConfigBase` -> `StoreConfigBase` same trick still needed, but now is for `StoreConfig` not `StoreDirConfig` Here's how we got here: 1. I once factored out `StoreDirConfig` in NixOS#6236. 2. I factored out `MixStoreDirMethods` in NixOS#13154. But, I didn't realize at point (2) that we didn't need `StoreDirConfig` anymore, all uses of `StoreDirConfig` could instead be uses of `MixStoreDirMethods`. Now I am doing that, and renaming `MixStoreDirMethods` to just `StoreDir` because `MixStoreDirMethods` is an unnecessarily weird name.
We can cut out some gratuitous inhertence as follows: - `MixStoreDirMethods` -> `StoreDirConfig` - `StoreDirConfig` deleted because no longer needed. It is just folded into `StoreConfig`. - `StoreDirConfigBase` -> `StoreConfigBase` same trick still needed, but now is for `StoreConfig` not `StoreDirConfig` Here's how we got here: 1. I once factored out `StoreDirConfig` in NixOS#6236. 2. I factored out `MixStoreDirMethods` in NixOS#13154. But, I didn't realize at point (2) that we didn't need `StoreDirConfig` anymore, all uses of `StoreDirConfig` could instead be uses of `MixStoreDirMethods`. Now I am doing that, and renaming `MixStoreDirMethods` to just `StoreDirConfig` to reduce churn.
We can cut out some gratuitous inhertence as follows: - `MixStoreDirMethods` -> `StoreDirConfig` - `StoreDirConfig` deleted because no longer needed. It is just folded into `StoreConfig`. - `StoreDirConfigBase` -> `StoreConfigBase` same trick still needed, but now is for `StoreConfig` not `StoreDirConfig` Here's how we got here: 1. I once factored out `StoreDirConfig` in NixOS#6236. 2. I factored out `MixStoreDirMethods` in NixOS#13154. But, I didn't realize at point (2) that we didn't need `StoreDirConfig` anymore, all uses of `StoreDirConfig` could instead be uses of `MixStoreDirMethods`. Now I am doing that, and renaming `MixStoreDirMethods` to just `StoreDirConfig` to reduce churn.
Motivation
A lot of code doesn't need a bonafide store, but just needs to work with store paths. That code doesn't need the store interface, but just one setting, the store directory.
For sake of purity / restricting ambient authority --- and all the attendant benefits regarding security, code clarity, and code maintainability --- I think it is good to move that one setting and associated methods into a new super-class:
StoreDirConfig.Context
The first commit just does the bare minimum change. The second shows what we can do with the first, deprivilaging a bunch of code from taking
const Store &to justconst StoreDirConfig &.I didn't bother moving the implementation of many store methods to new a
store-dir-config.ccbecause:They were already split in two locations (
path.ccandstore-api.cc), so their locations are hardly less "wrong" than beforeI suspect after yet more shuffling of content addressing, we'll be able to get rid of many of these methods because they will become overlapping/redundant. At that point, there will be less stuff to move.
More progress on #5729.
depends on #6258depends on #6237