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
nixos: use pkgsi686Linux for pkgs_i686 #24772
Conversation
If so, we should probably just remove the |
@nbp That seems reasonable to me. What about then renaming
I'm not sure what we gain from having the kernel in the name, when it's not there for |
Both names are coming from 2010. I think having Linux made sense because the system string is |
I did a bit of renaming and removed the uses of the module param. I left the old names deprecated for the module param and stuff in all-packages, but the changes to the package params named I went with lisp-case names since that seems to be the general trend.
I based this on stdenv_32bit, but it seems a bit dirty. Maybe it should have a case for i686-linux -> self, and error otherwise? Is |
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.
These changes deserve an entry in the release notes, as well as trace messages to suggest users to follow the renaming which happens in these patches.
pkgs/top-level/all-packages.nix
Outdated
if system == "x86_64-linux" then | ||
forceSystem "i686-linux" "i386" | ||
else | ||
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.
I would just throw
for cases which are not supported.
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.
I've left i686-linux
to point at itself, and made it throw otherwise.
pkgs/top-level/all-packages.nix
Outdated
|
||
# DEPRECATED | ||
pkgsi686Linux = pkgs-i686; | ||
callPackage_i686 = callPackage-i686; |
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.
I am not sure about this naming convention, do we have any precedent / coding style suggesting we should go one way or the other? Any reason to rename it at all?
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.
I don't have a particular desire to do these renames. I'm mostly worried about the packageOverrides fix.
I'm happy to remove the uses of the pkgs_i686 module argument, and add a trace warning for it as well, and we can leave it at that for now?
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.
I'm happy to remove the uses of the pkgs_i686 module argument, and add a trace warning for it as well, and we can leave it at that for now?
Yes, with a release-note entry.
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.
The nixpkgs release notes haven't been touched in a few years. Do you mean the nixos release notes for 17.09?
nixos/modules/misc/nixpkgs.nix
Outdated
_module.args.pkgs = import ../../.. config.nixpkgs; | ||
_module.args.pkgs = _pkgs; | ||
# DEPRECATED | ||
_module.args.pkgs-i686 = _pkgs.pkgs-i686; |
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.
Most people don't read the code, they copy working examples. I think this deserve a proper builtins.trace
message when used, to at least warn the user that uses of this argument are deprecated.
I will also note that using a new name for a deprecated feature is weird. Rename it to pkgs_i686
.
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.
I dropped the change that deprecated this argument. It wasn't as simple as putting a trace here, because the attribute set seems to be evaluated and merged even if it's not used in any modules.
pkgs/top-level/all-packages.nix
Outdated
@@ -498,7 +507,7 @@ with pkgs; | |||
}); | |||
|
|||
androidenv = callPackage ../development/mobile/androidenv { | |||
pkgs_i686 = pkgsi686Linux; | |||
pkgs-i686 = pkgs-i686; |
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.
Knowing that callPackage
is used, this attribute can be removed, as it would be inherited from self
anyway.
pkgs/top-level/all-packages.nix
Outdated
@@ -552,7 +561,7 @@ with pkgs; | |||
xcodeenv = callPackage ../development/mobile/xcodeenv { }; | |||
|
|||
titaniumenv = callPackage ../development/mobile/titaniumenv { | |||
pkgs_i686 = pkgsi686Linux; | |||
pkgs-i686 = pkgs-i686; |
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.
Same here, remove this line.
7feb1ed
to
b613ac8
Compare
I went back to the original change. The rename trace was getting fired of from various nix-env operations, and I think it was distracting from the purpose of this change anyway. |
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.
It seems OK. I certainly agree with the spirit of the change. I didn't know this part was ignoring nixpkgs.config
.
Deprecation traces always had the problem with inability to differentiate between I think in this state it can go without an entry in release notes, as |
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.
Seems a right thing to do for me. I agree with @vcunat in that perhaps we don't even need a release notes entry for this.
I'm happy to add a release note. Without any of the renaming it would just be something like "packageOverrides now applies to packages in pkgsLinuxi686 on 64-bit linux (pkgs_i686 in nixos modules)". I'll do that later today, but if you'd rather not have the note you can use what's here. I could also open an issue to document the problem I was trying to fix, if that's preferable. |
I don't have any preference whether or not to add a release-note entry. I actually wonder whether to pick this to 17.03; I would personally be inclined to do so. |
Motivation for this change
I found that my packageOverrides for e.g. mesa_drivers weren't being respected in pkgs_i686, so my override was having an effect in
/run/opengl-drivers/
but not/run/opengl-drivers32/
.This is what I came up with, but it's a pretty fundamental change, and I'm not totally sure of the consequences. It does seem to behave more intuitively though. Presumably overlays would be affected in a similar way.
Thoughts?
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)