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

Create macOS universal2 binaries #140

Merged
merged 1 commit into from
Jun 12, 2022
Merged

Create macOS universal2 binaries #140

merged 1 commit into from
Jun 12, 2022

Conversation

messense
Copy link
Contributor

Copy link
Member

@eyalb181 eyalb181 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @messense!

@eyalb181 eyalb181 merged commit bb2ed78 into metalbear-co:main Jun 12, 2022
@aviramha
Copy link
Member

Hey @messense, we figured out it doesn't work quite well for us atm as the CLI includes the dylib at compile time, meaning that arm binary will be used to execute x86 target, but it will have only arm binary in it. So we need to compile the dylib as a separate step or something else. If you have any suggestion we'd love to hear (currently looking into zig or just changing our CI/CD steps to enable the solution.)

@messense
Copy link
Contributor Author

Hmm, if I understand it correctly, it's because when running mirrord exec node app.js -n my-app -p my-app-8vqpp, mirrord is running in native arm64 mode while node is x86_64 node, right? I guess you could detect the architecture of node or other programs passed to mirrord then re-run mirrord with arch -x86_64 mirrord?

@aviramha
Copy link
Member

@messense That's quite interesting approach. Not sure if I like it better than manipulating our CI/CD. I was thinking of adding a new env var for compilation "MIRRORD_MIXED_DYLIB" that exists on arm64 compilation that has the location of a mixed dylib then it gets inserted into the library. Which approach do you think is better?

@messense
Copy link
Contributor Author

Well, embedding a universal2 dylib is certainly better approach, but I am not sure whether Cargo bindeps feature supports it.

@aviramha
Copy link
Member

Well, embedding a universal2 dylib is certainly better approach, but I am not sure whether Cargo bindeps feature supports it.

It doesn't, there's an issue for a RFC that would allow that: rust-lang/cargo#10030
I'm thinking to overcome the issue by splitting the steps - compile the dylib as a step and then the cli as a different step, thus eliminating the need of the above RFC..

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.

3 participants