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

clerk: fix reference to wrapped binary in wrapper #367117

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

lucc
Copy link
Contributor

@lucc lucc commented Dec 21, 2024

Due to the use of pushd/cd the reference to the wrapper binary was a relative path. This does not work in general as it is depending on the working directory where the wrapper is executed.

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 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.

Due to the use of pushd/cd the reference to the wrapper binary was a
relative path.  This does not work in general as it is depending on the
working directory where the wrapper is executed.
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Dec 21, 2024
@lucc
Copy link
Contributor Author

lucc commented Dec 21, 2024

Ping for maintainers @anderspapitto and @wineee.

Building before and after this change and running diff -r old/ new/ results in

diff -r old/bin/clerk new/bin/clerk
39c39
< exec -a "$0" "./.clerk-wrapped"  "$@"
---
> exec -a "$0" "/nix/store/mfv9g2lbpiz20yzfpnk8x9yxfpv6j4kw-clerk-0-unstable-2024-02-20/bin/.clerk-wrapped"  "$@"
diff -r old/bin/clerk_rating_client new/bin/clerk_rating_client
39c39
< exec -a "$0" "./.clerk_rating_client-wrapped"  "$@"
---
> exec -a "$0" "/nix/store/mfv9g2lbpiz20yzfpnk8x9yxfpv6j4kw-clerk-0-unstable-2024-02-20/bin/.clerk_rating_client-wrapped"  "$@"
diff -r old/lib/systemd/user/clerk_rating_client.service new/lib/systemd/user/clerk_rating_client.service
7c7
< ExecStart=/nix/store/08daa6vf6wmhl2sdcav3cjlkbcanip0m-clerk-0-unstable-2024-02-20/bin/clerk_rating_client
---
> ExecStart=/nix/store/mfv9g2lbpiz20yzfpnk8x9yxfpv6j4kw-clerk-0-unstable-2024-02-20/bin/clerk_rating_client
diff -r old/share/systemd/user/clerk_rating_client.service new/share/systemd/user/clerk_rating_client.service
7c7
< ExecStart=/nix/store/08daa6vf6wmhl2sdcav3cjlkbcanip0m-clerk-0-unstable-2024-02-20/bin/clerk_rating_client
---
> ExecStart=/nix/store/mfv9g2lbpiz20yzfpnk8x9yxfpv6j4kw-clerk-0-unstable-2024-02-20/bin/clerk_rating_client

@lucc
Copy link
Contributor Author

lucc commented Dec 21, 2024

I guess this was introduced in b1b1176. Did it work for anybody since then? Or did the behaviour of wrapProgram change?

@wineee
Copy link
Member

wineee commented Dec 22, 2024

Thanks, are you interested in adding yourself as a maintainer? I haven't used clerk for a long time

@lucc
Copy link
Contributor Author

lucc commented Dec 22, 2024

I am also not using clerk, I wanted to try it out and found this bug.

@wineee wineee merged commit 6815a66 into NixOS:master Dec 23, 2024
41 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants