From e24562a009ce7bff50cfa354737d18e07b94c484 Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Fri, 19 Nov 2021 01:37:12 -0800 Subject: [PATCH] Update LLVM to 13 (#538) * Update dependencies * Fix warnings * Fix build * Fix script * Bump version * TEST * Revert "TEST" This reverts commit 51f89c77f9bb4d3879b40049a66efcc86e91d6dc. * Use clang * Remove targets from top-level rust-toolchain.toml * Revert "Use clang" This reverts commit 07a1159e58bace20c4710a73e3dcb302e24f0e8f. * Install gcc * Revert "Install gcc" This reverts commit 2e64f53c208641308a3a36e852b57d52ff14c9f9. * Install gcc * Try using Ubuntu 18.04 * Revert "Install gcc" This reverts commit 83302d593296ab9ebcb9383fbcfa3626b41f16e1. * Use Ubuntu 18.04 more * Clean homebrew cache after setup * Revert "Clean homebrew cache after setup" This reverts commit 0e3445ec2aa0441cf439c81f8ae31960b3eaee48. * Revert "Remove targets from top-level rust-toolchain.toml" This reverts commit b52d2b97376ac9c7c1290bc1ac4013eb36715c24. --- .cargo/config.toml | 2 ++ .github/workflows/release.yaml | 8 ++++---- .github/workflows/test.yaml | 6 +++--- Cargo.lock | 10 +++++----- doc/src/guides/install.md | 2 +- lib/infra/src/llvm_command_finder.rs | 2 +- tools/ci/set_up_os.sh | 8 +++++--- tools/lint.sh | 2 -- 8 files changed, 21 insertions(+), 19 deletions(-) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000000..16200e6238 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +rustflags = ["-A", "improper_ctypes", "-D", "improper_ctypes_definitions"] diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ccae4c247f..cda3f9a0fd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,7 +6,7 @@ on: pull_request: jobs: tag_check: - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 outputs: version: ${{ env.version }} should_release: ${{ env.should_release }} @@ -25,7 +25,7 @@ jobs: fail-fast: false matrix: os: - - ubuntu-latest + - ubuntu-18.04 - macos-latest runs-on: ${{ matrix.os }} steps: @@ -40,7 +40,7 @@ jobs: needs: - tag_check - build_asset - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 with: @@ -63,7 +63,7 @@ jobs: - tag_check - release if: needs.tag_check.outputs.should_release == 'true' - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 480ffa6738..63318c99a8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,14 +6,14 @@ on: pull_request: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - run: tools/ci/set_up_os.sh - run: cargo build --locked - run: git diff --exit-code unit_test: - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - run: tools/ci/set_up_os.sh @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: - - ubuntu-latest + - ubuntu-18.04 - macos-latest runs-on: ${{ matrix.os }} steps: diff --git a/Cargo.lock b/Cargo.lock index 859108789e..9123c7c99d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -214,7 +214,7 @@ checksum = "398ea4fabe40b9b0d885340a2a991a44c8a645624075ad966d21f88688e2b69e" [[package]] name = "fmm" version = "0.1.0" -source = "git+https://github.com/raviqqe/fmm?branch=main#f932c4b155fa5da00678d7fee49d7349b34ccb21" +source = "git+https://github.com/raviqqe/fmm?branch=main#c09eeb3a807c0beefcd7b0ef25d70595967f8f4f" dependencies = [ "hamt", "once_cell", @@ -225,7 +225,7 @@ dependencies = [ [[package]] name = "fmm-c" version = "0.1.0" -source = "git+https://github.com/raviqqe/fmm?branch=main#f932c4b155fa5da00678d7fee49d7349b34ccb21" +source = "git+https://github.com/raviqqe/fmm?branch=main#c09eeb3a807c0beefcd7b0ef25d70595967f8f4f" dependencies = [ "fmm", "tempfile", @@ -234,7 +234,7 @@ dependencies = [ [[package]] name = "fmm-llvm" version = "0.1.0" -source = "git+https://github.com/raviqqe/fmm?branch=main#f932c4b155fa5da00678d7fee49d7349b34ccb21" +source = "git+https://github.com/raviqqe/fmm?branch=main#c09eeb3a807c0beefcd7b0ef25d70595967f8f4f" dependencies = [ "fmm", "hamt", @@ -449,9 +449,9 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "llvm-sys" -version = "120.2.1" +version = "130.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a810627ac62b396f5fd2214ba9bbd8748d4d6efdc4d2c1c1303ea7a75763ce" +checksum = "8a0de69eac0257a2f6c0da27b42e6a8dd21bae7b39c37caf87aee6021d79d61f" dependencies = [ "cc", "lazy_static", diff --git a/doc/src/guides/install.md b/doc/src/guides/install.md index bb8a76eed0..66c050affe 100644 --- a/doc/src/guides/install.md +++ b/doc/src/guides/install.md @@ -26,7 +26,7 @@ You can also build Pen from source on your local machine. 1. Install the following software using a package manager of your choice (e.g. `apt` for Ubuntu and [Homebrew][homebrew] for macOS.) - [Rust](https://www.rust-lang.org/) - - [LLVM 12](https://llvm.org/) + - [LLVM 13](https://llvm.org/) - [Git](https://git-scm.com/) - [Ninja](https://ninja-build.org/) diff --git a/lib/infra/src/llvm_command_finder.rs b/lib/infra/src/llvm_command_finder.rs index 113625fdcf..6966899248 100644 --- a/lib/infra/src/llvm_command_finder.rs +++ b/lib/infra/src/llvm_command_finder.rs @@ -2,7 +2,7 @@ use crate::command_finder; use std::{error::Error, path::PathBuf}; const MINIMUM_VERSION: usize = 11; -const MAXIMUM_VERSION: usize = 12; +const MAXIMUM_VERSION: usize = 13; pub fn find(command: &str) -> Result> { for version in (MINIMUM_VERSION..=MAXIMUM_VERSION).rev() { diff --git a/tools/ci/set_up_os.sh b/tools/ci/set_up_os.sh index 487779ff86..d463cd621c 100755 --- a/tools/ci/set_up_os.sh +++ b/tools/ci/set_up_os.sh @@ -2,11 +2,13 @@ set -e -brew install jq llvm@12 ninja +llvm_version=13 -llvm_prefix=$(brew --prefix)/opt/llvm@12 +brew install jq llvm@$llvm_version ninja -echo LLVM_SYS_120_PREFIX=$llvm_prefix >>$GITHUB_ENV +llvm_prefix=$(brew --prefix)/opt/llvm@$llvm_version + +echo LLVM_SYS_${llvm_version}0_PREFIX=$llvm_prefix >>$GITHUB_ENV echo PATH=$llvm_prefix/bin:$PATH >>$GITHUB_ENV if [ $RUNNER_OS = Linux ]; then diff --git a/tools/lint.sh b/tools/lint.sh index 4c37603c40..5027d25119 100755 --- a/tools/lint.sh +++ b/tools/lint.sh @@ -18,8 +18,6 @@ install_nightly_component clippy $(dirname $0)/run_all_crates.sh \ rustup run nightly cargo clippy $options -Z unstable-options -- \ - -A improper_ctypes \ - -D improper_ctypes_definitions \ -D clippy::use_self \ -D clippy::mod_module_files \ "$@"