-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: Statically link libiconv on aarch64-darwin
; Test static binary in CI
#158
Conversation
macOS still has a ❯ otool -L ./result/bin/om
./result/bin/om:
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
/nix/store/0rsh55ighfv3fxidf3xz8vl3abiika0i-libiconv-99/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1) |
We should also test in Github Actions CI (public runner, not self-hosted) that the static binary runs (without Nix installed) on both platforms. |
Down the line, we may even re-use #160 tests to use the static binary rather than the cargo bin. |
Just added this to the todo list. |
I guess it should be fine if we wrap static nix instead of the default one. |
There's also |
I think we should gets this PR into
This PR will reduce the closure size of |
@shivaraj-bh Let's get the Linux static binary part merged to |
aarch64-darwin
; Test static binary in CI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shivaraj-bh How should I test the binary on macOS? Currently getting:
I would assume, just copying and running the binary (after providing execute permissions using |
I believe it’s complete now. In another PR we should also look at releasing a tarball of these static binaries and provide a curl that users can use to download and run |
Yup.
That's what I did. Anyway, let's deal with it (the user-level usage instructions) in the aforementioned another PR. |
I was able to reproduce this. This happens when you download artifacts from a browser or any other app and try to run it. As in such a case Apple requires the binary to be notarized by them. But this is not a problem when you get the binary using curl. curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-PAT-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/juspay/omnix/actions/artifacts/1780161532/zip --output om.zip
unzip om.zip
./om |
Note: macOS system libraries will not be statically linked
resolves #149
Before
After
In
After
,libiconv
is statically linked.TODO:
nixpkgs-unstable
(Also see: Build failure: libiconv-darwin (static) NixOS/nixpkgs#320448 (comment))aarch64-darwin
; Test static binary in CI #158 (comment)- [ ] Consider how Use flake-schemas #166 will impact this.(see feat: Statically link libiconv onaarch64-darwin
; Test static binary in CI #158 (comment))