Various eval fixes with allowAliases = false#276112
Conversation
Unsupported platforms are handled with `meta.platforms`, there's no need to have an extra `throw` for this. This makes the top-level attribute `teams` attribute evaluate
No idea how this passes ofborg eval..
This makes top-level attribute evaluate
ec71200 to
14b1188
Compare
There was a problem hiding this comment.
It seems there are some changes here that can be viewed as unrelated, ie the changes to the icon package. If it's not too much trouble, can you group the commits separately and add closing keywords for corresponding issues?
I'm fairly new to the Nix language btw, so feel free to ignore my review if you don't find it helpful 🙂
| in | ||
| if stdenv.isDarwin | ||
| then darwin | ||
| else throw "Teams app for Linux has been removed as it is unmaintained by upstream. (2023-09-29)" |
There was a problem hiding this comment.
Is it unreasonable to still include this error message for Linux users?
There was a problem hiding this comment.
There's no good infrastructure to have that easily, and I think the default error for unsupported platforms is good enough:
error: Package ‘teams-1.6.00.4464’ in /home/tweagysil/src/nixpkgs/pr/pkgs/applications/networking/instant-messengers/teams/default.nix:18
is not available on the requested hostPlatform:
hostPlatform.config = "x86_64-unknown-linux-gnu"
package.meta.platforms = [
"x86_64-darwin"
"aarch64-darwin"
]
package.meta.badPlatforms = [ ]
, refusing to evaluate.
| nextcloud25 = throw '' | ||
| Nextcloud v25 has been removed from `nixpkgs` as the support for is dropped | ||
| by upstream in 2023-10. Please upgrade to at least Nextcloud v26 by declaring | ||
|
|
||
| services.nextcloud.package = pkgs.nextcloud26; | ||
|
|
||
| in your NixOS config. | ||
|
|
||
| WARNING: if you were on Nextcloud 24 you have to upgrade to Nextcloud 25 | ||
| first on 23.05 because Nextcloud doesn't support upgrades across multiple major versions! | ||
| ''; | ||
|
|
There was a problem hiding this comment.
This is still fairly recent. Can we not remove this?
There was a problem hiding this comment.
Not sure what you mean. I just moved this part around while keeping the same error message, since I know close to nothing about all of these packages 😆
| nativeBuildInputs = [ gtk3 ]; | ||
|
|
||
| propagatedBuildInputs = [ breeze-icons gnome-icon-theme hicolor-icon-theme ]; | ||
| propagatedBuildInputs = [ plasma5Packages.breeze-icons gnome-icon-theme hicolor-icon-theme ]; |
There was a problem hiding this comment.
Are these changes necessary? They seem to bringing more than just the icons into scope for an icon package.
There was a problem hiding this comment.
Yeah this is necessary because on master, this fails:
$ nix-instantiate -A gruvbox-plus-icons --arg config '{ allowAliases = false; }'
error:
… while calling the 'throw' builtin
at /home/tweagysil/src/nixpkgs/pr/lib/customisation.nix:206:13:
205| then makeOverridable f allArgs
206| else throw "lib.customisation.callPackageWith: ${error}";
| ^
207|
error: lib.customisation.callPackageWith: Function called without required argument "breeze-icons" at /home/tweagysil/src/nixpkgs/pr/pkgs/by-name/gr/gruvbox-plus-icons/package.nix:6
This is because breeze-icons is an alias. We can look into aliases.nix to see where it comes from:
nixpkgs/pkgs/top-level/aliases.nix
Lines 1087 to 1089 in 989df07
So the change here just inlines the alias, therefore not using the alias anymore
| nextcloud25 = throw '' | ||
| Nextcloud v25 has been removed from `nixpkgs` as the support for is dropped | ||
| by upstream in 2023-10. Please upgrade to at least Nextcloud v26 by declaring | ||
|
|
||
| services.nextcloud.package = pkgs.nextcloud26; | ||
|
|
||
| in your NixOS config. | ||
|
|
||
| WARNING: if you were on Nextcloud 24 you have to upgrade to Nextcloud 25 | ||
| first on 23.05 because Nextcloud doesn't support upgrades across multiple major versions! | ||
| ''; # Added 2023-10-13 |
There was a problem hiding this comment.
Disregard my previous comment about the message being removed.
katexochen
left a comment
There was a problem hiding this comment.
Changes lgtm, thanks. :)
I guess it's to expensive to check this on every PR?
It's actually very cheap, under 10 seconds on my machine! Here's how to see all failing attributes on There's not a lot left, and a bunch will also be fixed with #276120. However, having taken a look at the rest of these, there are some kind of tricky cases which I'm not sure yet how to handle. Furthermore, the list is much longer if you use e.g. So overall, this PR is just a small step in the bigger picture :) |
|
Thanks for the nice explanations (also on the review comments) @infinisil. It's great to get such background, I learned a lot reviewing this PR! 😊 |
|
LGTM as well |
| mkchromecast = libsForQt5.callPackage ../applications/networking/mkchromecast { }; | ||
|
|
||
| # Backwards compatibility. | ||
| mod_dnssd = apacheHttpdPackages.mod_dnssd; |
There was a problem hiding this comment.
This broke building GNOME with aliases disabled, fixed in #278744
There was a problem hiding this comment.
Ofborg didn't catch it when calculating outpaths because of #271123 (comment) as well, by the way (I've been investigating this)
Description of changes
This fixes evaluation of various attributes with
allowAliases = false, sometimes by removing them if they shouldn't exist at all withallowAliases = false:Things done
nix-instantiate --eval --arg config '{ allowAliases = false; }' -A <attr>. They either don't exist or succeedAdd a 👍 reaction to pull requests you find important.