From aa998166c513aeef964916da16f3e44c5942fe72 Mon Sep 17 00:00:00 2001 From: Per Larsen Date: Fri, 26 Apr 2024 00:21:06 -0700 Subject: [PATCH] CI: Fix Azure pipelines Darwin build --- azure-pipelines.yml | 6 +++--- c2rust-build-paths/src/lib.rs | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5a0966aeb..293503998 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -94,13 +94,13 @@ jobs: # prepare environment for the following steps source $HOME/.cargo/env # print some useful info to help troubleshoot - brew info llvm + brew info llvm@17 which python3 /usr/bin/env python3 -c "import sys; print(sys.path)" displayName: 'Provision macOS' - script: | - export LLVM_CONFIG_PATH=$(brew --prefix llvm)/bin/llvm-config + export LLVM_CONFIG_PATH=$(brew --prefix llvm@17)/bin/llvm-config export RUSTFLAGS="-D warnings" export RUSTDOCFLAGS="-D warnings" # Don't build with `--all-features` (see analogous step for Linux). @@ -108,7 +108,7 @@ jobs: displayName: 'cargo build against host clang/LLVM (fast build)' - script: | - export LLVM_CONFIG_PATH=$(brew --prefix llvm)/bin/llvm-config + $(brew --prefix llvm@17)/bin/llvm-config export RUSTFLAGS="-D warnings" export RUSTDOCFLAGS="-D warnings" cargo test --release --workspace diff --git a/c2rust-build-paths/src/lib.rs b/c2rust-build-paths/src/lib.rs index 1f5bb1aff..e362e5015 100644 --- a/c2rust-build-paths/src/lib.rs +++ b/c2rust-build-paths/src/lib.rs @@ -91,6 +91,10 @@ pub fn find_llvm_config() -> Option { .or_else(|| { // In PATH [ + "llvm-config-18", + "llvm-config-17", + "llvm-config-16", + "llvm-config-15", "llvm-config-14", "llvm-config-13", "llvm-config-12", @@ -102,6 +106,11 @@ pub fn find_llvm_config() -> Option { "llvm-config-7.0", "llvm-config", // Homebrew install locations on Intel macOS + "/usr/local/opt/llvm@18/bin/llvm-config", + "/usr/local/opt/llvm@17/bin/llvm-config", + "/usr/local/opt/llvm@16/bin/llvm-config", + "/usr/local/opt/llvm@15/bin/llvm-config", + "/usr/local/opt/llvm@14/bin/llvm-config", "/usr/local/opt/llvm@13/bin/llvm-config", "/usr/local/opt/llvm@12/bin/llvm-config", "/usr/local/opt/llvm@11/bin/llvm-config", @@ -110,6 +119,11 @@ pub fn find_llvm_config() -> Option { "/usr/local/opt/llvm@8/bin/llvm-config", "/usr/local/opt/llvm/bin/llvm-config", // Homebrew install locations on Apple Silicon macOS + "/opt/homebrew/opt/llvm@18/bin/llvm-config", + "/opt/homebrew/opt/llvm@17/bin/llvm-config", + "/opt/homebrew/opt/llvm@16/bin/llvm-config", + "/opt/homebrew/opt/llvm@15/bin/llvm-config", + "/opt/homebrew/opt/llvm@14/bin/llvm-config", "/opt/homebrew/opt/llvm@13/bin/llvm-config", "/opt/homebrew/opt/llvm@12/bin/llvm-config", "/opt/homebrew/opt/llvm@11/bin/llvm-config",