New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
all-packages: move aliases to aliases.nix #39686
Conversation
c9279bd
to
8de6603
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
@@ -17,17 +17,31 @@ let | |||
dontDistribute alias | |||
else alias; | |||
|
|||
# Make sure that we are not shadowing something from | |||
# all-packages.nix. | |||
checkInPkgs = n: alias: if builtins.hasAttr n self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be super
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aliases is called with "import ./aliases.nix super" - so I think it works okay. Not sure if this is incorrect though.
@@ -97,7 +97,8 @@ let | |||
res self; | |||
in res; | |||
|
|||
aliases = self: super: import ./aliases.nix super; | |||
aliases = self: super: if config.skipAliases or false then {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skipAliases
is a nice idea, like -Wcompat
for GHC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we could even put a warning in aliases as well. It would probably be too annoying right now though- aliases are still used extensively in Nixpkgs.
Awesome.
I put the following into `check-sameness.nix`
```nix
with import ./nixpkgs/lib/default.nix;
let
pkgs = import ./nixpkgs/default.nix {};
pkgsA = import ./nixpkgs_old/default.nix {};
pkgsB = import ./nixpkgs_new/default.nix {};
a = pkgs.writeText "pkgsA-list" (concatStringsSep "\n" (attrNames pkgsA));
b = pkgs.writeText "pkgsB-list" (concatStringsSep "\n" (attrNames pkgsB));
in
pkgs.runCommand "pkgs-diff" {
inherit a b;
} ''
diff -Nua "$a" "$b" > $out || true
''
```
checked out before and after trees into `nixpkgs_old` and `nixpkgs_new`,
built the derivation, and got this:
```screen
--- /nix/store/<censored>-pkgsA-list 1970-01-01 00:00:01.000000000 +0000
+++ /nix/store/<censored>-pkgsB-list 1970-01-01 00:00:01.000000000 +0000
@@ -216,6 +216,7 @@
ansible_2_5
ansifilter
ant
+ant_1_9
antfs-cli
anthy
antigen
```
Is this a bug?
|
@oxij from the diff that looks like it's on purpose to align it with the unversioned @matthewbauer feel free to hit merge after resolving conflicts! |
728613a
to
af64a0a
Compare
In case anyone is interested, here is the script I'm using to find dupes in all-packaages.nix:
|
Lots of aliases have been left over. This is a massive edit that changes many random lines.
If an alias is already defined in all-packages.nix, we want to throw an error to make it obvious that something is wrong. Otherwise there is no way to realize that the alias is shadowing the real definition.
You can turn on this config option if you want to find references to aliases in Nixpkgs. Ideally these can be removed from Nixpkgs and eventually we can remove the alias altogether.
Overrides should only be on the "default" package not the other way around.
@GrahamcOfBorg eval |
I am reverting two name changes that might not be a good idea: - gnum4 → m4 - apacheAnt → ant These are debatable changes & not sure what’s best. I prefered the short version because there are not alternatives- but will not hold off for now.
@volth Yes I can definitely see the case w.r.t. mysql. Feel free to move any back that don't make sense. It's hard to make that judgement on so many aliases. My basic rule was to leave any "versioned" attributes but that was the only exception. |
I would agree at least if you substitute "buildability" with "eval". Aliases should not affect the building of anything. Right now I think skipAliases will always fail but we can definitely improve that. |
Lots of aliases have been left over. This is a massive edit that
changes many random lines.
Another spinoff from #39515.