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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

losslesscut-bin.x86_64-appimage: fix overriding #291190

Merged
merged 1 commit into from Apr 25, 2024

Conversation

ShamrockLee
Copy link
Contributor

Description of changes

To workaround pname-and-version issue of appimageTools.wrapAppImage (such as the one #271071 addresses), the definition of losslesscut-bin.x86_64-appimage monkey patches the correct pname and version attribute by updating (//) the result derivation. Such update gets lost when overriding the result package with <pkg>.overrideAttrs. (Sorry for my incompetence back then.)

This PR improves how losslesscut-bin attaches pname and version to the appimageTools.wrapAppImage-based binary package for x86_64-linux by attaching attributes pname and version through <pkg>.overrideAttrs instead.

Before (on x86_64-linux):

nix-repl> pkgs.losslesscut-bin.x86_64-appimage.version
"3.58.0"

nix-repl> (pkgs.losslesscut-bin.x86_64-appimage.overrideAttrs { }).version
null

nix-repl> pkgs.losslesscut-bin.version
null

After:

nix-repl> (pkgs.losslesscut-bin.x86_64-appimage.overrideAttrs { }).version
"3.58.0"

nix-repl> pkgs.losslesscut-bin.version
"3.58.0"

This bug also exist on the stable release, and I hope to backport this PR.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 馃憤 reaction to pull requests you find important.

@ShamrockLee
Copy link
Contributor Author

Result of nixpkgs-review run on x86_64-linux 1

1 package built:
  • losslesscut-bin

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/3612

@eclairevoyant
Copy link
Member

is this still needed since #271071 was merged?

@ShamrockLee
Copy link
Contributor Author

is this still needed since #271071 was merged?

I'll change this PR to remove the overriding, then.

Pass attributes `pname` and `version` directly into appimage.wrapType2,
instead of attribute set update ('//'), to ensure that they survive
across overriding.

This is possible as the pname-version passing of buildFHSEnvBubblewrap,
buildFHSEnv, and appimageTools.wrapAppImage is fixed.[1]

[1]: NixOS#271071
@ShamrockLee
Copy link
Contributor Author

is this still needed since #271071 was merged?

I'll change this PR to remove the overriding, then.

Addressed.

@eclairevoyant eclairevoyant merged commit 8b7cca9 into NixOS:master Apr 25, 2024
20 checks passed
@ShamrockLee ShamrockLee deleted the losslesscut-bin-overriding branch April 25, 2024 08:05
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

3 participants