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

Fix LLVM detection #5231

Merged
merged 16 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 7 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,10 @@ jobs:
- name: Set up base deps on musl
if: matrix.metadata.build == 'linux-musl'
run: |
./scripts/alpine-linux-install-deps.sh
./scripts/alpine-linux-install-deps.sh
echo "ENABLE_LLVM=0" >> $GITHUB_ENV
echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
# echo "RUSTFLAGS=-L/usr/lib64 -L/usr/lib" >> $GITHUB_ENV
- name: Set up dependencies for Mac OS
run: |
brew install automake
Expand Down Expand Up @@ -796,7 +798,9 @@ jobs:
if: matrix.metadata.build == 'linux-musl'
run: |
./scripts/alpine-linux-install-deps.sh
echo "ENABLE_LLVM=0" >> $GITHUB_ENV
echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
# echo "RUSTFLAGS=-L/usr/lib64 -L/usr/lib" >> $GITHUB_ENV
- name: Install MSVC dev-cmd (Windows)
uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.metadata.build == 'windows-x64' }}
Expand Down Expand Up @@ -916,7 +920,9 @@ jobs:
if: matrix.build == 'linux-musl'
run: |
./scripts/alpine-linux-install-deps.sh
echo "ENABLE_LLVM=0" >> $GITHUB_ENV
echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
# echo "RUSTFLAGS=-L/usr/lib64 -L/usr/lib" >> $GITHUB_ENV
- uses: actions/download-artifact@v4
id: download
with:
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,19 @@ else ifeq ($(ENABLE_LLVM), 1)
LLVM_VERSION := $(shell llvm-config --version)
compilers += llvm
# … or try to autodetect LLVM from `llvm-config-<version>`.
else ifneq (, $(shell which llvm-config-15 2>/dev/null))
LLVM_VERSION := $(shell llvm-config-15 --version)
else ifneq (, $(shell which llvm-config-18 2>/dev/null))
LLVM_VERSION := $(shell llvm-config-18 --version)
compilers += llvm
# need force LLVM_SYS_150_PREFIX, or llvm_sys will not build in the case
export LLVM_SYS_150_PREFIX = $(shell llvm-config-15 --prefix)
# need force LLVM_SYS_180_PREFIX, or llvm_sys will not build in the case
export LLVM_SYS_180_PREFIX = $(shell llvm-config-18 --prefix)
else ifneq (, $(shell which llvm-config 2>/dev/null))
LLVM_VERSION := $(shell llvm-config --version)
ifneq (, $(findstring 15,$(LLVM_VERSION)))
ifneq (, $(findstring 18,$(LLVM_VERSION)))
compilers += llvm
export LLVM_SYS_150_PREFIX = $(shell llvm-config --prefix)
export LLVM_SYS_180_PREFIX = $(shell llvm-config --prefix)
else ifneq (, $(findstring 14,$(LLVM_VERSION)))
compilers += llvm
export LLVM_SYS_150_PREFIX = $(shell llvm-config --prefix)
export LLVM_SYS_180_PREFIX = $(shell llvm-config --prefix)
endif
endif

Expand Down
3 changes: 2 additions & 1 deletion scripts/alpine-linux-install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
# This script is used by the CI!

apk update
apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ pkgconfig llvm18-dev clang18-static llvm18-static
apk add bash mold make curl cmake ninja clang18 zstd-static llvm18-dev clang18-static llvm18-static ncurses-static zlib-static
ln -s /usr/bin/clang-18 /usr/bin/clang
Loading