Skip to content

Commit

Permalink
upgrade to rust v1.78 and llvm-18 (#123)
Browse files Browse the repository at this point in the history
* upgrade to rust v1.78 and llvm-18

* upgrade setup-python to v5
  • Loading branch information
Congyuwang authored May 10, 2024
1 parent 698c7cc commit 49e6bf8
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 55 deletions.
50 changes: 26 additions & 24 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,25 @@ on:

jobs:
macos:
runs-on: macos-latest
runs-on: macos-13
strategy:
fail-fast: false
matrix:
py_version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Install llvm-17
run: brew install llvm@17
- uses: actions/setup-python@v4
- name: Install llvm-18
run: |
brew update
brew install llvm@18
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py_version }}
architecture: x64
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: 1.78.0
default: true
- name: Build wheels
run: |
Expand Down Expand Up @@ -62,30 +64,30 @@ jobs:
py_version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py_version }}
architecture: ${{ matrix.target }}
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
uses: KyleMayes/install-llvm-action@v2
with:
version: 17.0
directory: ${{ runner.temp }}/llvm-17.0
version: 18.1
directory: ${{ runner.temp }}/llvm-18.1
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: 1.78.0
default: true
- name: Build wheels
uses: messense/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
env:
LIBCLANG_PATH: ${{ runner.temp }}/llvm-17.0/lib
CC: ${{ runner.temp }}/llvm-17.0/bin/clang-cl
CXX: ${{ runner.temp }}/llvm-17.0/bin/clang-cl
AR: ${{ runner.temp }}/llvm-17.0/bin/llvm-lib
LIBCLANG_PATH: ${{ runner.temp }}/llvm-18.1/lib
CC: ${{ runner.temp }}/llvm-18.1/bin/clang-cl
CXX: ${{ runner.temp }}/llvm-18.1/bin/clang-cl
AR: ${{ runner.temp }}/llvm-18.1/bin/llvm-lib
CFLAGS: "/clang:-flto=thin /clang:-O3 /clang:-fuse-ld=lld-link"
CXXFLAGS: "/clang:-flto=thin /clang:-O3 /clang:-fuse-ld=lld-link"
RUSTFLAGS: "-Clinker-plugin-lto -Clinker=lld-link"
Expand All @@ -108,19 +110,19 @@ jobs:
target: [x86_64]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: x64
- name: Build Wheels
uses: messense/maturin-action@v1
with:
rust-toolchain: stable
rust-toolchain: 1.78.0
rustup-components: rustfmt
target: ${{ matrix.target }}
manylinux: 2_28
args: --release --out dist --interpreter '3.7 3.8 3.9 3.10 3.11 3.12'
container: congyuwang/manylinux_2_28_x86_64:llvm-17.0.6
container: congyuwang/manylinux_2_28_x86_64:llvm-18.1.5
env:
LIBCLANG_PATH: /usr/local/lib
CC: /usr/local/bin/clang
Expand Down Expand Up @@ -149,19 +151,19 @@ jobs:
target: [x86_64]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: x64
- name: Build Wheels
uses: messense/maturin-action@v1
with:
rust-toolchain: stable
rust-toolchain: 1.78.0
rustup-components: rustfmt
target: ${{ matrix.target }}
manylinux: 2014
args: --release --out dist --interpreter '3.7 3.8 3.9 3.10 3.11 3.12'
container: congyuwang/manylinux2014_x86_64:llvm-17.0.6
container: congyuwang/manylinux2014_x86_64:llvm-18.1.5
env:
LIBCLANG_PATH: /usr/local/lib
CC: /usr/local/bin/clang
Expand Down Expand Up @@ -189,18 +191,18 @@ jobs:
target: [aarch64]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Build Wheels
uses: messense/maturin-action@v1
with:
rust-toolchain: stable
rust-toolchain: 1.78.0
rustup-components: rustfmt
target: ${{ matrix.target }}
manylinux: 2_28
args: --release --out dist --interpreter '3.7 3.8 3.9 3.10 3.11 3.12'
container: congyuwang/manylinux_2_28_aarch64:llvm-17.0.6
container: congyuwang/manylinux_2_28_aarch64:llvm-18.1.5
docker-options: "-e BINDGEN_EXTRA_CLANG_ARGS"
before-script-linux: |
ln -s /usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/7.5.0/crtbeginS.o /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/lib/crtbeginS.o
Expand Down Expand Up @@ -253,7 +255,7 @@ jobs:
- uses: actions/download-artifact@v2
with:
name: wheels
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Publish to PyPi
Expand Down
48 changes: 25 additions & 23 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,25 @@ on:

jobs:
macos:
runs-on: macos-latest
runs-on: macos-13
strategy:
fail-fast: false
matrix:
py_version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Install llvm-17
run: brew install llvm@17
- uses: actions/setup-python@v4
- name: Install llvm-18
run: |
brew update
brew install llvm@18
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py_version }}
architecture: x64
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: 1.78.0
default: true
- name: Build wheels
run: |
Expand Down Expand Up @@ -62,30 +64,30 @@ jobs:
py_version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py_version }}
architecture: ${{ matrix.target }}
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
uses: KyleMayes/install-llvm-action@v2
with:
version: 17.0
directory: ${{ runner.temp }}/llvm-17.0
version: 18.1
directory: ${{ runner.temp }}/llvm-18.1
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: 1.78.0
default: true
- name: Build wheels
uses: messense/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
env:
LIBCLANG_PATH: ${{ runner.temp }}/llvm-17.0/lib
CC: ${{ runner.temp }}/llvm-17.0/bin/clang-cl
CXX: ${{ runner.temp }}/llvm-17.0/bin/clang-cl
AR: ${{ runner.temp }}/llvm-17.0/bin/llvm-lib
LIBCLANG_PATH: ${{ runner.temp }}/llvm-18.1/lib
CC: ${{ runner.temp }}/llvm-18.1/bin/clang-cl
CXX: ${{ runner.temp }}/llvm-18.1/bin/clang-cl
AR: ${{ runner.temp }}/llvm-18.1/bin/llvm-lib
CFLAGS: "/clang:-flto=thin /clang:-O3 /clang:-fuse-ld=lld-link"
CXXFLAGS: "/clang:-flto=thin /clang:-O3 /clang:-fuse-ld=lld-link"
RUSTFLAGS: "-Clinker-plugin-lto -Clinker=lld-link"
Expand All @@ -108,19 +110,19 @@ jobs:
target: [x86_64]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: x64
- name: Build Wheels
uses: messense/maturin-action@v1
with:
rust-toolchain: stable
rust-toolchain: 1.78.0
rustup-components: rustfmt
target: ${{ matrix.target }}
manylinux: 2_28
args: --release --out dist --interpreter '3.7 3.8 3.9 3.10 3.11 3.12'
container: congyuwang/manylinux_2_28_x86_64:llvm-17.0.6
container: congyuwang/manylinux_2_28_x86_64:llvm-18.1.5
env:
LIBCLANG_PATH: /usr/local/lib
CC: /usr/local/bin/clang
Expand Down Expand Up @@ -149,19 +151,19 @@ jobs:
target: [x86_64]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: x64
- name: Build Wheels
uses: messense/maturin-action@v1
with:
rust-toolchain: stable
rust-toolchain: 1.78.0
rustup-components: rustfmt
target: ${{ matrix.target }}
manylinux: 2014
args: --release --out dist --interpreter '3.7 3.8 3.9 3.10 3.11 3.12'
container: congyuwang/manylinux2014_x86_64:llvm-17.0.6
container: congyuwang/manylinux2014_x86_64:llvm-18.1.5
env:
LIBCLANG_PATH: /usr/local/lib
CC: /usr/local/bin/clang
Expand Down Expand Up @@ -189,18 +191,18 @@ jobs:
target: [aarch64]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Build Wheels
uses: messense/maturin-action@v1
with:
rust-toolchain: stable
rust-toolchain: 1.78.0
rustup-components: rustfmt
target: ${{ matrix.target }}
manylinux: 2_28
args: --release --out dist --interpreter '3.7 3.8 3.9 3.10 3.11 3.12'
container: congyuwang/manylinux_2_28_aarch64:llvm-17.0.6
container: congyuwang/manylinux_2_28_aarch64:llvm-18.1.5
docker-options: "-e BINDGEN_EXTRA_CLANG_ARGS"
before-script-linux: |
ln -s /usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/7.5.0/crtbeginS.o /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/lib/crtbeginS.o
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/rust-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
# documentation.
# rust-clippy is a tool that runs a bunch of lints to catch common
# mistakes in your Rust code and help improve your Rust code.
# More details at https://github.com/rust-lang/rust-clippy
# More details at https://github.com/rust-lang/rust-clippy
# and https://rust-lang.github.io/rust-clippy/

name: rust-clippy analyze

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
branches: ["main"]
schedule:
- cron: '38 1 * * 3'
- cron: "38 1 * * 3"

jobs:
rust-clippy-analyze:
Expand All @@ -25,7 +25,7 @@ jobs:
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -34,16 +34,15 @@ jobs:
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
with:
profile: minimal
toolchain: stable
toolchain: 1.78.0
components: clippy
override: true

- name: Install required cargo
run: cargo install clippy-sarif sarif-fmt

- name: Run rust-clippy
run:
cargo clippy
run: cargo clippy
--all-features
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true
Expand Down

0 comments on commit 49e6bf8

Please sign in to comment.