From 125c6503922399a9a0f94cea887cc0074977f6de Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 13 Sep 2023 01:09:20 +0900 Subject: [PATCH] wip --- .cirrus.yml | 44 +- .github/workflows/ci.yml | 1018 +++++++++++++++++++------------------- tools/build.sh | 150 +++--- 3 files changed, 606 insertions(+), 606 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 0ca9ffe45..075297c96 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -107,28 +107,28 @@ aarch64_macos_test_task: # Cirrus CI's aarch64 macOS VM is fast enough, so run ignored tests too. - ./tools/test.sh -vv -- --include-ignored -aarch64_linux_valgrind_task: - name: valgrind ($TARGET) - env: - TARGET: aarch64-unknown-linux-gnu - arm_container: - # Valgrind support ldxp/stxp on 3.19+: https://valgrind.org/docs/manual/dist.news.html - # However, current Debian stable's Valgrind is 3.16: https://packages.debian.org/en/stable/valgrind - image: rust:bookworm - setup_script: - - set -ex - - rustup toolchain add nightly --no-self-update && rustup default nightly - - apt-get -o Acquire::Retries=10 -qq update && apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils valgrind - test_script: - - set -ex - - ./tools/test.sh valgrind -vv - # We test doctest only once with the default build conditions because doctest is slow. Both api-test - # and src/tests have extended copies of doctest, so this will not reduce test coverage. - # outline-atomics is enabled by default on linux-gnu and linux-musl with dynamic linking. - - RUSTFLAGS="$RUSTFLAGS --cfg portable_atomic_no_outline_atomics" RUSTDOCFLAGS="$RUSTDOCFLAGS --cfg portable_atomic_no_outline_atomics" ./tools/test.sh valgrind -vv --tests - # +lse - # As of Valgrind 3.19, Valgrind supports atomic instructions of ARMv8.0 and ARMv8.1 (FEAT_LSE). - - RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" ./tools/test.sh valgrind -vv --tests +# aarch64_linux_valgrind_task: +# name: valgrind ($TARGET) +# env: +# TARGET: aarch64-unknown-linux-gnu +# arm_container: +# # Valgrind support ldxp/stxp on 3.19+: https://valgrind.org/docs/manual/dist.news.html +# # However, current Debian stable's Valgrind is 3.16: https://packages.debian.org/en/stable/valgrind +# image: rust:bookworm +# setup_script: +# - set -ex +# - rustup toolchain add nightly --no-self-update && rustup default nightly +# - apt-get -o Acquire::Retries=10 -qq update && apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils valgrind +# test_script: +# - set -ex +# - ./tools/test.sh valgrind -vv +# # We test doctest only once with the default build conditions because doctest is slow. Both api-test +# # and src/tests have extended copies of doctest, so this will not reduce test coverage. +# # outline-atomics is enabled by default on linux-gnu and linux-musl with dynamic linking. +# - RUSTFLAGS="$RUSTFLAGS --cfg portable_atomic_no_outline_atomics" RUSTDOCFLAGS="$RUSTDOCFLAGS --cfg portable_atomic_no_outline_atomics" ./tools/test.sh valgrind -vv --tests +# # +lse +# # As of Valgrind 3.19, Valgrind supports atomic instructions of ARMv8.0 and ARMv8.1 (FEAT_LSE). +# - RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" ./tools/test.sh valgrind -vv --tests # # aarch64_linux_bench_task: # name: bench ($TARGET) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c664a90d..c5c5e06cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,354 +37,354 @@ concurrency: cancel-in-progress: true jobs: - check-external-types: - uses: taiki-e/workflows/.github/workflows/check-external-types.yml@main - deny: - uses: taiki-e/workflows/.github/workflows/deny.yml@main - docs: - uses: taiki-e/workflows/.github/workflows/docs.yml@main - with: - target: x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu,powerpc64le-unknown-linux-gnu,s390x-unknown-linux-gnu,armv5te-unknown-linux-gnueabi - msrv: - needs: tidy - uses: taiki-e/workflows/.github/workflows/msrv.yml@main - with: - event_name: ${{ github.event_name }} - # NB: sync with env.TEST_FEATURES - # Exclude serde and critical-section features because the MSRV when it is enabled depends on the MSRV of them - args: --features float,std --ignore-unknown-features - tidy: - uses: taiki-e/workflows/.github/workflows/tidy.yml@main - with: - # clippy is covered by TESTS=1 ./tools/build.sh - clippy: false + # check-external-types: + # uses: taiki-e/workflows/.github/workflows/check-external-types.yml@main + # deny: + # uses: taiki-e/workflows/.github/workflows/deny.yml@main + # docs: + # uses: taiki-e/workflows/.github/workflows/docs.yml@main + # with: + # target: x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu,powerpc64le-unknown-linux-gnu,s390x-unknown-linux-gnu,armv5te-unknown-linux-gnueabi + # msrv: + # needs: tidy + # uses: taiki-e/workflows/.github/workflows/msrv.yml@main + # with: + # event_name: ${{ github.event_name }} + # # NB: sync with env.TEST_FEATURES + # # Exclude serde and critical-section features because the MSRV when it is enabled depends on the MSRV of them + # args: --features float,std --ignore-unknown-features + # tidy: + # uses: taiki-e/workflows/.github/workflows/tidy.yml@main + # with: + # # clippy is covered by TESTS=1 ./tools/build.sh + # clippy: false - test: - needs: tidy - strategy: - fail-fast: false - matrix: - include: - - rust: '1.56' - - rust: '1.59' # LLVM 13 - - rust: '1.64' # LLVM 14 - - rust: '1.69' # LLVM 15 - - rust: stable # LLVM 16 (as of 1.70) - - rust: beta - - rust: nightly - - rust: nightly - os: macos-latest - - rust: nightly - os: windows-latest - - rust: nightly-x86_64-pc-windows-gnu - os: windows-latest - - rust: nightly-i686-pc-windows-msvc - os: windows-latest - - rust: nightly-i686-pc-windows-gnu - os: windows-latest - - rust: nightly - flags: -C panic=abort -Z panic_abort_tests - - rust: '1.59' # LLVM 13 - target: aarch64-unknown-linux-gnu - - rust: '1.64' # LLVM 14 - target: aarch64-unknown-linux-gnu - - rust: '1.69' # LLVM 15 - target: aarch64-unknown-linux-gnu - - rust: stable - target: aarch64-unknown-linux-gnu - - rust: beta - target: aarch64-unknown-linux-gnu - - rust: nightly - target: aarch64-unknown-linux-gnu - - rust: nightly - target: aarch64_be-unknown-linux-gnu - - rust: stable - target: aarch64-unknown-linux-musl - - rust: stable - target: aarch64-unknown-linux-musl - flags: -C target-feature=-crt-static - - rust: nightly - target: aarch64-unknown-linux-musl - - rust: nightly - target: aarch64-unknown-linux-musl - flags: -C target-feature=-crt-static - - rust: stable - target: aarch64-linux-android - - rust: nightly - target: aarch64-linux-android - - rust: nightly - target: aarch64-pc-windows-gnullvm - - rust: '1.59' - target: armv5te-unknown-linux-gnueabi - - rust: stable - target: armv5te-unknown-linux-gnueabi - - rust: nightly - target: armv5te-unknown-linux-gnueabi - - rust: nightly - target: arm-unknown-linux-gnueabi - - rust: nightly - target: armv7-unknown-linux-gnueabi - - rust: nightly - target: armv7-unknown-linux-gnueabihf - - rust: nightly - target: armeb-unknown-linux-gnueabi - - rust: nightly - target: arm-linux-androideabi - - rust: nightly - target: i586-unknown-linux-gnu - - rust: nightly - target: i686-unknown-linux-gnu - - rust: nightly - target: loongarch64-unknown-linux-gnu - - rust: nightly - target: mips-unknown-linux-gnu - - rust: nightly - target: mipsel-unknown-linux-gnu - - rust: nightly - target: mips64-unknown-linux-gnuabi64 - - rust: nightly - target: mips64el-unknown-linux-gnuabi64 - - rust: nightly-2023-07-18 # TODO: https://github.com/rust-lang/rust/pull/112374 broke build-std due to https://github.com/rust-lang/libc/pull/3268 is not released yet - target: mipsisa32r6-unknown-linux-gnu - - rust: nightly-2023-07-18 # TODO: https://github.com/rust-lang/rust/pull/112374 broke build-std due to https://github.com/rust-lang/libc/pull/3268 is not released yet - target: mipsisa32r6el-unknown-linux-gnu - - rust: nightly-2023-07-18 # TODO: https://github.com/rust-lang/rust/pull/112374 broke build-std due to https://github.com/rust-lang/libc/pull/3268 is not released yet - target: mipsisa64r6-unknown-linux-gnuabi64 - - rust: nightly-2023-07-18 # TODO: https://github.com/rust-lang/rust/pull/112374 broke build-std due to https://github.com/rust-lang/libc/pull/3268 is not released yet - target: mipsisa64r6el-unknown-linux-gnuabi64 - - rust: nightly - target: powerpc-unknown-linux-gnu - - rust: nightly - target: powerpc64-unknown-linux-gnu - # - rust: nightly-2023-03-26 # Rust 1.70, LLVM 16 - # target: powerpc64-unknown-linux-gnu - - rust: nightly-2023-03-25 # Rust 1.70, LLVM 15 - target: powerpc64-unknown-linux-gnu - # - rust: nightly-2022-08-13 # Rust 1.65, LLVM 15 - # target: powerpc64-unknown-linux-gnu - - rust: nightly-2022-08-12 # Rust 1.65, LLVM 14 - target: powerpc64-unknown-linux-gnu - # - rust: nightly-2022-02-18 # Rust 1.60, LLVM 14 - # target: powerpc64-unknown-linux-gnu - # - rust: nightly-2022-02-17 # Rust 1.60, LLVM 13 - # target: powerpc64-unknown-linux-gnu - - rust: nightly-2022-02-13 # Rust 1.60, LLVM 13 (oldest version we can use asm_experimental_arch on this target) - target: powerpc64-unknown-linux-gnu - - rust: nightly - target: powerpc64le-unknown-linux-gnu - # - rust: nightly-2023-03-26 # Rust 1.70, LLVM 16 - # target: powerpc64le-unknown-linux-gnu - - rust: nightly-2023-03-25 # Rust 1.70, LLVM 15 - target: powerpc64le-unknown-linux-gnu - # - rust: nightly-2022-08-13 # Rust 1.65, LLVM 15 - # target: powerpc64le-unknown-linux-gnu - - rust: nightly-2022-08-12 # Rust 1.65, LLVM 14 - target: powerpc64le-unknown-linux-gnu - # - rust: nightly-2022-02-18 # Rust 1.60, LLVM 14 - # target: powerpc64le-unknown-linux-gnu - # - rust: nightly-2022-02-17 # Rust 1.60, LLVM 13 - # target: powerpc64le-unknown-linux-gnu - - rust: nightly-2022-02-13 # Rust 1.60, LLVM 13 (oldest version we can use asm_experimental_arch on this target) - target: powerpc64le-unknown-linux-gnu - - rust: nightly - target: riscv32gc-unknown-linux-gnu - - rust: nightly - target: riscv64gc-unknown-linux-gnu - - rust: nightly - target: s390x-unknown-linux-gnu - - rust: nightly-2023-05-09 # Rust 1.71, LLVM 16 (oldest version we can use asm_experimental_arch on this target) - target: s390x-unknown-linux-gnu - - rust: nightly - target: sparc64-unknown-linux-gnu - - rust: nightly - target: thumbv7neon-unknown-linux-gnueabihf - runs-on: ${{ matrix.os || 'ubuntu-latest' }} - timeout-minutes: 60 - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - run: | - lscpu - sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils - if: startsWith(matrix.os, 'ubuntu') || matrix.os == '' - - run: | - sysctl hw.optional machdep.cpu - brew install moreutils - if: startsWith(matrix.os, 'macos') - - run: | - C:/msys64/usr/bin/pacman -S --noconfirm moreutils - if: startsWith(matrix.os, 'windows') - - name: Install Rust - run: rustup toolchain add ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} - - run: rustup toolchain add nightly --no-self-update - - uses: taiki-e/install-action@cargo-hack - - uses: taiki-e/install-action@cargo-minimal-versions - - uses: taiki-e/install-action@cargo-careful - if: startsWith(matrix.rust, 'nightly') - - uses: taiki-e/setup-cross-toolchain-action@v1 - with: - target: ${{ matrix.target }} - if: matrix.target != '' - - run: echo "RUSTFLAGS=${RUSTFLAGS} --cfg qemu" >>"${GITHUB_ENV}" - if: matrix.target != '' && !startsWith(matrix.target, 'i686') && !startsWith(matrix.target, 'x86_64') - - run: | - echo "RUSTFLAGS=${RUSTFLAGS} ${{ matrix.flags }}" >>"${GITHUB_ENV}" - echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} ${{ matrix.flags }}" >>"${GITHUB_ENV}" - if: matrix.flags != '' - - run: echo "TARGET=--target=${{ matrix.target }}" >>"${GITHUB_ENV}" - if: matrix.target != '' - # TODO: LLVM bug: Undefined temporary symbol error when building std. - - run: echo "RELEASE=--release" >>"${GITHUB_ENV}" - if: matrix.target == 'mips-unknown-linux-gnu' || matrix.target == 'mipsel-unknown-linux-gnu' + # test: + # needs: tidy + # strategy: + # fail-fast: false + # matrix: + # include: + # - rust: '1.56' + # - rust: '1.59' # LLVM 13 + # - rust: '1.64' # LLVM 14 + # - rust: '1.69' # LLVM 15 + # - rust: stable # LLVM 16 (as of 1.70) + # - rust: beta + # - rust: nightly + # - rust: nightly + # os: macos-latest + # - rust: nightly + # os: windows-latest + # - rust: nightly-x86_64-pc-windows-gnu + # os: windows-latest + # - rust: nightly-i686-pc-windows-msvc + # os: windows-latest + # - rust: nightly-i686-pc-windows-gnu + # os: windows-latest + # - rust: nightly + # flags: -C panic=abort -Z panic_abort_tests + # - rust: '1.59' # LLVM 13 + # target: aarch64-unknown-linux-gnu + # - rust: '1.64' # LLVM 14 + # target: aarch64-unknown-linux-gnu + # - rust: '1.69' # LLVM 15 + # target: aarch64-unknown-linux-gnu + # - rust: stable + # target: aarch64-unknown-linux-gnu + # - rust: beta + # target: aarch64-unknown-linux-gnu + # - rust: nightly + # target: aarch64-unknown-linux-gnu + # - rust: nightly + # target: aarch64_be-unknown-linux-gnu + # - rust: stable + # target: aarch64-unknown-linux-musl + # - rust: stable + # target: aarch64-unknown-linux-musl + # flags: -C target-feature=-crt-static + # - rust: nightly + # target: aarch64-unknown-linux-musl + # - rust: nightly + # target: aarch64-unknown-linux-musl + # flags: -C target-feature=-crt-static + # - rust: stable + # target: aarch64-linux-android + # - rust: nightly + # target: aarch64-linux-android + # - rust: nightly + # target: aarch64-pc-windows-gnullvm + # - rust: '1.59' + # target: armv5te-unknown-linux-gnueabi + # - rust: stable + # target: armv5te-unknown-linux-gnueabi + # - rust: nightly + # target: armv5te-unknown-linux-gnueabi + # - rust: nightly + # target: arm-unknown-linux-gnueabi + # - rust: nightly + # target: armv7-unknown-linux-gnueabi + # - rust: nightly + # target: armv7-unknown-linux-gnueabihf + # - rust: nightly + # target: armeb-unknown-linux-gnueabi + # - rust: nightly + # target: arm-linux-androideabi + # - rust: nightly + # target: i586-unknown-linux-gnu + # - rust: nightly + # target: i686-unknown-linux-gnu + # - rust: nightly + # target: loongarch64-unknown-linux-gnu + # - rust: nightly + # target: mips-unknown-linux-gnu + # - rust: nightly + # target: mipsel-unknown-linux-gnu + # - rust: nightly + # target: mips64-unknown-linux-gnuabi64 + # - rust: nightly + # target: mips64el-unknown-linux-gnuabi64 + # - rust: nightly-2023-07-18 # TODO: https://github.com/rust-lang/rust/pull/112374 broke build-std due to https://github.com/rust-lang/libc/pull/3268 is not released yet + # target: mipsisa32r6-unknown-linux-gnu + # - rust: nightly-2023-07-18 # TODO: https://github.com/rust-lang/rust/pull/112374 broke build-std due to https://github.com/rust-lang/libc/pull/3268 is not released yet + # target: mipsisa32r6el-unknown-linux-gnu + # - rust: nightly-2023-07-18 # TODO: https://github.com/rust-lang/rust/pull/112374 broke build-std due to https://github.com/rust-lang/libc/pull/3268 is not released yet + # target: mipsisa64r6-unknown-linux-gnuabi64 + # - rust: nightly-2023-07-18 # TODO: https://github.com/rust-lang/rust/pull/112374 broke build-std due to https://github.com/rust-lang/libc/pull/3268 is not released yet + # target: mipsisa64r6el-unknown-linux-gnuabi64 + # - rust: nightly + # target: powerpc-unknown-linux-gnu + # - rust: nightly + # target: powerpc64-unknown-linux-gnu + # # - rust: nightly-2023-03-26 # Rust 1.70, LLVM 16 + # # target: powerpc64-unknown-linux-gnu + # - rust: nightly-2023-03-25 # Rust 1.70, LLVM 15 + # target: powerpc64-unknown-linux-gnu + # # - rust: nightly-2022-08-13 # Rust 1.65, LLVM 15 + # # target: powerpc64-unknown-linux-gnu + # - rust: nightly-2022-08-12 # Rust 1.65, LLVM 14 + # target: powerpc64-unknown-linux-gnu + # # - rust: nightly-2022-02-18 # Rust 1.60, LLVM 14 + # # target: powerpc64-unknown-linux-gnu + # # - rust: nightly-2022-02-17 # Rust 1.60, LLVM 13 + # # target: powerpc64-unknown-linux-gnu + # - rust: nightly-2022-02-13 # Rust 1.60, LLVM 13 (oldest version we can use asm_experimental_arch on this target) + # target: powerpc64-unknown-linux-gnu + # - rust: nightly + # target: powerpc64le-unknown-linux-gnu + # # - rust: nightly-2023-03-26 # Rust 1.70, LLVM 16 + # # target: powerpc64le-unknown-linux-gnu + # - rust: nightly-2023-03-25 # Rust 1.70, LLVM 15 + # target: powerpc64le-unknown-linux-gnu + # # - rust: nightly-2022-08-13 # Rust 1.65, LLVM 15 + # # target: powerpc64le-unknown-linux-gnu + # - rust: nightly-2022-08-12 # Rust 1.65, LLVM 14 + # target: powerpc64le-unknown-linux-gnu + # # - rust: nightly-2022-02-18 # Rust 1.60, LLVM 14 + # # target: powerpc64le-unknown-linux-gnu + # # - rust: nightly-2022-02-17 # Rust 1.60, LLVM 13 + # # target: powerpc64le-unknown-linux-gnu + # - rust: nightly-2022-02-13 # Rust 1.60, LLVM 13 (oldest version we can use asm_experimental_arch on this target) + # target: powerpc64le-unknown-linux-gnu + # - rust: nightly + # target: riscv32gc-unknown-linux-gnu + # - rust: nightly + # target: riscv64gc-unknown-linux-gnu + # - rust: nightly + # target: s390x-unknown-linux-gnu + # - rust: nightly-2023-05-09 # Rust 1.71, LLVM 16 (oldest version we can use asm_experimental_arch on this target) + # target: s390x-unknown-linux-gnu + # - rust: nightly + # target: sparc64-unknown-linux-gnu + # - rust: nightly + # target: thumbv7neon-unknown-linux-gnueabihf + # runs-on: ${{ matrix.os || 'ubuntu-latest' }} + # timeout-minutes: 60 + # steps: + # - uses: actions/checkout@v4 + # with: + # persist-credentials: false + # - run: | + # lscpu + # sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils + # if: startsWith(matrix.os, 'ubuntu') || matrix.os == '' + # - run: | + # sysctl hw.optional machdep.cpu + # brew install moreutils + # if: startsWith(matrix.os, 'macos') + # - run: | + # C:/msys64/usr/bin/pacman -S --noconfirm moreutils + # if: startsWith(matrix.os, 'windows') + # - name: Install Rust + # run: rustup toolchain add ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} + # - run: rustup toolchain add nightly --no-self-update + # - uses: taiki-e/install-action@cargo-hack + # - uses: taiki-e/install-action@cargo-minimal-versions + # - uses: taiki-e/install-action@cargo-careful + # if: startsWith(matrix.rust, 'nightly') + # - uses: taiki-e/setup-cross-toolchain-action@v1 + # with: + # target: ${{ matrix.target }} + # if: matrix.target != '' + # - run: echo "RUSTFLAGS=${RUSTFLAGS} --cfg qemu" >>"${GITHUB_ENV}" + # if: matrix.target != '' && !startsWith(matrix.target, 'i686') && !startsWith(matrix.target, 'x86_64') + # - run: | + # echo "RUSTFLAGS=${RUSTFLAGS} ${{ matrix.flags }}" >>"${GITHUB_ENV}" + # echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} ${{ matrix.flags }}" >>"${GITHUB_ENV}" + # if: matrix.flags != '' + # - run: echo "TARGET=--target=${{ matrix.target }}" >>"${GITHUB_ENV}" + # if: matrix.target != '' + # # TODO: LLVM bug: Undefined temporary symbol error when building std. + # - run: echo "RELEASE=--release" >>"${GITHUB_ENV}" + # if: matrix.target == 'mips-unknown-linux-gnu' || matrix.target == 'mipsel-unknown-linux-gnu' - - run: tools/test.sh -vv $TARGET $DOCTEST_XCOMPILE $BUILD_STD $RELEASE - # We test doctest only once with the default build conditions because doctest is slow. Both api-test - # and src/tests have extended copies of doctest, so this will not reduce test coverage. - - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE - env: - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg portable_atomic_no_outline_atomics - RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg portable_atomic_no_outline_atomics - # outline-atomics is disabled by default on aarch64 musl with static linking - if: (matrix.target == '' && !contains(matrix.rust, 'i686') || startsWith(matrix.target, 'x86_64')) || startsWith(matrix.target, 'aarch64') && !(contains(matrix.target, '-musl') && matrix.flags == '') || startsWith(matrix.target, 'armv5te') || matrix.target == 'arm-linux-androideabi' - - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE - env: - # Note: detect_false cfg is intended to make it easy for portable-atomic developers to - # test cases such as has_cmpxchg16b == false, has_lse == false, - # __kuser_helper_version < 5, etc., and is not a public API. - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg portable_atomic_test_outline_atomics_detect_false - RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg portable_atomic_test_outline_atomics_detect_false - # outline-atomics is disabled by default on aarch64 musl with static linking - if: (matrix.target == '' && !contains(matrix.rust, 'i686') || startsWith(matrix.target, 'x86_64')) || startsWith(matrix.target, 'aarch64') && !(contains(matrix.target, '-musl') && matrix.flags == '') || startsWith(matrix.target, 'armv5te') || matrix.target == 'arm-linux-androideabi' - # outline-atomics is disabled by default on aarch64 musl with static linking and powerpc64 - # powerpc64le- (little-endian) is skipped because it is pwr8 by default - - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE - env: - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg portable_atomic_outline_atomics - RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg portable_atomic_outline_atomics - if: startsWith(matrix.target, 'aarch64') && contains(matrix.target, '-musl') && matrix.flags == '' || startsWith(matrix.target, 'powerpc64-') - - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE - env: - # Note: detect_false cfg is intended to make it easy for portable-atomic developers to - # test cases such as has_cmpxchg16b == false, has_lse == false, - # __kuser_helper_version < 5, etc., and is not a public API. - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg portable_atomic_outline_atomics --cfg portable_atomic_test_outline_atomics_detect_false - RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg portable_atomic_outline_atomics --cfg portable_atomic_test_outline_atomics_detect_false - if: startsWith(matrix.target, 'aarch64') && contains(matrix.target, '-musl') && matrix.flags == '' || startsWith(matrix.target, 'powerpc64-') - # x86_64 +cmpxchg16b - - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE - env: - # cmpxchg16b + outline-atomics (vmovdqa load/store) path is tested in first 2 runs on macOS. - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics - RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics - if: matrix.target == '' && !contains(matrix.rust, 'i686') || startsWith(matrix.target, 'x86_64') - # aarch64 +lse - - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE - env: - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+lse - RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+lse - if: startsWith(matrix.target, 'aarch64') - # aarch64 +lse,+lse2 - - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE - env: - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+lse,+lse2 - RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+lse,+lse2 - if: startsWith(matrix.target, 'aarch64') - # powerpc64 pwr7 - # powerpc64- (big-endian) is skipped because it is pre-pwr8 by default - - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE - env: - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=pwr7 - RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=pwr7 - if: startsWith(matrix.target, 'powerpc64le-') - # powerpc64 pwr8 - # powerpc64le- (little-endian) is skipped because it is pwr8 by default - - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE - env: - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=pwr8 - RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=pwr8 - if: startsWith(matrix.target, 'powerpc64-') - # s390x z196 (arch9) - - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE - env: - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=z196 - RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=z196 - if: startsWith(matrix.target, 's390x') - # s390x z15 (arch13) - - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE - env: - # TODO: disable high-word LLVM target-feature to avoid LLVM codegen bug. - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=z15 -C target-feature=-high-word - RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=z15 -C target-feature=-high-word - if: startsWith(matrix.target, 's390x') + # - run: tools/test.sh -vv $TARGET $DOCTEST_XCOMPILE $BUILD_STD $RELEASE + # # We test doctest only once with the default build conditions because doctest is slow. Both api-test + # # and src/tests have extended copies of doctest, so this will not reduce test coverage. + # - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE + # env: + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg portable_atomic_no_outline_atomics + # RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg portable_atomic_no_outline_atomics + # # outline-atomics is disabled by default on aarch64 musl with static linking + # if: (matrix.target == '' && !contains(matrix.rust, 'i686') || startsWith(matrix.target, 'x86_64')) || startsWith(matrix.target, 'aarch64') && !(contains(matrix.target, '-musl') && matrix.flags == '') || startsWith(matrix.target, 'armv5te') || matrix.target == 'arm-linux-androideabi' + # - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE + # env: + # # Note: detect_false cfg is intended to make it easy for portable-atomic developers to + # # test cases such as has_cmpxchg16b == false, has_lse == false, + # # __kuser_helper_version < 5, etc., and is not a public API. + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg portable_atomic_test_outline_atomics_detect_false + # RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg portable_atomic_test_outline_atomics_detect_false + # # outline-atomics is disabled by default on aarch64 musl with static linking + # if: (matrix.target == '' && !contains(matrix.rust, 'i686') || startsWith(matrix.target, 'x86_64')) || startsWith(matrix.target, 'aarch64') && !(contains(matrix.target, '-musl') && matrix.flags == '') || startsWith(matrix.target, 'armv5te') || matrix.target == 'arm-linux-androideabi' + # # outline-atomics is disabled by default on aarch64 musl with static linking and powerpc64 + # # powerpc64le- (little-endian) is skipped because it is pwr8 by default + # - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE + # env: + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg portable_atomic_outline_atomics + # RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg portable_atomic_outline_atomics + # if: startsWith(matrix.target, 'aarch64') && contains(matrix.target, '-musl') && matrix.flags == '' || startsWith(matrix.target, 'powerpc64-') + # - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE + # env: + # # Note: detect_false cfg is intended to make it easy for portable-atomic developers to + # # test cases such as has_cmpxchg16b == false, has_lse == false, + # # __kuser_helper_version < 5, etc., and is not a public API. + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg portable_atomic_outline_atomics --cfg portable_atomic_test_outline_atomics_detect_false + # RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg portable_atomic_outline_atomics --cfg portable_atomic_test_outline_atomics_detect_false + # if: startsWith(matrix.target, 'aarch64') && contains(matrix.target, '-musl') && matrix.flags == '' || startsWith(matrix.target, 'powerpc64-') + # # x86_64 +cmpxchg16b + # - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE + # env: + # # cmpxchg16b + outline-atomics (vmovdqa load/store) path is tested in first 2 runs on macOS. + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics + # RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics + # if: matrix.target == '' && !contains(matrix.rust, 'i686') || startsWith(matrix.target, 'x86_64') + # # aarch64 +lse + # - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE + # env: + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+lse + # RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+lse + # if: startsWith(matrix.target, 'aarch64') + # # aarch64 +lse,+lse2 + # - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE + # env: + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+lse,+lse2 + # RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+lse,+lse2 + # if: startsWith(matrix.target, 'aarch64') + # # powerpc64 pwr7 + # # powerpc64- (big-endian) is skipped because it is pre-pwr8 by default + # - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE + # env: + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=pwr7 + # RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=pwr7 + # if: startsWith(matrix.target, 'powerpc64le-') + # # powerpc64 pwr8 + # # powerpc64le- (little-endian) is skipped because it is pwr8 by default + # - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE + # env: + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=pwr8 + # RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=pwr8 + # if: startsWith(matrix.target, 'powerpc64-') + # # s390x z196 (arch9) + # - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE + # env: + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=z196 + # RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=z196 + # if: startsWith(matrix.target, 's390x') + # # s390x z15 (arch13) + # - run: tools/test.sh -vv --tests $TARGET $BUILD_STD $RELEASE + # env: + # # TODO: disable high-word LLVM target-feature to avoid LLVM codegen bug. + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=z15 -C target-feature=-high-word + # RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=z15 -C target-feature=-high-word + # if: startsWith(matrix.target, 's390x') - # Skip targets that also checked by "build" job. - - run: tools/build.sh ${{ matrix.target || 'host' }} - env: - SKIP_DEFAULT_TARGET: 1 - - run: TESTS=1 tools/build.sh ${{ matrix.target || 'host' }} - env: - SKIP_DEFAULT_TARGET: 1 + # # Skip targets that also checked by "build" job. + # - run: tools/build.sh ${{ matrix.target || 'host' }} + # env: + # SKIP_DEFAULT_TARGET: 1 + # - run: TESTS=1 tools/build.sh ${{ matrix.target || 'host' }} + # env: + # SKIP_DEFAULT_TARGET: 1 - - run: cargo minimal-versions build -vvv --workspace --no-private --features $TEST_FEATURES --ignore-unknown-features $TARGET $BUILD_STD $RELEASE + # - run: cargo minimal-versions build -vvv --workspace --no-private --features $TEST_FEATURES --ignore-unknown-features $TARGET $BUILD_STD $RELEASE - test-bsd: - needs: tidy - name: test (${{ matrix.target }}${{ matrix.version }}) - strategy: - fail-fast: false - matrix: - include: - - target: aarch64-unknown-freebsd - os: freebsd - version: '12.4' - - target: aarch64-unknown-freebsd - os: freebsd - version: '13.2' - - target: aarch64-unknown-openbsd - os: openbsd - version: '7.3' - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - uses: taiki-e/cross-platform-actions-action@neoverse-v1 - with: - environment_variables: CARGO_INCREMENTAL CARGO_NET_RETRY CARGO_TERM_COLOR RUST_BACKTRACE RUST_TEST_THREADS RUSTDOCFLAGS RUSTFLAGS RUSTUP_MAX_RETRIES TEST_FEATURES - operating_system: ${{ matrix.os }} - architecture: aarch64 - version: ${{ matrix.version }} - shell: bash - run: | - set -euxo pipefail - export RUSTFLAGS="${RUSTFLAGS} --cfg qemu" - # AArch64 FreeBSD/OpenBSD are tier 3 targets, so install rust from package manager instead of rustup. - case "$(uname -s)" in - FreeBSD) sudo pkg install -y rust ;; - OpenBSD) - # As of OpenBSD 7.3, the built-in git library is very slow. - export CARGO_NET_GIT_FETCH_WITH_CLI=true - # OpenBSD 7.3's rustc version is 1.68, which sparse protocol is not default protocol. - export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse - sudo pkg_add git rust - ;; - esac - rustc -vV - cargo test --features std --tests -- aarch64 + # test-bsd: + # needs: tidy + # name: test (${{ matrix.target }}${{ matrix.version }}) + # strategy: + # fail-fast: false + # matrix: + # include: + # - target: aarch64-unknown-freebsd + # os: freebsd + # version: '12.4' + # - target: aarch64-unknown-freebsd + # os: freebsd + # version: '13.2' + # - target: aarch64-unknown-openbsd + # os: openbsd + # version: '7.3' + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # steps: + # - uses: actions/checkout@v4 + # with: + # persist-credentials: false + # - uses: taiki-e/cross-platform-actions-action@neoverse-v1 + # with: + # environment_variables: CARGO_INCREMENTAL CARGO_NET_RETRY CARGO_TERM_COLOR RUST_BACKTRACE RUST_TEST_THREADS RUSTDOCFLAGS RUSTFLAGS RUSTUP_MAX_RETRIES TEST_FEATURES + # operating_system: ${{ matrix.os }} + # architecture: aarch64 + # version: ${{ matrix.version }} + # shell: bash + # run: | + # set -euxo pipefail + # export RUSTFLAGS="${RUSTFLAGS} --cfg qemu" + # # AArch64 FreeBSD/OpenBSD are tier 3 targets, so install rust from package manager instead of rustup. + # case "$(uname -s)" in + # FreeBSD) sudo pkg install -y rust ;; + # OpenBSD) + # # As of OpenBSD 7.3, the built-in git library is very slow. + # export CARGO_NET_GIT_FETCH_WITH_CLI=true + # # OpenBSD 7.3's rustc version is 1.68, which sparse protocol is not default protocol. + # export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse + # sudo pkg_add git rust + # ;; + # esac + # rustc -vV + # cargo test --features std --tests -- aarch64 build: - needs: tidy + # needs: tidy name: build (${{ matrix.name || matrix.rust }}) strategy: fail-fast: false matrix: include: - - rust: '1.34' - - rust: '1.59' - - rust: stable - - rust: beta + # - rust: '1.34' + # - rust: '1.59' + # - rust: stable + # - rust: beta - rust: nightly # The oldest nightly that can compile this crate is nightly-2019-01-27 # which Atomic{I,U}{8,16,32,64} stabilized. @@ -400,12 +400,12 @@ jobs: - name: nightly, --tests rust: nightly tests: 1 - # Check that this crate can be built for all builtin targets - - name: stable, all tier1/tier2 - rust: stable - target-group: tier1/tier2 - # Skip targets that also checked by other matrix. - skip-default-target: 1 + # # Check that this crate can be built for all builtin targets + # - name: stable, all tier1/tier2 + # rust: stable + # target-group: tier1/tier2 + # # Skip targets that also checked by other matrix. + # skip-default-target: 1 - name: nightly, all tier1/tier2 rust: nightly target-group: tier1/tier2 @@ -431,175 +431,175 @@ jobs: TARGET_GROUP: ${{ matrix.target-group }} SKIP_DEFAULT_TARGET: ${{ matrix.skip-default-target }} - no-std: - needs: tidy - strategy: - fail-fast: false - matrix: - rust: - - '1.64' - - stable - - nightly - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Install Rust - run: rustup toolchain add ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} - - uses: taiki-e/install-action@cargo-hack - if: startsWith(matrix.rust, 'nightly') - - uses: taiki-e/install-action@v2 - with: - tool: espup - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: startsWith(matrix.rust, 'nightly') - - run: | - set -euxo pipefail - sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends \ - avr-libc \ - gcc-avr \ - qemu-system-arm \ - qemu-system-misc \ - simavr - # APT's qemu package doesn't provide firmware for riscv32: https://packages.ubuntu.com/en/jammy/all/qemu-system-data/filelist - OPENSBI_VERSION=1.3.1 # https://github.com/riscv-software-src/opensbi/releases - curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://github.com/riscv-software-src/opensbi/releases/download/v${OPENSBI_VERSION}/opensbi-${OPENSBI_VERSION}-rv-bin.tar.xz" \ - | tar xJf - - sudo mv "opensbi-${OPENSBI_VERSION}-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin" /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin - sudo mv "opensbi-${OPENSBI_VERSION}-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.elf" /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.elf - rm -rf "opensbi-${OPENSBI_VERSION}-rv-bin" - - run: espup install --targets esp32 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: startsWith(matrix.rust, 'nightly') - - run: tools/no-std.sh - - run: tools/build.sh +esp xtensa-esp32-none-elf - if: startsWith(matrix.rust, 'nightly') - - run: tools/no-std.sh +esp xtensa-esp32-none-elf - if: startsWith(matrix.rust, 'nightly') + # no-std: + # needs: tidy + # strategy: + # fail-fast: false + # matrix: + # rust: + # - '1.64' + # - stable + # - nightly + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # steps: + # - uses: actions/checkout@v4 + # with: + # persist-credentials: false + # - name: Install Rust + # run: rustup toolchain add ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} + # - uses: taiki-e/install-action@cargo-hack + # if: startsWith(matrix.rust, 'nightly') + # - uses: taiki-e/install-action@v2 + # with: + # tool: espup + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # if: startsWith(matrix.rust, 'nightly') + # - run: | + # set -euxo pipefail + # sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends \ + # avr-libc \ + # gcc-avr \ + # qemu-system-arm \ + # qemu-system-misc \ + # simavr + # # APT's qemu package doesn't provide firmware for riscv32: https://packages.ubuntu.com/en/jammy/all/qemu-system-data/filelist + # OPENSBI_VERSION=1.3.1 # https://github.com/riscv-software-src/opensbi/releases + # curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://github.com/riscv-software-src/opensbi/releases/download/v${OPENSBI_VERSION}/opensbi-${OPENSBI_VERSION}-rv-bin.tar.xz" \ + # | tar xJf - + # sudo mv "opensbi-${OPENSBI_VERSION}-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin" /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin + # sudo mv "opensbi-${OPENSBI_VERSION}-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.elf" /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.elf + # rm -rf "opensbi-${OPENSBI_VERSION}-rv-bin" + # - run: espup install --targets esp32 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # if: startsWith(matrix.rust, 'nightly') + # - run: tools/no-std.sh + # - run: tools/build.sh +esp xtensa-esp32-none-elf + # if: startsWith(matrix.rust, 'nightly') + # - run: tools/no-std.sh +esp xtensa-esp32-none-elf + # if: startsWith(matrix.rust, 'nightly') - miri: - needs: tidy - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-unknown-linux-gnu - - target: x86_64-unknown-linux-gnu - flags: -C target-feature=+cmpxchg16b - - target: aarch64-unknown-linux-gnu - - target: i686-unknown-linux-gnu - - target: powerpc64le-unknown-linux-gnu - - target: s390x-unknown-linux-gnu - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Install Rust - run: rustup toolchain add nightly --no-self-update --component miri && rustup default nightly - - run: sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils - - run: echo "TARGET=--target=${{ matrix.target }}" >>"${GITHUB_ENV}" - if: matrix.target != 'x86_64-unknown-linux-gnu' - - run: tools/test.sh miri $TARGET - env: - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} ${{ matrix.flags }} - RUSTFLAGS: ${{ env.RUSTFLAGS }} ${{ matrix.flags }} + # miri: + # needs: tidy + # strategy: + # fail-fast: false + # matrix: + # include: + # - target: x86_64-unknown-linux-gnu + # - target: x86_64-unknown-linux-gnu + # flags: -C target-feature=+cmpxchg16b + # - target: aarch64-unknown-linux-gnu + # - target: i686-unknown-linux-gnu + # - target: powerpc64le-unknown-linux-gnu + # - target: s390x-unknown-linux-gnu + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # steps: + # - uses: actions/checkout@v4 + # with: + # persist-credentials: false + # - name: Install Rust + # run: rustup toolchain add nightly --no-self-update --component miri && rustup default nightly + # - run: sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils + # - run: echo "TARGET=--target=${{ matrix.target }}" >>"${GITHUB_ENV}" + # if: matrix.target != 'x86_64-unknown-linux-gnu' + # - run: tools/test.sh miri $TARGET + # env: + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} ${{ matrix.flags }} + # RUSTFLAGS: ${{ env.RUSTFLAGS }} ${{ matrix.flags }} - san: - needs: tidy - strategy: - fail-fast: false - matrix: - sanitizer: - - address - - memory - - thread - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Install Rust - run: rustup toolchain add nightly --no-self-update && rustup default nightly - - run: sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils - - run: | - echo "ASAN_OPTIONS=detect_stack_use_after_return=1" >>"${GITHUB_ENV}" - echo "RUSTFLAGS=${RUSTFLAGS} -Z sanitizer=address" >>"${GITHUB_ENV}" - echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} -Z sanitizer=address" >>"${GITHUB_ENV}" - if: matrix.sanitizer == 'address' - - run: | - echo "MSAN_OPTIONS=verbosity=2" >>"${GITHUB_ENV}" - echo "RUSTFLAGS=${RUSTFLAGS} -Z sanitizer=memory -Z sanitizer-memory-track-origins" >>"${GITHUB_ENV}" - echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} -Z sanitizer=memory -Z sanitizer-memory-track-origins" >>"${GITHUB_ENV}" - if: matrix.sanitizer == 'memory' - - run: | - echo "RUSTFLAGS=${RUSTFLAGS} -Z sanitizer=thread" >>"${GITHUB_ENV}" - echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} -Z sanitizer=thread" >>"${GITHUB_ENV}" - if: matrix.sanitizer == 'thread' - - run: tools/test.sh -Z build-std -vv - # We test doctest only once with the default build conditions because doctest is slow. Both api-test - # and src/tests have extended copies of doctest, so this will not reduce test coverage. - # +cmpxchg16b - - run: tools/test.sh -Z build-std -vv --tests - env: - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics - RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics + # san: + # needs: tidy + # strategy: + # fail-fast: false + # matrix: + # sanitizer: + # - address + # - memory + # - thread + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # steps: + # - uses: actions/checkout@v4 + # with: + # persist-credentials: false + # - name: Install Rust + # run: rustup toolchain add nightly --no-self-update && rustup default nightly + # - run: sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils + # - run: | + # echo "ASAN_OPTIONS=detect_stack_use_after_return=1" >>"${GITHUB_ENV}" + # echo "RUSTFLAGS=${RUSTFLAGS} -Z sanitizer=address" >>"${GITHUB_ENV}" + # echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} -Z sanitizer=address" >>"${GITHUB_ENV}" + # if: matrix.sanitizer == 'address' + # - run: | + # echo "MSAN_OPTIONS=verbosity=2" >>"${GITHUB_ENV}" + # echo "RUSTFLAGS=${RUSTFLAGS} -Z sanitizer=memory -Z sanitizer-memory-track-origins" >>"${GITHUB_ENV}" + # echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} -Z sanitizer=memory -Z sanitizer-memory-track-origins" >>"${GITHUB_ENV}" + # if: matrix.sanitizer == 'memory' + # - run: | + # echo "RUSTFLAGS=${RUSTFLAGS} -Z sanitizer=thread" >>"${GITHUB_ENV}" + # echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} -Z sanitizer=thread" >>"${GITHUB_ENV}" + # if: matrix.sanitizer == 'thread' + # - run: tools/test.sh -Z build-std -vv + # # We test doctest only once with the default build conditions because doctest is slow. Both api-test + # # and src/tests have extended copies of doctest, so this will not reduce test coverage. + # # +cmpxchg16b + # - run: tools/test.sh -Z build-std -vv --tests + # env: + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics + # RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics - valgrind: - needs: tidy - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Install Rust - run: rustup toolchain add nightly --no-self-update && rustup default nightly - - run: sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils - - uses: taiki-e/install-action@valgrind - - run: tools/test.sh valgrind -vv - # We test doctest only once with the default build conditions because doctest is slow. Both api-test - # and src/tests have extended copies of doctest, so this will not reduce test coverage. - # +cmpxchg16b - - run: tools/test.sh valgrind -vv --tests - env: - # vmovdqa load/store path has been tested above, disable outline-atomics and test cmpxchg16b load/store path. - RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics - RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics + # valgrind: + # needs: tidy + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # steps: + # - uses: actions/checkout@v4 + # with: + # persist-credentials: false + # - name: Install Rust + # run: rustup toolchain add nightly --no-self-update && rustup default nightly + # - run: sudo apt-get -o Acquire::Retries=10 -qq update && sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends moreutils + # - uses: taiki-e/install-action@valgrind + # - run: tools/test.sh valgrind -vv + # # We test doctest only once with the default build conditions because doctest is slow. Both api-test + # # and src/tests have extended copies of doctest, so this will not reduce test coverage. + # # +cmpxchg16b + # - run: tools/test.sh valgrind -vv --tests + # env: + # # vmovdqa load/store path has been tested above, disable outline-atomics and test cmpxchg16b load/store path. + # RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics + # RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b --cfg portable_atomic_no_outline_atomics - codegen: - needs: tidy - runs-on: ubuntu-latest - timeout-minutes: 60 - permissions: - contents: write - pull-requests: write - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Install Rust - run: rustup toolchain add nightly --no-self-update --component rustfmt && rustup default nightly - - run: tools/no_atomic.sh - - run: tools/gen.sh - - id: diff - run: tools/ci/gen.sh - if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') - - uses: peter-evans/create-pull-request@v5 - with: - title: Update generated code - body: | - Auto-generated by [create-pull-request][1] - [Please close and immediately reopen this pull request to run CI.][2] + # codegen: + # needs: tidy + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # permissions: + # contents: write + # pull-requests: write + # steps: + # - uses: actions/checkout@v4 + # with: + # persist-credentials: false + # - name: Install Rust + # run: rustup toolchain add nightly --no-self-update --component rustfmt && rustup default nightly + # - run: tools/no_atomic.sh + # - run: tools/gen.sh + # - id: diff + # run: tools/ci/gen.sh + # if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') + # - uses: peter-evans/create-pull-request@v5 + # with: + # title: Update generated code + # body: | + # Auto-generated by [create-pull-request][1] + # [Please close and immediately reopen this pull request to run CI.][2] - [1]: https://github.com/peter-evans/create-pull-request - [2]: https://github.com/peter-evans/create-pull-request/blob/HEAD/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs - branch: update-generated-code - if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false' - - run: git add -N . && git diff --exit-code + # [1]: https://github.com/peter-evans/create-pull-request + # [2]: https://github.com/peter-evans/create-pull-request/blob/HEAD/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs + # branch: update-generated-code + # if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false' + # - run: git add -N . && git diff --exit-code diff --git a/tools/build.sh b/tools/build.sh index 47d54f292..4c5ab22a7 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -21,92 +21,92 @@ trap -- 'echo >&2 "$0: trapped SIGINT"; exit 1' SIGINT # Almost all targets are checked at least once by the matrix in CI's "build" job that sets target-group. # Some targets are also checked by calls to this script in CI's "test" or "no-std" job. default_targets=( - # no atomic load/store (16-bit) - msp430-none-elf - msp430-unknown-none-elf # same as msp430-none-elf, but for checking custom target - # no atomic load/store (32-bit) - riscv32i-unknown-none-elf - mipsel-sony-psx - # no atomic load/store (64-bit) - riscv64i-unknown-none-elf # custom target + # # no atomic load/store (16-bit) + # msp430-none-elf + # msp430-unknown-none-elf # same as msp430-none-elf, but for checking custom target + # # no atomic load/store (32-bit) + # riscv32i-unknown-none-elf + # mipsel-sony-psx + # # no atomic load/store (64-bit) + # riscv64i-unknown-none-elf # custom target - # no atomic CAS (16-bit) - avr-unknown-gnu-atmega2560 # custom target - avr-unknown-gnu-atmega328 - # no atomic CAS (32-bit) - thumbv4t-none-eabi - thumbv6m-none-eabi - # no atomic CAS (64-bit) - bpfel-unknown-none + # # no atomic CAS (16-bit) + # avr-unknown-gnu-atmega2560 # custom target + # avr-unknown-gnu-atmega328 + # # no atomic CAS (32-bit) + # thumbv4t-none-eabi + # thumbv6m-none-eabi + # # no atomic CAS (64-bit) + # bpfel-unknown-none - # no-std 32-bit with 32-bit atomic - thumbv7m-none-eabi - # no-std 64-bit with 64-bit atomic - x86_64-unknown-none - # no-std 64-bit with 128-bit atomic - aarch64-unknown-none + # # no-std 32-bit with 32-bit atomic + # thumbv7m-none-eabi + # # no-std 64-bit with 64-bit atomic + # x86_64-unknown-none + # # no-std 64-bit with 128-bit atomic + # aarch64-unknown-none - # x86_64 - # rustc --print target-list | grep -E '^x86_64' - x86_64-unknown-linux-gnu - # x86_64 with CMPXCHG16B - x86_64-apple-darwin - # x86_64 X32 ABI - x86_64-unknown-linux-gnux32 - # x86_64 without CPUID - x86_64-fortanix-unknown-sgx + # # x86_64 + # # rustc --print target-list | grep -E '^x86_64' + # x86_64-unknown-linux-gnu + # # x86_64 with CMPXCHG16B + # x86_64-apple-darwin + # # x86_64 X32 ABI + # x86_64-unknown-linux-gnux32 + # # x86_64 without CPUID + # x86_64-fortanix-unknown-sgx - # x86 - i686-unknown-linux-gnu - i586-unknown-linux-gnu + # # x86 + # i686-unknown-linux-gnu + # i586-unknown-linux-gnu - # aarch64 - # rustc --print target-list | grep -E '^(aarch64|arm64)' - # (for target in $(rustc --print target-list | grep -E '^(aarch64|arm64)'); do rustc --print target-spec-json -Z unstable-options --target "${target}" | jq -r '.os'; done) | LC_ALL=C sort -u - aarch64-linux-android - aarch64-pc-windows-msvc - aarch64-unknown-freebsd - aarch64-unknown-fuchsia - aarch64-unknown-linux-gnu - aarch64-unknown-linux-musl - aarch64-unknown-linux-uclibc # custom target + # # aarch64 + # # rustc --print target-list | grep -E '^(aarch64|arm64)' + # # (for target in $(rustc --print target-list | grep -E '^(aarch64|arm64)'); do rustc --print target-spec-json -Z unstable-options --target "${target}" | jq -r '.os'; done) | LC_ALL=C sort -u + # aarch64-linux-android + # aarch64-pc-windows-msvc + # aarch64-unknown-freebsd + # aarch64-unknown-fuchsia + # aarch64-unknown-linux-gnu + # aarch64-unknown-linux-musl + # aarch64-unknown-linux-uclibc # custom target aarch64-unknown-netbsd - aarch64-unknown-openbsd - # aarch64 with FEAT_LSE & FEAT_LSE2 - aarch64-apple-darwin - # aarch64 big endian - aarch64_be-unknown-linux-gnu + # aarch64-unknown-openbsd + # # aarch64 with FEAT_LSE & FEAT_LSE2 + # aarch64-apple-darwin + # # aarch64 big endian + # aarch64_be-unknown-linux-gnu aarch64_be-unknown-netbsd - # aarch64 ILP32 ABI - aarch64-unknown-linux-gnu_ilp32 - # aarch64 ILP32 ABI big endian - aarch64_be-unknown-linux-gnu_ilp32 + # # aarch64 ILP32 ABI + # aarch64-unknown-linux-gnu_ilp32 + # # aarch64 ILP32 ABI big endian + # aarch64_be-unknown-linux-gnu_ilp32 - # pre-v6 arm linux-like - armv4t-unknown-linux-gnueabi - armv5te-unknown-linux-gnueabi - arm-linux-androideabi + # # pre-v6 arm linux-like + # armv4t-unknown-linux-gnueabi + # armv5te-unknown-linux-gnueabi + # arm-linux-androideabi - # riscv32 with atomic - riscv32imac-unknown-none-elf - riscv32imc-esp-espidf - # riscv64 with atomic - riscv64gc-unknown-linux-gnu + # # riscv32 with atomic + # riscv32imac-unknown-none-elf + # riscv32imc-esp-espidf + # # riscv64 with atomic + # riscv64gc-unknown-linux-gnu - # powerpc64 - # rustc --print target-list | grep -E '^powerpc64' - # (for target in $(rustc --print target-list | grep -E '^powerpc64'); do rustc --print target-spec-json -Z unstable-options --target "${target}" | jq -r '.os'; done) | LC_ALL=C sort -u - powerpc64-unknown-linux-gnu - powerpc64le-unknown-linux-gnu - # TODO: LLVM or rustc bug: compiler/rustc_codegen_llvm/src/context.rs:189:13: data-layout for target `powerpc64-unknown-linux-musl`, `E-m:e-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512`, differs from LLVM target's `powerpc64-unknown-linux-musl` default layout, `E-m:e-Fn32-i64:64-n32:64-S128-v256:256:256-v512:512:512` - # powerpc64-unknown-linux-musl - powerpc64le-unknown-linux-musl - powerpc64-unknown-freebsd - powerpc64le-unknown-freebsd + # # powerpc64 + # # rustc --print target-list | grep -E '^powerpc64' + # # (for target in $(rustc --print target-list | grep -E '^powerpc64'); do rustc --print target-spec-json -Z unstable-options --target "${target}" | jq -r '.os'; done) | LC_ALL=C sort -u + # powerpc64-unknown-linux-gnu + # powerpc64le-unknown-linux-gnu + # # TODO: LLVM or rustc bug: compiler/rustc_codegen_llvm/src/context.rs:189:13: data-layout for target `powerpc64-unknown-linux-musl`, `E-m:e-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512`, differs from LLVM target's `powerpc64-unknown-linux-musl` default layout, `E-m:e-Fn32-i64:64-n32:64-S128-v256:256:256-v512:512:512` + # # powerpc64-unknown-linux-musl + # powerpc64le-unknown-linux-musl + # powerpc64-unknown-freebsd + # powerpc64le-unknown-freebsd - # s390x - # rustc --print target-list | grep -E '^s390x' - s390x-unknown-linux-gnu + # # s390x + # # rustc --print target-list | grep -E '^s390x' + # s390x-unknown-linux-gnu ) known_cfgs=( # Public APIs