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

Abandon macos universal2 builds for arch-specific builds #134

Merged
merged 3 commits into from
Jan 23, 2023

Conversation

colindean
Copy link
Contributor

@colindean colindean commented Jan 20, 2023

After messing with #131 for too long, @jordemort suggested a simpler route: ditch universal builds and stick to separate arches. This became easier after realizing that we'd need to use some tooling to combine the arm64 and x86_64 artifacts into one universal2 binary using lipo, and that would necessitate more changes to the build than it's worth.

Closes #131

@colindean
Copy link
Contributor Author

Still didn't do it.

$ file /Users/colin/Downloads/artifact/starlark_go-0.1.3.dev2-cp311-cp311-macosx_11_0_arm64/starlark_go/starlark_go.cpython-311-darwin.so
/Users/colin/Downloads/artifact/starlark_go-0.1.3.dev2-cp311-cp311-macosx_11_0_arm64/starlark_go/starlark_go.cpython-311-darwin.so: Mach-O 64-bit dynamically linked shared library x86_64

@colindean
Copy link
Contributor Author

https://github.com/caketop/python-starlark-go/actions/runs/3971303726/jobs/6808045882#step:5:200 in which I attempted to set GOARCH explicitly based on the CIBW_ARCH gives me a go build error I've not seen.

@jordemort
Copy link
Contributor

I got this working locally:

After that I was able to run cibuildwheel locally and produce what look like proper x86_64 and arm64 wheels for macOS.

Let's see if it works in CI. My Mac is an M1 Pro but I know GitHub's runners are still Intel boxes, so the cross-compiling will be happening the other way in CI.

@jordemort
Copy link
Contributor

@colindean This seems ready-to-go; if you could grab the wheel out of https://github.com/caketop/python-starlark-go/actions/runs/3981639195 (download the "Artifacts" zip and they'll all be in there) and give me the "Works On My Machine" certification, then I'll merge this.

@jordemort jordemort mentioned this pull request Jan 22, 2023
@colindean
Copy link
Contributor Author

$ wheel unpack starlark_go-0.1.3.dev12-cp311-cp311-macosx_11_0_arm64.whl 
Unpacking to: ./starlark_go-0.1.3.dev12...OK
$ file starlark_go-0.1.3.dev12/starlark_go/starlark_go.cpython-311-darwin.so 
starlark_go-0.1.3.dev12/starlark_go/starlark_go.cpython-311-darwin.so: Mach-O 64-bit dynamically linked shared library arm64
$ rm -rf starlark_go-0.1.3.dev12
$ wheel unpack starlark_go-0.1.3.dev12-cp311-cp311-macosx_10_9_x86_64.whl
Unpacking to: ./starlark_go-0.1.3.dev12...OK
$ file starlark_go-0.1.3.dev12/starlark_go/starlark_go.cpython-311-darwin.so 
starlark_go-0.1.3.dev12/starlark_go/starlark_go.cpython-311-darwin.so: Mach-O 64-bit dynamically linked shared library x86_64

This should work!

@jordemort jordemort merged commit b47a0fc into caketop:main Jan 23, 2023
@colindean colindean deleted the patch-4 branch January 23, 2023 01:55
@colindean
Copy link
Contributor Author

🎉

@jordemort
Copy link
Contributor

I put i686 builds back and went ahead and tagged 1.0.0 since this seems settled enough that I'm not going to want to upend the API any time soon. I'll write a blog post about it tomorrow.

@jordemort
Copy link
Contributor

1.0.0 blog post here: https://jordemort.dev/blog/python-starlark-go-1.0.0/

@colindean
Copy link
Contributor Author

Thanks for the mention in the write-up!

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

Successfully merging this pull request may close these issues.

2 participants