From 13507bf69ac11b709282e891531af83d3606205f Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 29 Aug 2024 15:16:29 -0500 Subject: [PATCH 1/6] ci: Use YAML arrays (backport ) (cherry picked from commit bba23956db88fc13063c24597cf02eb917a38cbd) --- .github/workflows/full_ci.yml | 109 ++++++++++++++++------------------ 1 file changed, 51 insertions(+), 58 deletions(-) diff --git a/.github/workflows/full_ci.yml b/.github/workflows/full_ci.yml index b36f4f9d2ba57..4fff4e083e091 100644 --- a/.github/workflows/full_ci.yml +++ b/.github/workflows/full_ci.yml @@ -16,10 +16,9 @@ jobs: strategy: fail-fast: true matrix: - target: [ - i686-unknown-linux-gnu, - x86_64-unknown-linux-gnu, - ] + target: + - i686-unknown-linux-gnu + - x86_64-unknown-linux-gnu steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain @@ -36,9 +35,8 @@ jobs: strategy: fail-fast: true matrix: - target: [ - x86_64-apple-darwin, - ] + target: + - x86_64-apple-darwin steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain @@ -104,32 +102,31 @@ jobs: fail-fast: true max-parallel: 12 matrix: - target: [ - aarch64-linux-android, - aarch64-unknown-linux-gnu, - aarch64-unknown-linux-musl, - arm-linux-androideabi, - arm-unknown-linux-gnueabihf, - arm-unknown-linux-musleabihf, - i686-linux-android, - i686-unknown-linux-musl, - powerpc-unknown-linux-gnu, - powerpc64-unknown-linux-gnu, - powerpc64le-unknown-linux-gnu, - s390x-unknown-linux-gnu, - riscv64gc-unknown-linux-gnu, - wasm32-wasip1, - wasm32-wasip2, - sparc64-unknown-linux-gnu, - wasm32-unknown-emscripten, - x86_64-linux-android, + target: + - aarch64-linux-android + - aarch64-unknown-linux-gnu + - aarch64-unknown-linux-musl + - arm-linux-androideabi + - arm-unknown-linux-gnueabihf + - arm-unknown-linux-musleabihf + - i686-linux-android + - i686-unknown-linux-musl + - powerpc-unknown-linux-gnu + - powerpc64-unknown-linux-gnu + - powerpc64le-unknown-linux-gnu + - s390x-unknown-linux-gnu + - riscv64gc-unknown-linux-gnu + - wasm32-wasip1 + - wasm32-wasip2 + - sparc64-unknown-linux-gnu + - wasm32-unknown-emscripten + - x86_64-linux-android # FIXME: Exec format error (os error 8) - #x86_64-unknown-linux-gnux32, - x86_64-unknown-linux-musl, + # - x86_64-unknown-linux-gnux32 + - x86_64-unknown-linux-musl # FIXME: It seems some items in `src/unix/mod.rs` # aren't defined on redox actually. - # x86_64-unknown-redox, - ] + # - x86_64-unknown-redox steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain @@ -150,18 +147,17 @@ jobs: fail-fast: true max-parallel: 5 matrix: - toolchain: [ - stable, - beta, - nightly, + toolchain: + - stable + - beta + - nightly # FIXME: Disabled due to: # error: failed to parse registry's information for: serde - #1.13.0, - 1.19.0, - 1.24.0, - 1.25.0, - 1.30.0, - ] + # 1.13.0, + - 1.19.0 + - 1.24.0 + - 1.25.0 + - 1.30.0 steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain @@ -204,13 +200,12 @@ jobs: strategy: fail-fast: true matrix: - toolchain: [ - 1.19.0, - 1.24.0, - 1.25.0, - 1.30.0, - stable, - ] + toolchain: + - 1.19.0 + - 1.24.0 + - 1.25.0 + - 1.30.0 + - stable steps: - uses: actions/checkout@v4 - name: Self-update rustup @@ -223,7 +218,6 @@ jobs: check_cfg: permissions: contents: read # to fetch code (actions/checkout) - name: "Check #[cfg]s" runs-on: ubuntu-22.04 steps: @@ -238,16 +232,15 @@ jobs: success: name: success runs-on: ubuntu-22.04 - needs: [ - docker_linux_tier1, - docker_linux_tier2, - macos, - windows, - style_check, - build_channels_linux, - build_channels_macos, - build_channels_windows, - ] + needs: + - docker_linux_tier1 + - docker_linux_tier2 + - macos + - windows + - style_check + - build_channels_linux + - build_channels_macos + - build_channels_windows # Github branch protection is exceedingly silly and treats "jobs skipped because a dependency # failed" as success. So we have to do some contortions to ensure the job fails if any of its # dependencies fails. From 164a8a4ebe3875da98ec3c8391c56dfd49afd037 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 29 Aug 2024 15:22:32 -0500 Subject: [PATCH 2/6] ci: remove unneeded `permissions.contents` keys (backport ) (cherry picked from commit 4406ec22375d53cd7777d36dee1133579d191176) --- .github/workflows/full_ci.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/full_ci.yml b/.github/workflows/full_ci.yml index 4fff4e083e091..594052ba4c435 100644 --- a/.github/workflows/full_ci.yml +++ b/.github/workflows/full_ci.yml @@ -8,9 +8,6 @@ on: jobs: docker_linux_tier1: - permissions: - contents: read # to fetch code (actions/checkout) - name: Docker Linux Tier1 runs-on: ubuntu-22.04 strategy: @@ -27,9 +24,6 @@ jobs: run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }} macos: - permissions: - contents: read # to fetch code (actions/checkout) - name: macOS runs-on: macos-13 strategy: @@ -45,9 +39,6 @@ jobs: run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }} windows: - permissions: - contents: read # to fetch code (actions/checkout) - name: Windows runs-on: windows-2022 env: @@ -79,9 +70,6 @@ jobs: shell: bash style_check: - permissions: - contents: read # to fetch code (actions/checkout) - name: Style check runs-on: ubuntu-22.04 steps: @@ -92,9 +80,6 @@ jobs: run: sh ci/style.sh docker_linux_tier2: - permissions: - contents: read # to fetch code (actions/checkout) - name: Docker Linux Tier2 needs: [docker_linux_tier1, style_check] runs-on: ubuntu-22.04 @@ -135,9 +120,6 @@ jobs: run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }} build_channels_linux: - permissions: - contents: read # to fetch code (actions/checkout) - name: Build Channels Linux needs: docker_linux_tier2 runs-on: ubuntu-22.04 @@ -166,9 +148,6 @@ jobs: run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh build_channels_macos: - permissions: - contents: read # to fetch code (actions/checkout) - name: Build Channels macOS needs: macos env: @@ -190,9 +169,6 @@ jobs: run: LIBC_CI=1 TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh build_channels_windows: - permissions: - contents: read # to fetch code (actions/checkout) - name: Build Channels Windows runs-on: windows-2022 env: @@ -216,8 +192,6 @@ jobs: shell: bash check_cfg: - permissions: - contents: read # to fetch code (actions/checkout) name: "Check #[cfg]s" runs-on: ubuntu-22.04 steps: From 04b3b07d346aa3fbf7bcd9c01c2f0594c032afbc Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 29 Aug 2024 15:30:04 -0500 Subject: [PATCH 3/6] ci: just set required env globally (backport ) (cherry picked from commit 72940168e3d68c99062d6f849bcbe694bc03aea2) --- .github/workflows/full_ci.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/full_ci.yml b/.github/workflows/full_ci.yml index 594052ba4c435..f3be6afe5b8d5 100644 --- a/.github/workflows/full_ci.yml +++ b/.github/workflows/full_ci.yml @@ -6,6 +6,9 @@ on: branches: - libc-0.2 +env: + LIBC_CI: 1 + jobs: docker_linux_tier1: name: Docker Linux Tier1 @@ -21,7 +24,7 @@ jobs: - name: Setup Rust toolchain run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh - name: Execute run-docker.sh - run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }} + run: sh ./ci/run-docker.sh ${{ matrix.target }} macos: name: macOS @@ -36,7 +39,7 @@ jobs: - name: Setup Rust toolchain run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh - name: Execute run.sh - run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }} + run: sh ./ci/run.sh ${{ matrix.target }} windows: name: Windows @@ -66,7 +69,7 @@ jobs: run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh shell: bash - name: Execute run.sh - run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }} + run: sh ./ci/run.sh ${{ matrix.target }} shell: bash style_check: @@ -117,7 +120,7 @@ jobs: - name: Setup Rust toolchain run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh - name: Execute run-docker.sh - run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }} + run: sh ./ci/run-docker.sh ${{ matrix.target }} build_channels_linux: name: Build Channels Linux @@ -145,7 +148,7 @@ jobs: - name: Setup Rust toolchain run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh - name: Execute build.sh - run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh + run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh build_channels_macos: name: Build Channels macOS @@ -166,7 +169,7 @@ jobs: - name: Setup Rust toolchain run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh - name: Execute build.sh - run: LIBC_CI=1 TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh + run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh build_channels_windows: name: Build Channels Windows @@ -188,7 +191,7 @@ jobs: run: rustup self update shell: bash - name: Execute build.sh - run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh + run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh shell: bash check_cfg: @@ -199,7 +202,7 @@ jobs: - name: Setup Rust toolchain run: TOOLCHAIN=nightly sh ./ci/install-rust.sh - name: Build with check-cfg - run: LIBC_CI=1 LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg + run: LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg # One job that "summarizes" the success state of this pipeline. This can then be added to branch # protection, rather than having to add each job separately. From 033291155c675f525603172d78b7b89def8a6b92 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Wed, 6 Nov 2024 19:45:53 -0600 Subject: [PATCH 4/6] ci: reorder jobs, don't make native linux depend on tier 2 tests (backport ) (cherry picked from commit 2e4e0ed81f5525abba7c6cf99968df3a2e61db2b) --- .github/workflows/full_ci.yml | 167 +++++++++++++++++----------------- 1 file changed, 83 insertions(+), 84 deletions(-) diff --git a/.github/workflows/full_ci.yml b/.github/workflows/full_ci.yml index f3be6afe5b8d5..f2a3b07ca152c 100644 --- a/.github/workflows/full_ci.yml +++ b/.github/workflows/full_ci.yml @@ -10,21 +10,86 @@ env: LIBC_CI: 1 jobs: - docker_linux_tier1: - name: Docker Linux Tier1 + style_check: + name: Style check runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Setup Rust toolchain + run: sh ./ci/install-rust.sh + - name: Check style + run: sh ci/style.sh + + build_channels_linux: + name: Build Channels Linux + runs-on: ubuntu-22.04 + env: + OS: linux strategy: fail-fast: true + max-parallel: 5 + matrix: + toolchain: + - stable + - beta + - nightly + # FIXME: Disabled due to: + # error: failed to parse registry's information for: serde + # 1.13.0, + - 1.19.0 + - 1.24.0 + - 1.25.0 + - 1.30.0 + steps: + - uses: actions/checkout@v4 + - name: Setup Rust toolchain + run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh + - name: Execute build.sh + run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh + + build_channels_macos: + name: Build Channels macOS + needs: macos + env: + OS: macos + strategy: + fail-fast: true + max-parallel: 4 matrix: target: - - i686-unknown-linux-gnu - - x86_64-unknown-linux-gnu + - { toolchain: stable, os: macos-13 } + - { toolchain: beta, os: macos-13 } + - { toolchain: nightly, os: macos-13 } + runs-on: ${{ matrix.target.os }} steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh - - name: Execute run-docker.sh - run: sh ./ci/run-docker.sh ${{ matrix.target }} + run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh + - name: Execute build.sh + run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh + + build_channels_windows: + name: Build Channels Windows + runs-on: windows-2022 + env: + OS: windows + strategy: + fail-fast: true + matrix: + toolchain: + - 1.19.0 + - 1.24.0 + - 1.25.0 + - 1.30.0 + - stable + steps: + - uses: actions/checkout@v4 + - name: Self-update rustup + run: rustup self update + shell: bash + - name: Execute build.sh + run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh + shell: bash macos: name: macOS @@ -72,15 +137,21 @@ jobs: run: sh ./ci/run.sh ${{ matrix.target }} shell: bash - style_check: - name: Style check + docker_linux_tier1: + name: Docker Linux Tier1 runs-on: ubuntu-22.04 + strategy: + fail-fast: true + matrix: + target: + - i686-unknown-linux-gnu + - x86_64-unknown-linux-gnu steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain - run: sh ./ci/install-rust.sh - - name: Check style - run: sh ci/style.sh + run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh + - name: Execute run-docker.sh + run: sh ./ci/run-docker.sh ${{ matrix.target }} docker_linux_tier2: name: Docker Linux Tier2 @@ -122,78 +193,6 @@ jobs: - name: Execute run-docker.sh run: sh ./ci/run-docker.sh ${{ matrix.target }} - build_channels_linux: - name: Build Channels Linux - needs: docker_linux_tier2 - runs-on: ubuntu-22.04 - env: - OS: linux - strategy: - fail-fast: true - max-parallel: 5 - matrix: - toolchain: - - stable - - beta - - nightly - # FIXME: Disabled due to: - # error: failed to parse registry's information for: serde - # 1.13.0, - - 1.19.0 - - 1.24.0 - - 1.25.0 - - 1.30.0 - steps: - - uses: actions/checkout@v4 - - name: Setup Rust toolchain - run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh - - name: Execute build.sh - run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh - - build_channels_macos: - name: Build Channels macOS - needs: macos - env: - OS: macos - strategy: - fail-fast: true - max-parallel: 4 - matrix: - target: - - { toolchain: stable, os: macos-13 } - - { toolchain: beta, os: macos-13 } - - { toolchain: nightly, os: macos-13 } - runs-on: ${{ matrix.target.os }} - steps: - - uses: actions/checkout@v4 - - name: Setup Rust toolchain - run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh - - name: Execute build.sh - run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh - - build_channels_windows: - name: Build Channels Windows - runs-on: windows-2022 - env: - OS: windows - strategy: - fail-fast: true - matrix: - toolchain: - - 1.19.0 - - 1.24.0 - - 1.25.0 - - 1.30.0 - - stable - steps: - - uses: actions/checkout@v4 - - name: Self-update rustup - run: rustup self update - shell: bash - - name: Execute build.sh - run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh - shell: bash - check_cfg: name: "Check #[cfg]s" runs-on: ubuntu-22.04 From ca620bc5c04fbd511e342917f9ac0fb0d24bc0c7 Mon Sep 17 00:00:00 2001 From: WANG Rui Date: Tue, 29 Oct 2024 21:35:55 +0800 Subject: [PATCH 5/6] ci: add support for loongarch64-unknown-linux-gnu (backport ) (cherry picked from commit 705bb126beac872f2899487ec93886fea3fe3598) --- .github/workflows/full_ci.yml | 1 + ci/docker/loongarch64-unknown-linux-gnu/Dockerfile | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 ci/docker/loongarch64-unknown-linux-gnu/Dockerfile diff --git a/.github/workflows/full_ci.yml b/.github/workflows/full_ci.yml index f2a3b07ca152c..5e594a9a88079 100644 --- a/.github/workflows/full_ci.yml +++ b/.github/workflows/full_ci.yml @@ -170,6 +170,7 @@ jobs: - arm-unknown-linux-musleabihf - i686-linux-android - i686-unknown-linux-musl + - loongarch64-unknown-linux-gnu - powerpc-unknown-linux-gnu - powerpc64-unknown-linux-gnu - powerpc64le-unknown-linux-gnu diff --git a/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile b/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile new file mode 100644 index 0000000000000..aebf7c0741956 --- /dev/null +++ b/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile @@ -0,0 +1,12 @@ +FROM ubuntu:24.04 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc libc6-dev qemu-user ca-certificates \ + gcc-14-loongarch64-linux-gnu libc6-dev-loong64-cross \ + linux-headers-generic + +ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER=loongarch64-linux-gnu-gcc-14 \ + CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-loongarch64 -L /usr/loongarch64-linux-gnu" \ + CC_loongarch64_unknown_linux_gnu=loongarch64-linux-gnu-gcc-14 \ + CFLAGS_loongarch64_unknown_linux_gnu="-mabi=lp64d -fPIC" \ + PATH=$PATH:/rust/bin From 82854692efd86787e4068eaef420680bdb0da3aa Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Wed, 6 Nov 2024 20:13:34 -0600 Subject: [PATCH 6/6] Remove the `wasm32-wasi` target Since [1], the `wasm32-wasi` target is no longer supported (replaced by `wasm32-wasip1` and `wasm32-wasip2`). This has made it into the latest nightly, so remove it from our testing. [1]: https://github.com/rust-lang/rust/pull/132562 (backport ) (cherry picked from commit a4d3ca87aa0cbe52b728ab88d59d2cee9b1aa21e) --- Cargo.toml | 1 - ci/build.sh | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 04183f0c2623a..b0eacb4cdaa94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -107,7 +107,6 @@ targets = [ "thumbv7neon-unknown-linux-gnueabihf", "wasm32-unknown-emscripten", "wasm32-unknown-unknown", - "wasm32-wasi", "x86_64-apple-darwin", "x86_64-apple-ios", "x86_64-fortanix-unknown-sgx", diff --git a/ci/build.sh b/ci/build.sh index d4b85ccbf0bd9..28655238e9f65 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -136,7 +136,6 @@ armv5te-unknown-linux-gnueabi \ armv5te-unknown-linux-musleabi \ i686-pc-windows-gnu \ riscv64gc-unknown-linux-gnu \ -wasm32-wasi \ x86_64-fortanix-unknown-sgx \ x86_64-unknown-fuchsia \ x86_64-pc-solaris \