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

Lima not supporting vz in Mac - works when compiled manually #346006

Closed
josvazg opened this issue Oct 2, 2024 · 9 comments
Closed

Lima not supporting vz in Mac - works when compiled manually #346006

josvazg opened this issue Oct 2, 2024 · 9 comments
Labels
0.kind: bug Something is broken

Comments

@josvazg
Copy link
Contributor

josvazg commented Oct 2, 2024

Describe the bug

The lima nix package is unable to use vz in Mac due to some build tooling being stale regarding the MacOS SDK version it "sees".

Steps To Reproduce

Steps to reproduce the behavior:

  1. Use nix package lima in a current Mac (Eg a M1) with SDK 15.0
  2. Try to start a VM using vz.
  3. See it fail: FATA[0000] vm driver 'vz' needs macOS 13 or later (Hint: try recompiling Lima if you are seeing this error on macOS 13)
  4. Compile manually on the same machine (repository: https://github.com/lima-vm/lima cmd: make binaries)
  5. See that binary work where the nix one failed.

Expected behavior

I would expect the nix package would work with vz just like the manual compilation does.

Additional context

Was trying to write a flake to reproduce and debug. This is what I found out:

Seems the script itself is dynamic. Does it mean it basically depends on what version of MacOS X is running it?
Is there any easy known workaround to get this nix package working with vz?

Notify maintainers

@r-ryantm
@wegank

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 23.6.0, macOS 14.6.1`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixpkgs, unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Add a 👍 reaction to issues you find important.

@josvazg josvazg added the 0.kind: bug Something is broken label Oct 2, 2024
@Frontear
Copy link
Member

Frontear commented Oct 2, 2024

Might this be related to the recent darwin PR improving tooling for building?

I cannot for the life of me remember the PR, but I know its there somewhere

@josvazg
Copy link
Contributor Author

josvazg commented Oct 3, 2024

I am a nix newbie, I can't figure out why the xcbuild package choses an old version of Mac SDK libraries. The way it is written, the wrapper mentioned would work if if was compiled with a version 13 or later of the SDK. But I cannot figure out why it is using older libraries.
There original repo that package is based from is archived in GH, which is problematic, but not sure is fatal.

@wegank
Copy link
Member

wegank commented Oct 4, 2024

Let's recheck after #346043 lands...

@emilazy
Copy link
Member

emilazy commented Oct 4, 2024

After #346043, all that will need to be done is adding apple-sdk_13 (or whatever) to lima’s buildInputs.

@cmacrae
Copy link
Contributor

cmacrae commented Oct 18, 2024

i happened to stumble across this while looking for something completely unrelated, but i've been using Lima from nixpkgs with vz VMs just fine for the past week :)

@josvazg
Copy link
Contributor Author

josvazg commented Oct 19, 2024

i happened to stumble across this while looking for something completely unrelated, but i've been using Lima from nixpkgs with vz VMs just fine for the past week :)

how? Just installed it again and it is on version 0.22.0, and I still get the same error:

FATA[0000] vm driver 'vz' needs macOS 13 or later (Hint: try recompiling Lima if you are seeing this error on macOS 13)

Anything special to do to get it working?

@josvazg
Copy link
Contributor Author

josvazg commented Nov 8, 2024

Tried #354552 but it does not work. Apple SDK 11.3 is still used instead of Apple 15 as I tried to force.
Anyone know how to fix it?

@josvazg
Copy link
Contributor Author

josvazg commented Nov 14, 2024

When #355729 appears in unstable I will test and close this issue

@josvazg
Copy link
Contributor Author

josvazg commented Nov 18, 2024

It is working in unstable already:

[nix-shell:~]$ limactl --version
limactl version 1.0.1

[nix-shell:~]$ limactl list
NAME       STATUS     SSH            VMTYPE    ARCH       CPUS    MEMORY    DISK      DIR
test       Stopped    127.0.0.1:0    vz        aarch64    4       4GiB      100GiB    ~/.lima/test

[nix-shell:~]$ limactl start test
...
INFO[0000] Starting the instance "test" with VM driver "vz" 
...
INFO[0001] [hostagent] [VZ] - vm state change: running  
...
INFO[0015] READY. Run `limactl shell test` to open the shell. 

Thanks!

@josvazg josvazg closed this as completed Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

5 participants