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

chore(infra): mac-os builds fail, solve by porting some changes from main #327

Merged
merged 6 commits into from
Jul 5, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .github/workflows/build-docker-image-and-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,34 @@ jobs:
TOFND_PATH="/Users/runner/work/tofnd/tofnd/target/release"
fi

- name: build darwin binaries
talalashraf marked this conversation as resolved.
Show resolved Hide resolved
milapsheth marked this conversation as resolved.
Show resolved Hide resolved
env:
SEMVER: ${{ github.event.inputs.tag }}
if: matrix.os == 'macos-latest'
run: |
OS="darwin"
ARCH="${{ matrix.arch }}"
if [ "$ARCH" == "arm64" ]
export LIBRARY_PATH=/opt/homebrew/lib:$LIBRARY_PATH
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
export LD_LIBRARY_PATH=/opt/homebrew/lib:$LD_LIBRARY_PATH
brew uninstall --ignore-dependencies gmp
then
talalashraf marked this conversation as resolved.
Show resolved Hide resolved
ARM_DEPENDENCY=$(brew fetch --force --bottle-tag=arm64_sonoma gmp | grep Downloaded | awk '{print $3}')
rustup target add aarch64-apple-darwin
cargo build --release --target aarch64-apple-darwin
mkdir -p tofndbin
mv /Users/runner/work/tofnd/tofnd/target/aarch64-apple-darwin/release/tofnd "./tofndbin/tofnd-$OS-$ARCH-$SEMVER"
else
export RUSTFLAGS="-L/opt/homebrew/lib"
export C_INCLUDE_PATH=/opt/homebrew/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/opt/homebrew/include:$CPLUS_INCLUDE_PATH
ARM_DEPENDENCY=$(brew fetch --force --bottle-tag=arm64_sonoma gmp | grep Downloaded | awk '{print $3}')
brew install "$ARM_DEPENDENCY"
cargo install --locked --path .
mkdir -p tofndbin
mv "/Users/runner/work/tofnd/tofnd/target/release/tofnd" "./tofndbin/tofnd-$OS-$ARCH-$SEMVER"
talalashraf marked this conversation as resolved.
Show resolved Hide resolved
fi
milapsheth marked this conversation as resolved.
Show resolved Hide resolved
- name: build linux binaries
milapsheth marked this conversation as resolved.
Show resolved Hide resolved
env:
SEMVER: ${{ github.event.inputs.tag }}
Expand All @@ -71,8 +99,8 @@ jobs:
OS="linux"
ARCH="${{ matrix.arch }}"
cargo install --locked --path .
mkdir tofndbin
mv "$TOFND_PATH/tofnd" "./tofndbin/tofnd-$OS-$ARCH-$SEMVER"
mkdir -p tofndbin
mv "/home/runner/.cargo/bin/tofnd" "./tofndbin/tofnd-$OS-$ARCH-$SEMVER"

- name: Test tofnd version
working-directory: ./tofndbin
Expand Down
Loading