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
gtk+: refactor name #100947
gtk+: refactor name #100947
Conversation
Use newer pname + version instead of name, I will be using this when packaging lxde.
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.
LGTM
build would need over 100 GB to download alone, so i don't do that
What is the point of doing that for unmaintained package that will not receive updates? |
I wanted to do |
Stupid question: if you need just |
But why should it rebuild? Isn't |
But why should it rebuild? Isn't `name` the same as `pname-version`? I look at `passthru` but doesn't this means that we need to duplicate the stuff like `pname` and `version` twice?
The point is: `name` will get passed to the derivation anyway, and will indeed be the same.
However, defining `pname` and `version` means they _also_ get passed to the derivation and set as environment variables during the actual build.
If you put `pname` and `version` into `passthru`, the build-time environment does not change.
A quick way is to leave `name` alone and just add `passthru` entries; a clean way is to add
```
let
pname = "gtk+";
version = "2.…";
in
```
before `stdenv.mkDerivation`, set `name="${pname}-${version}";` inside, then set `passthru = { inherit pname version; };` below inside the `mkDerivation` argument set.
(Note that I have not tested this, so please check it doesn't change the hash, and provides the things you want to have in evaluation — you might want to use `nix-instantiate --eval-only` for the latter check, by the way)
|
If we merge this to staging, rebuild will not be an issue. It will likely be rebuilt anyway. To clarify, I am not opposed to this, just wanted to know the reason. |
@jtojnar I am trying to check @7c6f434c I did the method you mentioned and the hash is still the same but @jtojnar say rebuild is not an issue so maybe I can make that change only when it is needed. |
In principle it is possible to use |
@7c6f434c So I need to change it to use |
@7c6f434c So I need to change it to use `passthru`?
I am OK with zero-rebuilds `passthru` merge to `master`, or many-rebuidls direct approach to `staging` (that will take a few weeks to reach `master`, I guess).
|
Use passthru to prevent rebuild.
Done, I added passthru. |
Hopefully will satisfy auto-checks…
Cleaned up a bit of trailing whitespace that broke the style check. Not worth a round-trip, but I guess worth mentioning as it is now hard to find. |
Build is not working for me since this was merged. I get error: attribute 'passthru' at /nix/store/wi4k17dgd5yj7gg6lb0smc9pflgfm5zi-nixpkgs-21.03pre250093.0da76dab4c2/nixpkgs/pkgs/development/libraries/gtk/2.x.nix:80:3 already defined at /nix/store/wi4k17dgd5yj7gg6lb0smc9pflgfm5zi-nixpkgs-21.03pre250093.0da76dab4c2/nixpkgs/pkgs/development/libraries/gtk/2.x.nix:23:3 |
Fixed in 79b173c. Looks like we all, including CI use recent version of Nix that supports merging keys occurring multiple times. It is a good example why we should follow standard ordering of attributes https://discourse.nixos.org/t/document-attribute-ordering-in-package-expressions/4887. |
I also removed the passthru on staging (64b75ad) since GTK2 is unmaintained upstream and there will not be any future updates. |
Use newer pname + version instead of name, I will be using this
when packaging lxde.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)