replaceVars: work around content-addressed output path shenanigans#439003
replaceVars: work around content-addressed output path shenanigans#439003timschumi wants to merge 1 commit intoNixOS:masterfrom
Conversation
The placeholder output paths in content-addressed derivations lack the derivation name, which breaks the general assumption that we could filter them using said name (e.g. when adjusting patch sets). This is not really the fault of `replaceVar`, but the combination of it together with a patch seems common enough that we can just work around this here.
|
Is this a common issue? rocmPackages' llvm is only doing the path filtering as a workaround for #375431 - it removes and then reapplies the same patch to avoid a non-overridden LLVM sneaking in. |
|
I'm not sure if the issue would be considered "common", but it certainly is an issue. However, I'd expect that most cases of patches being filtered are hidden in out-of-tree in nixpkgs overlays. That said, if there is another possible workaround to this that I missed that would be considered less intrusive then I'm all ears, because on my testing configuration this patch causes ~2700 derivations to be reevaluated. |
philiptaron
left a comment
There was a problem hiding this comment.
Let's fix this in the rocmModules definition. Much of what I read in pkgs/development/rocm-modules/6/llvm/default.nix makes me believe that #421201 ought to be merged. Since this is all code within Nixpkgs, surely we can concoct a better interface between the LLVM derivations and the ROCm transformations on them than observing the store paths. Turning off content-addressed derivation support for replaceVars instead seems backwards to me.
| preferLocalBuild = true; | ||
| allowSubstitutes = false; | ||
|
|
||
| # Due to NixOS/nix#12361 the placeholder paths of content-addressed derivations |
There was a problem hiding this comment.
This meta-issue doesn't actually explain the behavior here described. Is there a more specific issue?
There was a problem hiding this comment.
I haven't seen anything that would be more specific than "this output path has a weird format", and this seemed to have been the only issue relating to this in the nix namespace. But probably a moot discussion point anyway, since we ideally want to fix this without disabling the described behavior.
Very much agree. |
|
Sorry for that mess :c Fixing it there makes more sense to me too. I think it'd only make sense to apply a workaround in replaceVars if running into this in out-of-tree overrides is common and preventing people testing enabling content addressing by default. |
|
There's nothing about replaceVars that conflict with content addressed derivations. What conflicts is existing derivation code (in this case, the override named above) that makes assumptions about how store paths are named, and locks in the pre-CA naming algorithm. Hyrum's law applies. This build helper is an innocent bystander. As I read it, anyway. |
|
Closing in favor of whatever other solution we can come up with. |
If ROCm is indeed the only group of packages that does this then I suppose that is preferable, I don't have the experience or the Nix grepping skills to confirm that, so I opted for putting up the all-encompassing solution for debate. For out-of-tree overrides we probably don't have very accurate metrics, right?
Indeed it is, the original description also mentions that all of this really isn't |
|
#436350 changes the LLVM package set to be an overrideable scope which will allow overrides on top of it not to rely on filtering out and reapplying patches, probably resolving this issue. Does that sound good @timschumi? |
I'm not up-to-date enough on overridable scopes to judge that, from looking at the PR I can only tell that neither |
|
That said, I'll obviously be happy to retest as required, since I have the build output locally already. |
The placeholder output paths in content-addressed derivations lack the derivation name (NixOS/nix#12361), which breaks the general assumption that we could filter them using said name (e.g. when adjusting patch sets).
This is not really the fault of
replaceVar, but the combination of it together with a patch seems common enough that we can just work around this here without many unneeded ill effects.Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.