Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use cross to fix arm64 release step (FuelLabs#3476)
Closes FuelLabs#2726 The issue was with the `cargo install` step, which resulted in the binaries being built and compiled on the `macos:latest` GitHub runner (which is on x86-apple-darwin ([source](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources))). This is why our "arm64" binaries were actually still in "amd64" format. A direct fix would be to update the step to use `cargo build --target ${{ matrix.job.os }}` instead, but I opted to go for an indirect fix which is to use `cross` for 2 reasons: 1) standardization, since we're using that for all other repos anyway, and 2) this allows us to skip some of the setup steps as well. I have a personal repo setup specifically to test this and the releases are here (albeit with older binary versions because I haven't yet pulled changes there): https://github.com/bingcicle/sway/releases/tag/nightly-2022-11-30. Output of `file forc` for each of the tarballs: amd64 Linux: `forc: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=3f51b5c41c1c915d117cb12214808a417d695dd7, with debug_info, not stripped` arm64 Linux: `forc: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=44bc7da687b369f5bf6bc8890ea97b31c6c4023a, with debug_info, not stripped` amd64 Darwin: `forc: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE|HAS_TLV_DESCRIPTORS>` arm64 Darwin: `forc: Mach-O 64-bit arm64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE|HAS_TLV_DESCRIPTORS>`
- Loading branch information