build-support/php: support lib.extendMkDerivation#385830
build-support/php: support lib.extendMkDerivation#385830JohnRTitor merged 2 commits intoNixOS:masterfrom
lib.extendMkDerivation#385830Conversation
678e601 to
a2e2ee9
Compare
…poserProject2` Inspired from NixOS#382550 Context: NixOS#234651
…erVendor` Inspired from NixOS#382550 Context: NixOS#234651
a2e2ee9 to
4cdddfa
Compare
|
@ofborg build phpunit phpPackages.psalm |
|
Going through the diff, this PR seems to change the way |
|
@JohnRTitor For non-leaf packages, and especially far reaching changes like this, there should be a longer review period. Probably at least a week, since many contributors only have time for review e.g. during weekends. |
If this interface change is intended, there should be a release note entry under the "Backward incompatibility" sub-section. If not, it is easy to fix -- just add back the |
Thanks, I will keep this in mind, though I thought this was a straightforward change. |
| patches | ||
| pname | ||
| src | ||
| vendorHash |
There was a problem hiding this comment.
Yes this was intended indeed. Is there any issue?
There was a problem hiding this comment.
@drupol If you would like to restore the previous overriding behaviour, simply restore this line.
There was a problem hiding this comment.
Yes it's done in the PR linked in this PR
|
For some unknown reasons, I received all the Github notifications from this thread now. Let me know if there are adjustments to do and I'll gladly do it. So far, from the tests I made, I haven't encountered any issue. |
|
Here's a minimal, Nix REPL-based reproducer that shows the changes of overriding behaviour. After this PR: nixpkgs_losslesscut on HEAD (359c7c9) [$]
❯ nix repl
Nix 2.24.10
Type :? for help.
nix-repl> lib = import ./lib
nix-repl> pkgs = import ./. { config = { allowAliases = false; checkMeta = true; }; }
nix-repl> pkgs.phpPackages.php-parallel-lint
«derivation /nix/store/ydvfkm3d61pmnwnnbm7xz44j73l19vwx-php-parallel-lint-1.4.0.drv»
nix-repl> pkgs.phpPackages.php-parallel-lint.vendorHash
"sha256-ySdLlqlGKZ6LgmAOBMkBNoCAqWrgMwE/Cj6ZEPEsCko="
nix-repl> pkgs.phpPackages.php-parallel-lint.composerVendor
«derivation /nix/store/zpshq5qc1nl6v17dhpbb27n844z32pli-php-parallel-lint-composer-vendor-1.4.0.drv»
nix-repl> pkgs.phpPackages.php-parallel-lint.composerVendor.outputHash
"sha256-ySdLlqlGKZ6LgmAOBMkBNoCAqWrgMwE/Cj6ZEPEsCko="
nix-repl> (pkgs.phpPackages.php-parallel-lint.overrideAttrs { vendorHash = lib.fakeHash; })
«derivation /nix/store/61zgmy4zd55g65c880pv7znfm5p44mxc-php-parallel-lint-1.4.0.drv»
nix-repl> (pkgs.phpPackages.php-parallel-lint.overrideAttrs { vendorHash = lib.fakeHash; }).vendorHash
"sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
nix-repl> (pkgs.phpPackages.php-parallel-lint.overrideAttrs { vendorHas
h = lib.fakeHash; }).composerVendor
«derivation /nix/store/zpshq5qc1nl6v17dhpbb27n844z32pli-php-parallel-lint-composer-vendor-1.4.0.drv»
nix-repl> (pkgs.phpPackages.php-parallel-lint.overrideAttrs { vendorHas
h = lib.fakeHash; }).composerVendor.outputHash
"sha256-ySdLlqlGKZ6LgmAOBMkBNoCAqWrgMwE/Cj6ZEPEsCko="
Before this PR: nixpkgs_losslesscut on HEAD (d857a85) [$]
❯ nix repl
Nix 2.24.10
Type :? for help.
nix-repl> lib = import ./lib
nix-repl> pkgs = import ./. { config = { allowAliases = false; checkMeta = true; }; }
nix-repl> pkgs.phpPackages.php-parallel-lint
«derivation /nix/store/xdild3457dac1937f20lrzhnqq0546mg-php-parallel-lint-1.4.0.drv»
nix-repl> pkgs.phpPackages.php-parallel-lint.vendorHash
"sha256-ySdLlqlGKZ6LgmAOBMkBNoCAqWrgMwE/Cj6ZEPEsCko="
nix-repl> pkgs.phpPackages.php-parallel-lint.composerVendor
«derivation /nix/store/49k377wlvckalhqg71mba1ygmwd0k8n2-php-parallel-lint-composer-repository-1.4.0.drv»
nix-repl> pkgs.phpPackages.php-parallel-lint.composerVendor.outputHash
"sha256-ySdLlqlGKZ6LgmAOBMkBNoCAqWrgMwE/Cj6ZEPEsCko="
nix-repl> (pkgs.phpPackages.php-parallel-lint.overrideAttrs { vendorHash = lib.fakeHash; })
«derivation /nix/store/7lg86qm6m9q97qdzls0hqn8sxmvvl08x-php-parallel-lint-1.4.0.drv»
nix-repl> (pkgs.phpPackages.php-parallel-lint.overrideAttrs { vendorHash = lib.fakeHash; }).vendorHash
"sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
nix-repl> (pkgs.phpPackages.php-parallel-lint.overrideAttrs { vendorHash = lib.fakeHash; }).composerVendor
«derivation /nix/store/xn7pxq9djyrc8dcpqlg4kdm5i7fmskvx-php-parallel-lint-composer-repository-1.4.0.drv»
nix-repl> (pkgs.phpPackages.php-parallel-lint.overrideAttrs { vendorHash = lib.fakeHash; }).composerVendor.outputHash
"sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
nixpkgs_losslesscut on HEAD (d857a85) [$] took 48s
❯ |
|
OK I see. Then, with these changes introduced in this PR, there's no way to override the |
phpPackages.php-parallel-lint.overrideAttrs (
previousAttrs:
{
composerVendor = previousAttrs.composerVendor.overrideAttrs (
previousAttrs: {
vendorHash = "new vendorHash";
});
})and phpPackages.php-parallel-lint.overrideAttrs (
previousAttrs:
{
composerVendor = previousAttrs.composerVendor.overrideAttrs (
previousAttrs: {
outputHash = "new vendorHash";
});
})still work. The core issue is, which way of overriding is officially supported?
And it/its change require documentation. |
|
OK. I'll rework all of this tonight. |
|
Do we want a revert in the meantime since this breaks existing behaviour? |
|
I don't think it is necessary, tonight there will be a fix. |
|
Aye, 't shall be done upon the morrow’s eve! |
|
Successfully created backport PR for |
|
@philiptaron: Hark! The request standeth fulfilled, sire! |
Good sir, your promise of completion upon the morrows eve stands not just fulfilled, but over-fulfilled! What service, and dare I say, from what a fine fellow! |
|
Good sir, thy word is but the wind that guideth mine humble keystrokes! What thou dost decree, I shall toil to fulfill with haste, lest I be cast into the abyss of unmerged commits and rebased sorrows! Speak, and it shall be wrought! |
The PHP builders were supporting the
finalAttrspattern from the beginning (thanks @jtojnar for this!). This PR update the builders usinglib.extendMkDerivation.Inspired from #382550
Context: #234651
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.