diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42c758c1935..add2f000f69 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,14 +44,14 @@ jobs: - build: linux-x64 os: ubuntu-20.04 artifact_name: 'wasmer-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-linux-amd64.tar.xz' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/14.x/llvm-linux-amd64.tar.xz' cross_compilation_artifact_name: 'cross_compiled_from_linux' use_sccache: true use_llvm: true build_wasm: true - build: macos-x64 os: macos-11 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-darwin-amd64.tar.xz' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/14.x/llvm-darwin-amd64.tar.xz' artifact_name: 'wasmer-darwin-amd64' cross_compilation_artifact_name: 'cross_compiled_from_mac' use_sccache: true @@ -67,7 +67,7 @@ jobs: - build: windows-x64 os: windows-2019 artifact_name: 'wasmer-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/14.x/llvm-windows-amd64.tar.xz' cross_compilation_artifact_name: 'cross_compiled_from_win' use_sccache: true use_llvm: true @@ -75,7 +75,7 @@ jobs: - build: linux-musl-x64 os: ubuntu-latest artifact_name: 'wasmer-linux-musl-amd64' - #llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-linux-amd64.tar.xz' + #llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/14.x/llvm-linux-amd64.tar.xz' container: alpine:latest use_sccache: false use_llvm: false @@ -115,7 +115,8 @@ jobs: mkdir -p ${LLVM_DIR} curl --proto '=https' --tlsv1.2 -sSf "${{ matrix.llvm_url }}" -L -o - | tar xJv -C ${LLVM_DIR} echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_140_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV env: LLVM_DIR: .llvm - name: Set up dependencies for Mac OS diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2140c8e383b..07dc766d7dd 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -48,7 +48,7 @@ jobs: sudo apt install -y libtinfo5 - name: Install LLVM (Linux) run: | - curl --proto '=https' --tlsv1.2 -sSf 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 -L -o /opt/llvm.tar.xz + curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o /opt/llvm.tar.xz mkdir -p /opt/llvm-12 tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-12 echo '/opt/llvm-12/bin' >> $GITHUB_PATH @@ -203,7 +203,7 @@ jobs: build: linux-x64, os: ubuntu-22.04, target: x86_64-unknown-linux-gnu, - 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' + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz' }, { build: linux-musl, @@ -215,7 +215,7 @@ jobs: build: macos-x64, os: macos-11, target: x86_64-apple-darwin, - 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' + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang+llvm-14.0.6-x86_64-apple-darwin.tar.xz' }, { build: macos-arm, @@ -226,7 +226,7 @@ jobs: build: windows-x64, os: windows-2019, target: x86_64-pc-windows-msvc, - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/14.x/llvm-windows-amd64.tar.xz' }, { build: windows-gnu, @@ -313,7 +313,8 @@ jobs: tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} echo "ENABLE_LLVM=1" >> $GITHUB_ENV echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_140_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV env: LLVM_DIR: .llvm - name: Setup Rust target @@ -436,19 +437,19 @@ jobs: build: linux-x64, os: ubuntu-22.04, target: x86_64-unknown-linux-gnu, - 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' + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz' }, { build: macos-x64, os: macos-11, target: x86_64-apple-darwin, - 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' + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang+llvm-14.0.6-x86_64-apple-darwin.tar.xz' }, { build: windows-x64, os: windows-2019, target: x86_64-pc-windows-msvc, - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/14.x/llvm-windows-amd64.tar.xz' }, { build: linux-musl, @@ -542,11 +543,11 @@ jobs: - build: linux-x64 os: ubuntu-22.04 target: x86_64-unknown-linux-gnu - 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' + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz' - build: macos-x64 os: macos-11 target: x86_64-apple-darwin - 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' + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang+llvm-14.0.6-x86_64-apple-darwin.tar.xz' # we only build the integration-test CLI, we don't run tests - build: macos-arm os: macos-11 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5665f393dbc..e2b5d10ab9c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,4 +24,5 @@ A comprehensive CI test suite will be run by a Wasmer team member after the PR h `Didn't find usable system-wide LLVM` -Building Wasmer with the LLVM backend requires LLVM to be installed +Building Wasmer with the LLVM backend requires LLVM 14 or better to be installed +On debian family you need `sudo apt install llvm14 libclang-common-14-dev libpolly-14-dev` diff --git a/Cargo.lock b/Cargo.lock index e863ac889bc..ee8d768d717 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2084,15 +2084,15 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "llvm-sys" -version = "120.2.5" +version = "140.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1c9655eec036faf512507746ce70765bda72ed98e52b4328f0d7b93e970c6d8" +checksum = "3fe3609d79f74a2e4e158e3eaa61c2e931cecba242a79de5529cec2f92b423b7" dependencies = [ "cc", "lazy_static", "libc", "regex", - "semver 0.11.0", + "semver 1.0.16", ] [[package]] diff --git a/Makefile b/Makefile index 03515a6e5dc..011433d28ff 100644 --- a/Makefile +++ b/Makefile @@ -133,20 +133,21 @@ else ifeq ($(ENABLE_LLVM), 1) LLVM_VERSION := $(shell llvm-config --version) compilers += llvm # … or try to autodetect LLVM from `llvm-config-`. -else ifneq (, $(shell which llvm-config-13 2>/dev/null)) - LLVM_VERSION := $(shell llvm-config-13 --version) +else ifneq (, $(shell which llvm-config-14 2>/dev/null)) + LLVM_VERSION := $(shell llvm-config-14 --version) compilers += llvm - # need force LLVM_SYS_120_PREFIX, or llvm_sys will not build in the case - export LLVM_SYS_120_PREFIX = $(shell llvm-config-13 --prefix) -else ifneq (, $(shell which llvm-config-12 2>/dev/null)) - LLVM_VERSION := $(shell llvm-config-12 --version) + # need force LLVM_SYS_140_PREFIX, or llvm_sys will not build in the case + export LLVM_SYS_140_PREFIX = $(shell llvm-config-14 --prefix) +else ifneq (, $(shell which llvm-config-15 2>/dev/null)) + LLVM_VERSION := $(shell llvm-config-15 --version) compilers += llvm - # … otherwise, we try to autodetect LLVM from `llvm-config` + # need force LLVM_SYS_140_PREFIX, or llvm_sys will not build in the case + export LLVM_SYS_140_PREFIX = $(shell llvm-config-15 --prefix) else ifneq (, $(shell which llvm-config 2>/dev/null)) LLVM_VERSION := $(shell llvm-config --version) - ifneq (, $(findstring 13,$(LLVM_VERSION))) + ifneq (, $(findstring 15,$(LLVM_VERSION))) compilers += llvm - else ifneq (, $(findstring 12,$(LLVM_VERSION))) + else ifneq (, $(findstring 14,$(LLVM_VERSION))) compilers += llvm endif endif diff --git a/lib/compiler-llvm/Cargo.toml b/lib/compiler-llvm/Cargo.toml index 35303b7a2b5..b5992384945 100644 --- a/lib/compiler-llvm/Cargo.toml +++ b/lib/compiler-llvm/Cargo.toml @@ -29,7 +29,7 @@ rayon = "1.5" package = "inkwell" version = "0.1.1" default-features = false -features = ["llvm12-0", "target-x86", "target-aarch64"] +features = ["llvm14-0", "target-x86", "target-aarch64"] [build-dependencies] cc = "1.0"