Skip to content

feat: add macos arm64 build#304

Closed
kalidax wants to merge 95 commits intomainfrom
feat/arm-support
Closed

feat: add macos arm64 build#304
kalidax wants to merge 95 commits intomainfrom
feat/arm-support

Conversation

@kalidax
Copy link
Copy Markdown
Contributor

@kalidax kalidax commented Jun 27, 2022

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

os: [ubuntu-18.04, macos-latest]
arch: [amd64, arm64]
exclude:
- {os: "ubuntu-18.04", arch: "arm64"}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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}')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I prefer to keep the workflow simple and move the case specific logic into a script rather have separate case dependent steps.

Copy link
Copy Markdown
Contributor Author

@kalidax kalidax Jun 30, 2022

Choose a reason for hiding this comment

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

sounds good. I will encapsulate the commands in a script

Copy link
Copy Markdown

@kalidux kalidux Jul 1, 2022

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Keep newlines at the end of files?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

added newline

@kalidax kalidax force-pushed the feat/arm-support branch from 9b3e7f8 to 08153c8 Compare June 30, 2022 16:12
Copy link
Copy Markdown
Contributor

@talalashraf talalashraf left a comment

Choose a reason for hiding this comment

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

looks good. can we add something in README to compile for whatever platform we are missing. Can be a separate PR.

@kalidax
Copy link
Copy Markdown
Contributor Author

kalidax commented Jul 5, 2022

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.

@sdaveas sdaveas force-pushed the feat/arm-support branch from 2ba867d to e25480f Compare July 7, 2022 14:29
@sdaveas sdaveas force-pushed the feat/arm-support branch from 6a3d9cb to 1176b23 Compare July 8, 2022 10:27
@sdaveas sdaveas closed this Jul 8, 2022
@sdaveas sdaveas reopened this Jul 8, 2022
@sdaveas sdaveas closed this Jul 8, 2022
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.

5 participants