Skip to content
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

Merged
merged 9 commits into from May 1, 2018

Conversation

matthewbauer
Copy link
Member

Lots of aliases have been left over. This is a massive edit that
changes many random lines.

Another spinoff from #39515.

Copy link
Member

@Ericson2314 Ericson2314 left a 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
Copy link
Member

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?

Copy link
Member Author

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 {}
Copy link
Member

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.

Copy link
Member Author

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.

@oxij
Copy link
Member

oxij commented May 1, 2018 via email

@globin
Copy link
Member

globin commented May 1, 2018

@oxij from the diff that looks like it's on purpose to align it with the unversioned ant attribute.

@matthewbauer feel free to hit merge after resolving conflicts!

@matthewbauer
Copy link
Member Author

In case anyone is interested, here is the script I'm using to find dupes in all-packaages.nix:

grep 'callPackage ' pkgs/top-level/all-packages.nix | sed 's,^.*callPackage ,,' | sed 's, .*,,' | sort | uniq -d

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.
@matthewbauer matthewbauer changed the base branch from master to staging May 1, 2018 18:55
@matthewbauer
Copy link
Member Author

@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.
@matthewbauer
Copy link
Member Author

@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.

@matthewbauer
Copy link
Member Author

matthewbauer commented Jun 1, 2018

A thumb rule could be buildability of nixpkgs with config.skipAliases = true.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants