From b23440dbd0d0a55dff198847e97c2fe5c10f7b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Tue, 20 Dec 2022 13:29:39 +0100 Subject: [PATCH 1/2] system-build: fix LLVM linkage type detection on macOS --- system-build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system-build.sh b/system-build.sh index bce94885..a7718f0b 100755 --- a/system-build.sh +++ b/system-build.sh @@ -282,7 +282,11 @@ if [ -z "$LLVM_DIR" ]; then fi # detect the link type of LLVM that we use -if [ "$($LLVM_CONFIG --shared-mode --libs)" = "shared" ]; then +if [ "$($LLVM_CONFIG --shared-mode --libs)" = "shared" ] || \ + # TODO: $LLVM_CONFIG --shared-mode is broken on macOS: + # https://bugs.llvm.org/show_bug.cgi?id=40252 + # This workaround won't be needed when we switch to CMake. + stat "$LLVM_LIB_DIR"/libLLVM.dylib; then LLVM_DYLIB="on" else LLVM_DYLIB="off" From 29a06b19338b5f46e5572fde1ff572a2830b813b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Mon, 19 Dec 2022 18:49:07 +0100 Subject: [PATCH 2/2] CI: add macOS workflow with LLVM 9 --- .github/workflows/macos.yml | 63 +++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 00000000..6da54d0e --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,63 @@ +--- +name: macOS CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + ubuntu: + name: "macOS (llvm: ${{matrix.llvm}}, build: ${{matrix.build}})" + strategy: + fail-fast: false + matrix: + llvm: [9] + build: ['RelWithDebInfo', 'Debug'] + + runs-on: macos-latest + env: + CC: clang + CXX: clang++ + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: true + + - name: Install dependencies + # FIXME: we should not depend on GNU coreutils + run: brew install coreutils ccache llvm@${{matrix.llvm}} z3 + + - name: Set environment + id: env + run: | + echo "CCACHE_BASEDIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV + echo "CCACHE_DIR=$GITHUB_WORKSPACE/.ccache" >> $GITHUB_ENV + echo "CCACHE_COMPRESS=true" >> $GITHUB_ENV + echo "CCACHE_COMPRESSLEVEL=6" >> $GITHUB_ENV + echo "CCACHE_MAXSIZE=400M" >> $GITHUB_ENV + + echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + echo "timestamp=$(date -u +%Y-%m-%dT%H:%M:%S%z)" >> $GITHUB_OUTPUT + + - name: Set up ccache + uses: actions/cache@v3 + with: + path: .ccache + key: macos-${{matrix.llvm}}-${{matrix.build}}-${{steps.env.outputs.timestamp}} + restore-keys: macos-${{matrix.llvm}}-${{matrix.build}} + + - name: Build Symbiotic + run: | + ./system-build.sh -j"$(sysctl -n hw.logicalcpu)" build-type=${{matrix.build}} \ + llvm-config="$(brew --prefix llvm@${{matrix.llvm}})/bin/llvm-config" + + - name: Run tests + run: make -C tests + + - name: ccache statistics + run: ccache -s