Conversation
| os: [ubuntu-18.04, macos-latest] | ||
| arch: [amd64, arm64] | ||
| exclude: | ||
| - {os: "ubuntu-18.04", arch: "arm64"} |
There was a problem hiding this comment.
Why exclude this? Rust supports targets like aarch64-unknown-linux-gnu and aarch64-unknown-none that could be used for cross-compilation. Is it because of gmp availability issues?
There was a problem hiding this comment.
Yes
For cross compiling we need to install gmp for ARM64.
We need to add ARM repos to /etc/apt/sources.list, and make apt install X:arm64 (where X is the package to install)
see https://askubuntu.com/questions/1169165/installing-libraries-for-arm64-on-ubuntu-bionic-x64
However we are not allowed to add repos in sources.list file using github actions.
| export HOMEBREW_NO_INSTALL_CLEANUP=TRUE | ||
| brew uninstall --ignore-dependencies gmp | ||
| rustup target add aarch64-apple-darwin | ||
| ARM_DEPENDENCY=$(brew fetch --force --bottle-tag=arm64_big_sur gmp | grep Downloaded | awk '{print $3}') |
There was a problem hiding this comment.
I prefer to keep the workflow simple and move the case specific logic into a script rather have separate case dependent steps.
There was a problem hiding this comment.
sounds good. I will encapsulate the commands in a script
There was a problem hiding this comment.
I added a script "install-gmp-arm64.sh" to encapsulate the complexity (install ARM64 gmp dependency)
| env: | ||
| TAGS: axelarnet/tofnd:${{ github.event.inputs.tag }} | ||
| COSIGN_EXPERIMENTAL: 1 | ||
| COSIGN_EXPERIMENTAL: 1 No newline at end of file |
There was a problem hiding this comment.
Keep newlines at the end of files?
9b3e7f8 to
08153c8
Compare
talalashraf
left a comment
There was a problem hiding this comment.
looks good. can we add something in README to compile for whatever platform we are missing. Can be a separate PR.
Ok, I will add it. |
Add cross compilation for supporting macOS ARM64
see dry-run (no upload to release and s3) here : https://github.com/axelarnetwork/tofnd/actions/runs/2568760166