Skip to content

Commit

Permalink
Makefile/CI: Re-enable LLVM on default builds
Browse files Browse the repository at this point in the history
  • Loading branch information
epilys committed May 23, 2022
1 parent 2be85b0 commit 479b616
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 23 deletions.
40 changes: 27 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,34 @@ jobs:
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz'
cross_compilation_artifact_name: 'cross_compiled_from_linux'
use_sccache: true
use_llvm: true
- build: macos-x64
os: macos-11
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz'
artifact_name: 'wasmer-darwin-amd64'
cross_compilation_artifact_name: 'cross_compiled_from_mac'
use_sccache: true
use_llvm: true
- build: macos-arm64
os: macos-11.0
target: aarch64-apple-darwin
artifact_name: 'wasmer-darwin-arm64'
use_sccache: true
use_llvm: false
- build: windows-x64
os: windows-2019
artifact_name: 'wasmer-windows-amd64'
# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz'
llvm_choco_version: 13.0.0
#llvm_choco_version: 13.0.0
cross_compilation_artifact_name: 'cross_compiled_from_win'
use_sccache: true
use_llvm: false
- build: linux-musl-x64
os: ubuntu-latest
artifact_name: 'wasmer-linux-musl-amd64'
container: alpine:latest
use_sccache: false
use_llvm: false
container: ${{ matrix.container }}
env:
SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob
Expand Down Expand Up @@ -186,7 +191,14 @@ jobs:
- name: Build C API
run: |
make build-capi
- name: Build Wasmer binary
- name: Build Wasmer binary with LLVM
if: matrix.use_llvm
run: |
make build-wasmer
env:
ENABLE_LLVM: 1
- name: Build Wasmer binary without LLVM
if: matrix.use_llvm != true
run: |
make build-wasmer
- name: Build Wapm binary
Expand Down Expand Up @@ -249,17 +261,17 @@ jobs:
docker build -t wasmer/aarch64 /home/runner/work/wasmer/wasmer/.github/cross-linux-aarch64/
env:
CROSS_DOCKER_IN_DOCKER: true
- name: Install LLVM
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSf "https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-aarch64-linux-gnu.tar.xz" -L -o llvm.tar.xz
LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }}
mkdir ${LLVM_DIR}
tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR}
echo "${LLVM_DIR}/bin" >> $GITHUB_PATH
echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV
env:
LLVM_DIR: .llvm
#- name: Install LLVM
# shell: bash
# run: |
# curl --proto '=https' --tlsv1.2 -sSf "https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-aarch64-linux-gnu.tar.xz" -L -o llvm.tar.xz
# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }}
# mkdir ${LLVM_DIR}
# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR}
# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH
# echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV
# env:
# LLVM_DIR: .llvm
- name: Build Wasmer binary
run: |
make build-wasmer
Expand All @@ -269,6 +281,7 @@ jobs:
CARGO_TARGET: --target aarch64-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
ENABLE_LLVM: 0
- name: Build C API
run: |
make build-capi
Expand All @@ -278,6 +291,7 @@ jobs:
CARGO_TARGET: --target aarch64-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
ENABLE_LLVM: 0
- name: Dist
run: |
make distribution
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ CARGO_TARGET ?=
ENABLE_CRANELIFT ?=
ENABLE_LLVM ?=
ENABLE_SINGLEPASS ?=
LLVM_VERSION ?=

# Which compilers we build. These have dependencies that may not be on the system.
compilers :=
Expand All @@ -130,11 +129,11 @@ endif
ifneq ($(ENABLE_LLVM), 0)
# … then maybe the user forced to enable the LLVM compiler.
ifeq ($(ENABLE_LLVM), 1)
LLVM_VERSION ?= $(shell llvm-config --version)
LLVM_VERSION := $(shell llvm-config --version)
compilers += llvm
# … otherwise, we try to autodetect LLVM from `llvm-config`
else ifneq (, $(shell which llvm-config 2>/dev/null))
LLVM_VERSION ?= $(shell llvm-config --version)
LLVM_VERSION := $(shell llvm-config --version)

# If findstring is not empty, then it have found the value
ifneq (, $(findstring 13,$(LLVM_VERSION)))
Expand All @@ -145,10 +144,10 @@ ifneq ($(ENABLE_LLVM), 0)
# … or try to autodetect LLVM from `llvm-config-<version>`.
else
ifneq (, $(shell which llvm-config-13 2>/dev/null))
LLVM_VERSION ?= $(shell llvm-config-13 --version)
LLVM_VERSION := $(shell llvm-config-13 --version)
compilers += llvm
else ifneq (, $(shell which llvm-config-12 2>/dev/null))
LLVM_VERSION ?= $(shell llvm-config-12 --version)
LLVM_VERSION := $(shell llvm-config-12 --version)
compilers += llvm
endif
endif
Expand Down
10 changes: 5 additions & 5 deletions bors.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
status = [
"Audit",
#"Audit",
"Code lint",
"Test on linux-x64",
#"Test on linux-x64",
# "Test on linux-musl-x64",
# "Test on linux-aarch64",
"Test on macos-arm64",
"Test on macos-x64",
"Test on windows-x64",
#"Test on macos-arm64",
#"Test on macos-x64",
#"Test on windows-x64",
]
required_approvals = 0
timeout_sec = 7200
Expand Down

0 comments on commit 479b616

Please sign in to comment.