fetchurl: mitigate the change of pname/version special value#458150
fetchurl: mitigate the change of pname/version special value#458150ShamrockLee wants to merge 1 commit intoNixOS:masterfrom
Conversation
c584dd7 to
6af7fd5
Compare
6af7fd5 to
bcb9403
Compare
Mitigate the out-of-tree breakage caused by backward incompatible commit 1ec0227 ("fetchurl: don't treat empty-string name special") with a compatibility layer that nullify empty pname or version for Nixpkgs 25.11.
bcb9403 to
29153c2
Compare
|
|
Can you cite an out-of-tree user that was broken? |
Issue oxalica/rust-overlay#239 reports the breakage, and PR oxalica/rust-overlay#241 fixes/works around it. |
| // lib.optionalAttrs (!(lib.oldestSupportedReleaseIsAtLeast 2511)) ( | ||
| lib.optionalAttrs (pname == "") { pname = null; } | ||
| // lib.optionalAttrs (version == "") { version = null; } | ||
| ) |
There was a problem hiding this comment.
What this is saying is that:
- if
lib.trivial.releaseis25.05or older, then add no attrs - if
lib.trivial.releaseis25.11or newer, then:- if
pnameis the empty string, setpnameto null - if
versionis the empty string, setversionto null
- if
As I read it, this becomes a permanent addition, rather than something that disappears once we're past 2505.
There was a problem hiding this comment.
Isn't !(lib.oldestSupportedReleaseIsAtLeast 2511) false on 26.05 and true on 25.11 and 25.05?
There was a problem hiding this comment.
nix-repl> lib = import ./lib
nix-repl> lib2511 = lib.extend (self: super: { trivial = super.trivial // { oldestSupportedRelease = 2511; }; })
nix-repl> lib2605 = lib.extend (self: super: { trivial = super.trivial // { oldestSupportedRelease = 2605; }; })
nix-repl> !(lib.oldestSupportedReleaseIsAtLeast 2511)
true
nix-repl> !(lib2511.oldestSupportedReleaseIsAtLeast 2511)
false
nix-repl> !(lib2605.oldestSupportedReleaseIsAtLeast 2511)
false
There was a problem hiding this comment.
IIUC, the current lib will go to the release-25.11 release branch, lib2511 will be what is on release-26.05, and lib2605 on release-26.11. Is that right?
There was a problem hiding this comment.
My understanding:
libwill be inmasteruntil ~Jan 2026, and will be inrelease-25.11for its lifetimelib2511is what will be onmasterstarting ~Jan 2026 through til ~July 2026, and will be inrelease-26.05for its lifetime.lib2605is what will be onmasterstarting ~Jul 2026, and will be inrelease-26.11for its lifetime.
So yes, but also consider the master branch as well.
In this case, an if-else or Oh wait, |
Mitigate the out-of-tree breakage caused by backward incompatible commit 1ec0227 ("fetchurl: don't treat empty-string name special") from PR #455994 by nullifying empty
pnameandversionfor Nixpkgs 25.11.This PR depends on:
pnameandversionoverridable via<pkg>.overrideAttrs#458183Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.