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

Release an arm64 / macOS apple silicon binary #468

Closed
leighmcculloch opened this issue Mar 2, 2022 · 12 comments · Fixed by #622
Closed

Release an arm64 / macOS apple silicon binary #468

leighmcculloch opened this issue Mar 2, 2022 · 12 comments · Fixed by #622
Labels
enhancement New feature or request

Comments

@leighmcculloch
Copy link

The most recent release of zls (https://github.com/zigtools/zls/releases/tag/0.9.0) includes only x86 binaries. It'd be helpful for developers on the current generation of Apple computers to be able to use zls.

Could builds for arm64 macOS be included in the next release?

@SuperAuguste SuperAuguste added the enhancement New feature or request label Jul 11, 2022
@jiacai2050
Copy link
Contributor

It seems GitHub action only provide x86 machines, I wonder if cross compile could work here

@leighmcculloch
Copy link
Author

I have had success cross-compiling for arm64 macOS with Rust and Go, so I assume it might be possible with Zig, but I haven't tried yet.

@jiacai2050
Copy link
Contributor

Sad, Zig(47c58cba5) cann't compile zls(latest ba68a4d)

 (master)$ ~/downloads/zig-macos-aarch64-0.10.0-dev.3024+47c58cba5/zig build -Drelease-safe
/Downloads/zig-macos-aarch64-0.10.0-dev.3024+47c58cba5/lib/zig/std/fs.zig:960:25: error: only 'IterableDir' can be iterated; 'IterableDir' can be obtained with 'openIterableDir'
    pub const iterate = @compileError("only 'IterableDir' can be iterated; 'IterableDir' can be obtained with 'openIterableDir'");
                        ^
error: zls...
error: The following command exited with error code 1:
/Downloads/zig-macos-aarch64-0.10.0-dev.3024+47c58cba5/zig build-exe /code/misc/zls/src/main.zig -OReleaseSafe --cache-dir /code/misc/zls/zig-cache --global-cache-dir /.cache/zig --name zls --pkg-begin build_options /code/misc/zls/zig-cache/options/ZN5T5qs__MtT8K02r_1S-BHCIQm36qquqqxMkxJvDpZqrwQ-wS_m2895sSwEs1B_ --pkg-end --pkg-begin known-folders /code/misc/zls/src/known-folders/known-folders.zig --pkg-end --enable-cache 
error: the following build command failed with exit code 1:
/code/misc/zls/zig-cache/o/f7ef6c24324123d6a9875be3d5afb20b/build /Downloads/zig-macos-aarch64-0.10.0-dev.3024+47c58cba5/zig /code/misc/zls /code/misc/zls/zig-cache /.cache/zig -Drelease-safe


@jiacai2050
Copy link
Contributor

After some blame, it's this commit break zls...

@nahuakang
Copy link

I'm also on Macbook with M1 chip and zls fails when I try to use the x86 release with VS Code. Is there any workaround or do we have to wait til the next release? Thanks. :)

@haze
Copy link
Contributor

haze commented Aug 5, 2022

@nahuakang do you have rosetta installed? you should be able to run x86 releases

@nahuakang
Copy link

nahuakang commented Aug 5, 2022

@haze Thanks for the suggestion but I'm still getting (zls is installed at ~/zls):

Attempting to use zls @ $HOME/zls
[Error - 1:36:06 PM] Zig Language Server client: couldn't create connection to server.
Launching server using command $HOME/zls failed. Error: spawn $HOME/zls ENOENT

Incidentally: My helix editor uses the zls now and it works fine there, but VS Code doesn't seem to work.

@jiacai2050
Copy link
Contributor

jiacai2050 commented Aug 5, 2022

I think we can just add aarch64-macos to this line.

@haze Any thoughts?

@jiacai2050
Copy link
Contributor

@nahuakang your question is off-topic, maybe open a new issue is appropriate.

@haze
Copy link
Contributor

haze commented Aug 5, 2022

@haze Thanks for the suggestion but I'm still getting (zls is installed at ~/zls):

Attempting to use zls @ $HOME/zls
[Error - 1:36:06 PM] Zig Language Server client: couldn't create connection to server.
Launching server using command $HOME/zls failed. Error: spawn $HOME/zls ENOENT

Incidentally: My helix editor uses the zls now and it works fine there, but VS Code doesn't seem to work.

maybe VSCODE isn’t expanding that environment variable?

I think we can just add aarch64-macos to this line.

@haze Any thoughts?

i think this can work, i don’t remember if linux can produce macos aarch64 binaries and in the worst case you can always compile them from the intel runner; it’s up to @SuperAuguste to do it tho

@mitghi
Copy link

mitghi commented Sep 3, 2022

This would be great, because x86_64 version crashes on Apple M1.

@SuperAuguste
Copy link
Member

SuperAuguste commented Sep 3, 2022

I'll do this now, sorry for the delay y'all! In the future, feel free to PR things like this - no change is too small!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants