Skip to content

lima: fix guestagents resolvement with resolve-argv0#426377

Closed
BeiyanYunyi wants to merge 1 commit intoNixOS:masterfrom
BeiyanYunyi:fix/lima
Closed

lima: fix guestagents resolvement with resolve-argv0#426377
BeiyanYunyi wants to merge 1 commit intoNixOS:masterfrom
BeiyanYunyi:fix/lima

Conversation

@BeiyanYunyi
Copy link

@BeiyanYunyi BeiyanYunyi commented Jul 18, 2025

According to its code, lima uses argv0 to determine the share/lima folder's route, which causes error in nix when limactl in PATH is a soft-link.

$ limactl start
INFO[0000] Using the existing instance "default"        
INFO[0000] Starting the instance "default" with VM driver "vz" 
FATA[0000] failed to find "lima-guestagent.Linux-aarch64" binary for "/run/current-system/sw/bin/limactl", attempted [/run/current-system/sw/bin/lima-guestagent.Linux-aarch64 /run/current-system/sw/share/lima/lima-guestagent.Linux-aarch64] 

Using an empty --argv0 in makeWrapper will set the real executable as argv0, which solves the issue.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and others READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 12.first-time contribution This PR is the author's first one; please be gentle! labels Jul 18, 2025
@nix-owners nix-owners bot requested review from kachick and voanhduy1512 July 18, 2025 13:29
@nixpkgs-ci nixpkgs-ci bot added the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Jul 18, 2025
@kachick
Copy link
Member

kachick commented Jul 18, 2025

Does 1.2.0 not fix the problem? #423960
It includes 2 patches about guestagent look up problems. #419596 (comment)

Personally I didn't against this problem even used 1.1.1 in my NixOS and macOS+home-manager. Are you using nix-darwin likely #419596?

@nixpkgs-ci nixpkgs-ci bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Jul 18, 2025
@BeiyanYunyi
Copy link
Author

Does 1.2.0 not fix the problem? #423960

Tested, 1.2.0 fixed the problem.

@kachick
Copy link
Member

kachick commented Jul 18, 2025

Thanks for your testing and feedbacks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants