From 7284ae51fdec4bdaa80d99a6e4f961b8c3ae0e36 Mon Sep 17 00:00:00 2001 From: d3v-null Date: Wed, 13 Nov 2024 20:28:05 +0800 Subject: [PATCH] fix macos ci install deps --- .github/workflows/macos_ci.yml | 21 +++++++++++++++------ Makefile.toml | 8 +++++++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/macos_ci.yml b/.github/workflows/macos_ci.yml index 85e0810..64bc984 100644 --- a/.github/workflows/macos_ci.yml +++ b/.github/workflows/macos_ci.yml @@ -33,14 +33,23 @@ jobs: uses: davidB/rust-cargo-make@v1 - name: Install Dependencies run: | - # cargo make install_deps # doesn't work - brew install casacore/tap/casacore mwatelescope/tap/aoflagger + # cargo make install_deps + # doesn't work on macos, brew install ... says you need arch -arm64 brew ... + # but there's no way to distinguish between macos-13 and macos-14 + # using uname -m or arch + # https://github.com/actions/runner-images/issues/9471#issuecomment-1992603303 + for f in $(find /usr/local/bin -type l -print); do \ + (readlink $f | grep -q -s "/Library") && echo Removing "$f" && rm -f "$f"; \ + done + INSTALL="brew install" + [ "${{ matrix.os }}" == "macos-14" ] && INSTALL="arch -arm64 brew install" + $INSTALL mwatelescope/tap/aoflagger + echo "DYLD_FALLBACK_LIBRARY_PATH=$(brew --prefix)/lib/" >> $GITHUB_ENV + echo "AOFLAGGER_LIB=$(brew --prefix)/lib/" >> $GITHUB_ENV + echo "AOFLAGGER_INCLUDE_DIR=$(brew --prefix)/include/" >> $GITHUB_ENV + echo "PKG_CONFIG_PATH=$(brew --prefix)/lib/pkgconfig/" >> $GITHUB_ENV - name: Run tests run: | cargo make test_no_default cargo make test_no_flag cargo make test - env: - DYLD_FALLBACK_LIBRARY_PATH: /opt/homebrew/lib/ - AOFLAGGER_LIB: /opt/homebrew/lib/ - AOFLAGGER_INCLUDE_DIR: /opt/homebrew/include/ diff --git a/Makefile.toml b/Makefile.toml index 1d87cd0..08a618c 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -124,7 +124,13 @@ dependencies = ["linux_install_aoflagger"] [tasks.mac_install_deps] script = """ -brew install casacore/tap/casacore mwatelescope/tap/aoflagger +INSTALL="brew install" +# in github actions runners: +# - macos-13: uname -m => x86_64, arch => i386 +# - macos-14: uname -m => x86_64, arch => i386 +# but macos-14 should be arm64 ? +# in that case, we want INSTALL="arch -arm64 $INSTALL" apparently? +$INSTALL mwatelescope/tap/aoflagger """ [tasks.install_deps]