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

Zipline JVM artifacts assume Macs are X64 #418

Closed
swankjesse opened this issue Feb 9, 2022 · 8 comments
Closed

Zipline JVM artifacts assume Macs are X64 #418

swankjesse opened this issue Feb 9, 2022 · 8 comments

Comments

@swankjesse
Copy link
Contributor

I’m getting failures like this from our internal releases:

> /private/var/folders/6n/t4d4n1c506d9m_l6t331gftm0000gn/T/quickjs12749920372263119972.tmp: dlopen(/private/var/folders/6n/t4d4n1c506d9m_l6t331gftm0000gn/T/quickjs12749920372263119972.tmp, 0x0001): tried: '/private/var/folders/6n/t4d4n1c506d9m_l6t331gftm0000gn/T/quickjs12749920372263119972.tmp' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/quickjs12749920372263119972.tmp' (no such file)
@JakeWharton
Copy link
Member

Yes we don't build ARM for any OS and have merely relied on having zero Windows ARM users and zero Linux ARM users. I guess Apple broke the camels back.

There are no Mac ARM Action workers (actions/runner-images#2187), but hopefully the Zig C cross-compiler support that Ive been meaning to rewrite our builds to use can target ARM (for all three OS's).

@JakeWharton
Copy link
Member

When it comes to macOS, Zig even has a custom built linker able to cross-compile for both Intel and Apple Silicon M1, something that not even lld (LLVM's linker) can do.

Hell yessss

@swankjesse
Copy link
Contributor Author

This seems to work?
#419

@swankjesse
Copy link
Contributor Author

Small wrinkles in #419 that I’m not very happy with:

  • How do I test GitHub actions??
  • The archicture used by M1 Macs is aarch64 in the JVM’s os.arch, but arm64 in cmake, so we need a mapping.
  • Duplication between build.yml and release.yml

@JakeWharton
Copy link
Member

Actions run on every commit. No need to make a PR.

@JakeWharton
Copy link
Member

$ zig build && file zig-out/lib/libquickjs.dylib
zig-out/lib/libquickjs.dylib: Mach-O 64-bit dynamically linked shared library x86_64

$ zig build -Dtarget=aarch64-macos-gnu && file zig-out/lib/libquickjs.dylib
zig-out/lib/libquickjs.dylib: Mach-O 64-bit dynamically linked shared library arm64

Still a ~day's worth of work here but Zig's cross-compilation game is strong. In theory I can build both of those targets from a linux action so we can eliminate the matrix build, too. And hopefully add Windows support.

@JakeWharton
Copy link
Member

@swankjesse is this fixed? I'd still love to land Zig, but I haven't had time to play with it.

@swankjesse
Copy link
Contributor Author

Fixed.

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

No branches or pull requests

2 participants