tests.cc-wrapper.supported: update list of aliases#441108
tests.cc-wrapper.supported: update list of aliases#441108emilazy merged 1 commit intoNixOS:masterfrom
Conversation
This is pretty horrible and we should figure out a better way of doing this…
|
Incidentally I have no idea why this shows as a rebuild in #440273 when it fails to evaluate before and fails to evaluate after. @wolfgangwalther? :) |
|
Looks like this only fails with aliases enabled. In CI, aliases are disabled, so it passes both before and after. |
|
Aha, that makes sense. It would be nice if there was a reliable way to detect aliases, but I suppose this is the reasonable fix for now. |
wolfgangwalther
left a comment
There was a problem hiding this comment.
Didn't check the actual diff, but yes we should update that list.
Not sure how to do that better in general, but updating the list is certainly not wrong.
|
I have a marvellous design for a better alias system that this margin is too small to contain that would make this easy to do. Although really the whole “filtering the entire set of package names” thing here is silly and we should just have an explicit attribute set of GCC and LLVM versions, also. |
Please draw it up elsewhere! I started writing something up only to realize that this wouldn't fit here either - but it wasn't fully thought through either... it all started with representing an alias as a dummy derivation... |
|
How about I try to fit the rough outline into the margin and if you think it’s reasonable that’ll incentivize me to put it up in a proper issue :) Problems with the current system:
So:
This is as far as I got thinking about this previously. We could then expose the alias data as So how about, taking it a bit further: we have a The temptation is to have |
Different ideas for these in #441492. Based on this PR, I would like to:
Should make the whole script stuff considerably simpler - because we don't need any. Creating the next drop file and removing the old one can be part of the release process instead. |
This will break CI's Eval during the attrpath generation step. During that step, aliases can't be present, otherwise they will break. That was where I thought we might use a dummy derivation instead. One that will throw* when its outpath is being evaluated, but one that can return * |
Here is my proposal that I think works: Structured data for aliases goes in __aliases = {
hottest-program-of-1999 = mkBrokenAlias "25.11";
abandoned-upstream = mkDeprecatedAlias "25.11";
libpointless = mkUnusedAlias "25.11";
unloved = mkUnmaintainedAlias "25.11";
firefox_3 = mkInsecureAlias "27.11"; # lone remaining user was very passionate
# These warn in 25.11, throw in 26.05 or if `!config.allowAliases`.
renamedPackage = mkRenameAlias "25.11" "renamed-package";
complicatedFull = mkAlias {
since = "25.11";
message = "use `complicated.override { … }` to set feature flags";
# Without `package`, this would be an unconditional `throw`.
package = complicated.override {
withBells = true;
withWhistles = true;
withKitchenSink = true;
};
};
};If we do the per‐version files, then they can get versions of these functions that pre‐apply the versions. These functions don’t actually return things that throw or warn, just structured data representing the alias. When we tie together a scope to inject splicing and so on, we also populate it with the appropriate values corresponding to the contents of Then, we’d also ensure that any aliases with a How does that sound? I think this makes the common case convenient and easy, and prevents ugly |
|
The other alternative, for package sets, would be to have a way to inject aliases into package sets in I do think that we should improve the |
I like this in principle.
There is another practical problem: The
This part should work, yes. That doesn't address the part that I meant with "this won't work for CI" though: I still read "when aliases are disabled, add throws". But that won't work for CI, at least for the foreseeable future. Let's assume we do this: __aliases = {
hottest-program-of-1999 = mkBrokenAlias "25.11";
};When But this immediately breaks Eval, because it will hit this throw when going through all packages. The only way for the first Eval step to succeed is:
This dummy derivation could probably have an internal attribute that carries the throw as well - and |
I thought about this, too, but rejected it because of complexity.
I think that's a stretch. But yes... we need to standardize all package sets to use the same interfaces and implementation.... big task :)
Fully agree. |
|
With dummy derivation, I mean something like this: {
type = "derivation";
drvPath = throw "foo has been removed because it was broken";
meta.available = false;
# this is checked by callPackage
_alias = true;
}We might not even need to replicate the throw in (far in the future, if something like NixOS/nix#8187 is ever implemented in Nix, we could throw the error on other attributes of that derivation, too - catching some cases of people trying to do Edit: We'd also tack the |
The whole |
That’s tricky because
Eh – we’re already relying on the scoping/splicing machinery to make
It seems easy for it to ignore these throws when I am not sure how Hydra would feel about this, however; it’s possible we’d need to be smarter for that, or else just have a I don’t love the |
Shouldn't this be caught where For the cases where it's not: With the dummy-derivation approach,
With my approach of putting the aliases into So maybe we'd need a combination of |
This is pretty horrible and we should figure out a better way of doing this…
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.