Skip to content

dev

dev #2241

Workflow file for this run

name: CI
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
- dev
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
env:
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUST_TEST_THREADS: 1
RUSTDOCFLAGS: -D warnings
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10
ATOMIC_MAYBE_UNINIT_DENY_WARNINGS: 1
defaults:
run:
shell: bash --noprofile --norc -CeEuxo pipefail {0}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
# msrv:
# needs: tidy
# uses: taiki-e/github-actions/.github/workflows/msrv.yml@main
# with:
# event_name: ${{ github.event_name }}
# tidy:
# uses: taiki-e/github-actions/.github/workflows/tidy.yml@main
# permissions:
# contents: read
# pull-requests: write # for gh pr edit --add-assignee
# repository-projects: read # for gh pr edit --add-assignee
# secrets: inherit
# with:
# clippy: false # covered by TESTS=1 ./tools/build.sh
# test:
# needs: tidy
# strategy:
# fail-fast: false
# matrix:
# # See also LLVM version table in /~https://github.com/taiki-e/portable-atomic/blob/HEAD/.github/workflows/ci.yml.
# include:
# # ------------------------------------------------------------
# # x86_64-unknown-linux-gnu
# - rust: '1.59' # LLVM 13
# - rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
# # - rust: '1.81' # LLVM 18
# - rust: stable
# - rust: beta
# - rust: nightly
# - rust: nightly
# flags: -C panic=abort -Z panic_abort_tests
# - rust: nightly
# flags: -Z codegen-backend=cranelift
# # ------------------------------------------------------------
# # x86_64-apple-darwin
# - rust: nightly
# os: macos-13 # x86_64
# # ------------------------------------------------------------
# # x86_64-pc-windows-msvc
# - rust: nightly
# os: windows-latest
# # ------------------------------------------------------------
# # aarch64-apple-darwin
# - rust: '1.59' # LLVM 13
# os: macos-latest # AArch64
# - rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
# os: macos-latest # AArch64
# # - rust: '1.81' # LLVM 18
# # os: macos-latest # AArch64
# - rust: stable
# os: macos-latest # AArch64
# # - rust: beta
# # os: macos-latest # AArch64
# - rust: nightly
# os: macos-latest # AArch64
# # ------------------------------------------------------------
# # aarch64-unknown-linux-gnu
# - rust: '1.59' # LLVM 13
# target: aarch64-unknown-linux-gnu
# - rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
# target: aarch64-unknown-linux-gnu
# # - rust: '1.81' # LLVM 18
# # 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-unknown-linux-gnu
# flags: -Z codegen-backend=cranelift
# # ------------------------------------------------------------
# # aarch64_be-unknown-linux-gnu
# - rust: nightly-2021-12-16 # Rust 1.59, LLVM 13 (oldest version we can use stable asm on this target)
# target: aarch64_be-unknown-linux-gnu
# os: ubuntu-22.04
# - rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
# target: aarch64_be-unknown-linux-gnu
# os: ubuntu-22.04
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: aarch64_be-unknown-linux-gnu
# # os: ubuntu-22.04
# - rust: nightly-2024-11-07 # TODO: /~https://github.com/BurntSushi/memchr/pull/162
# target: aarch64_be-unknown-linux-gnu
# os: ubuntu-22.04
# # ------------------------------------------------------------
# # armv5te-unknown-linux-gnueabi
# - rust: '1.59' # LLVM 13
# target: armv5te-unknown-linux-gnueabi
# - rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
# target: armv5te-unknown-linux-gnueabi
# # - rust: '1.81' # LLVM 18
# # target: armv5te-unknown-linux-gnueabi
# - rust: stable
# target: armv5te-unknown-linux-gnueabi
# # - rust: beta
# # target: armv5te-unknown-linux-gnueabi
# - rust: nightly
# target: armv5te-unknown-linux-gnueabi
# # ------------------------------------------------------------
# # arm-unknown-linux-gnueabi
# - rust: '1.59' # LLVM 13
# target: arm-unknown-linux-gnueabi
# - rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
# target: arm-unknown-linux-gnueabi
# # - rust: '1.81' # LLVM 18
# # target: arm-unknown-linux-gnueabi
# - rust: stable
# target: arm-unknown-linux-gnueabi
# # - rust: beta
# # target: arm-unknown-linux-gnueabi
# - rust: nightly
# target: arm-unknown-linux-gnueabi
# # ------------------------------------------------------------
# # armv7-unknown-linux-gnueabi
# - rust: '1.59' # LLVM 13
# target: armv7-unknown-linux-gnueabi
# - rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
# target: armv7-unknown-linux-gnueabi
# # - rust: '1.81' # LLVM 18
# # target: armv7-unknown-linux-gnueabi
# - rust: stable
# target: armv7-unknown-linux-gnueabi
# # - rust: beta
# # target: armv7-unknown-linux-gnueabi
# - rust: nightly
# target: armv7-unknown-linux-gnueabi
# # ------------------------------------------------------------
# # armv7-unknown-linux-gnueabihf
# - rust: '1.59' # LLVM 13
# target: armv7-unknown-linux-gnueabihf
# - rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
# target: armv7-unknown-linux-gnueabihf
# # - rust: '1.81' # LLVM 18
# # target: armv7-unknown-linux-gnueabihf
# - rust: stable
# target: armv7-unknown-linux-gnueabihf
# # - rust: beta
# # target: armv7-unknown-linux-gnueabihf
# - rust: nightly
# target: armv7-unknown-linux-gnueabihf
# # ------------------------------------------------------------
# # armeb-unknown-linux-gnueabi
# - rust: nightly-2022-09-16 # Rust 1.65, LLVM 15 (version that this target was added)
# target: armeb-unknown-linux-gnueabi
# os: ubuntu-22.04
# - rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
# target: armeb-unknown-linux-gnueabi
# os: ubuntu-22.04
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: armeb-unknown-linux-gnueabi
# # os: ubuntu-22.04
# - rust: nightly
# target: armeb-unknown-linux-gnueabi
# os: ubuntu-22.04
# # ------------------------------------------------------------
# # i586-unknown-linux-gnu
# - rust: '1.59' # LLVM 13
# target: i586-unknown-linux-gnu
# - rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
# target: i586-unknown-linux-gnu
# # - rust: '1.81' # LLVM 18
# # target: i586-unknown-linux-gnu
# - rust: stable
# target: i586-unknown-linux-gnu
# # - rust: beta
# # target: i586-unknown-linux-gnu
# - rust: nightly
# target: i586-unknown-linux-gnu
# # ------------------------------------------------------------
# # i686-unknown-linux-gnu
# - rust: '1.59' # LLVM 13
# target: i686-unknown-linux-gnu
# - rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
# target: i686-unknown-linux-gnu
# # - rust: '1.81' # LLVM 18
# # target: i686-unknown-linux-gnu
# - rust: stable
# target: i686-unknown-linux-gnu
# # - rust: beta
# # target: i686-unknown-linux-gnu
# - rust: nightly
# target: i686-unknown-linux-gnu
# # ------------------------------------------------------------
# # hexagon-unknown-linux-musl
# - rust: nightly-2024-11-29 # Rust 1.85, LLVM 19 (oldest version we can use asm_experimental_arch on this target)
# target: hexagon-unknown-linux-musl
# - rust: nightly
# target: hexagon-unknown-linux-musl
# # ------------------------------------------------------------
# # loongarch64-unknown-linux-gnu
# - rust: '1.72' # LLVM 16, inline asm for loongarch has been stabilized in Rust 1.72
# target: loongarch64-unknown-linux-gnu
# - rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
# target: loongarch64-unknown-linux-gnu
# # - rust: '1.81' # LLVM 18
# # target: loongarch64-unknown-linux-gnu
# - rust: stable
# target: loongarch64-unknown-linux-gnu
# # - rust: beta
# # target: loongarch64-unknown-linux-gnu
# - rust: nightly
# target: loongarch64-unknown-linux-gnu
# # ------------------------------------------------------------
# # mips-unknown-linux-gnu
# - rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
# target: mips-unknown-linux-gnu
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: mips-unknown-linux-gnu
# - rust: nightly
# target: mips-unknown-linux-gnu
# # ------------------------------------------------------------
# # mipsel-unknown-linux-gnu
# - rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
# target: mipsel-unknown-linux-gnu
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: mipsel-unknown-linux-gnu
# - rust: nightly
# target: mipsel-unknown-linux-gnu
# # ------------------------------------------------------------
# # mips64-unknown-linux-gnuabi64
# - rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
# target: mips64-unknown-linux-gnuabi64
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: mips64-unknown-linux-gnuabi64
# - rust: nightly
# target: mips64-unknown-linux-gnuabi64
# # ------------------------------------------------------------
# # mips64el-unknown-linux-gnuabi64
# - rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
# target: mips64el-unknown-linux-gnuabi64
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: mips64el-unknown-linux-gnuabi64
# - rust: nightly
# target: mips64el-unknown-linux-gnuabi64
# # ------------------------------------------------------------
# # mipsisa32r6-unknown-linux-gnu
# - rust: nightly-2023-09-20 # Rust 1.74, LLVM 17 (cannot built with nightly-2023-08-24 due to compiler failure from libc when building std)
# target: mipsisa32r6-unknown-linux-gnu
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: mipsisa32r6-unknown-linux-gnu
# - rust: nightly
# target: mipsisa32r6-unknown-linux-gnu
# # ------------------------------------------------------------
# # mipsisa32r6el-unknown-linux-gnu
# - rust: nightly-2023-09-20 # Rust 1.74, LLVM 17 (cannot built with nightly-2023-08-24 due to compiler failure from libc when building std)
# target: mipsisa32r6el-unknown-linux-gnu
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: mipsisa32r6el-unknown-linux-gnu
# - rust: nightly
# target: mipsisa32r6el-unknown-linux-gnu
# # ------------------------------------------------------------
# # mipsisa64r6-unknown-linux-gnuabi64
# - rust: nightly-2023-09-20 # Rust 1.74, LLVM 17 (cannot built with nightly-2023-08-24 due to compiler failure from libc when building std)
# target: mipsisa64r6-unknown-linux-gnuabi64
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: mipsisa64r6-unknown-linux-gnuabi64
# - rust: nightly
# target: mipsisa64r6-unknown-linux-gnuabi64
# # ------------------------------------------------------------
# # mipsisa64r6el-unknown-linux-gnuabi64
# - rust: nightly-2023-09-20 # Rust 1.74, LLVM 17 (cannot built with nightly-2023-08-24 due to compiler failure from libc when building std)
# target: mipsisa64r6el-unknown-linux-gnuabi64
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: mipsisa64r6el-unknown-linux-gnuabi64
# - rust: nightly
# target: mipsisa64r6el-unknown-linux-gnuabi64
# # ------------------------------------------------------------
# # powerpc-unknown-linux-gnu
# - rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
# target: powerpc-unknown-linux-gnu
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: powerpc-unknown-linux-gnu
# - rust: nightly
# target: powerpc-unknown-linux-gnu
# # ------------------------------------------------------------
# # powerpc64-unknown-linux-gnu
# - rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
# target: powerpc64-unknown-linux-gnu
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: powerpc64-unknown-linux-gnu
# - rust: nightly
# target: powerpc64-unknown-linux-gnu
# # ------------------------------------------------------------
# # powerpc64le-unknown-linux-gnu
# - rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
# target: powerpc64le-unknown-linux-gnu
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: powerpc64le-unknown-linux-gnu
# - rust: nightly
# target: powerpc64le-unknown-linux-gnu
# # ------------------------------------------------------------
# # riscv32gc-unknown-linux-gnu
# - rust: nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
# target: riscv32gc-unknown-linux-gnu
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: riscv32gc-unknown-linux-gnu
# - rust: nightly
# target: riscv32gc-unknown-linux-gnu
# # ------------------------------------------------------------
# # riscv64gc-unknown-linux-gnu
# - rust: '1.59' # LLVM 13
# target: riscv64gc-unknown-linux-gnu
# - rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
# target: riscv64gc-unknown-linux-gnu
# # - rust: '1.81' # LLVM 18
# # target: riscv64gc-unknown-linux-gnu
# - rust: stable
# target: riscv64gc-unknown-linux-gnu
# # - rust: beta
# # target: riscv64gc-unknown-linux-gnu
# - rust: nightly
# target: riscv64gc-unknown-linux-gnu
# # TODO: cranelift doesn't support cfg(target_feature): /~https://github.com/rust-lang/rustc_codegen_cranelift/issues/1400
# # - rust: nightly
# # target: riscv64gc-unknown-linux-gnu
# # flags: -Z codegen-backend=cranelift
# # ------------------------------------------------------------
# # s390x-unknown-linux-gnu
# - rust: nightly-2024-01-05 # Rust 1.77, LLVM 17 (oldest version we can use asm_experimental_arch on this target)
# target: s390x-unknown-linux-gnu
# # - rust: nightly-2024-07-31 # Rust 1.82, LLVM 18
# # target: s390x-unknown-linux-gnu
# - rust: '1.84' # LLVM 19 (oldest stable version we can use asm on this target)
# target: s390x-unknown-linux-gnu
# - rust: stable
# target: s390x-unknown-linux-gnu
# # - rust: beta
# # target: s390x-unknown-linux-gnu
# - rust: nightly
# target: s390x-unknown-linux-gnu
# # ------------------------------------------------------------
# # sparc-unknown-linux-gnu
# - rust: nightly-2024-11-08 # Rust 1.84, LLVM 19 (oldest version we can use asm_experimental_arch on this target)
# target: sparc-unknown-linux-gnu
# flags: -C target-feature=-v8plus
# # TODO: needs LLVM 20
# - rust: nightly
# target: sparc-unknown-linux-gnu
# flags: -C target-feature=-v8plus
# # ------------------------------------------------------------
# # sparc64-unknown-linux-gnu
# - rust: nightly-2024-11-08 # Rust 1.84, LLVM 19 (oldest version we can use asm_experimental_arch on this target)
# target: sparc64-unknown-linux-gnu
# - rust: nightly
# target: sparc64-unknown-linux-gnu
# # ------------------------------------------------------------
# # thumbv7neon-unknown-linux-gnueabihf
# - rust: '1.59' # LLVM 13
# target: thumbv7neon-unknown-linux-gnueabihf
# - rust: '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
# target: thumbv7neon-unknown-linux-gnueabihf
# # - rust: '1.81' # LLVM 18
# # target: thumbv7neon-unknown-linux-gnueabihf
# - rust: stable
# target: thumbv7neon-unknown-linux-gnueabihf
# # - rust: beta
# # target: thumbv7neon-unknown-linux-gnueabihf
# - rust: nightly
# target: thumbv7neon-unknown-linux-gnueabihf
# runs-on: ${{ matrix.os || 'ubuntu-latest' }}
# timeout-minutes: 60
# steps:
# - uses: taiki-e/checkout-action@v1
# - 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')
# - uses: taiki-e/github-actions/install-rust@main
# with:
# toolchain: ${{ matrix.rust }}
# - 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: printf '%s\n' "TARGET=--target=${{ matrix.target }}" >>"${GITHUB_ENV}"
# if: matrix.target != ''
# - run: printf '%s\n' "RUSTFLAGS=${RUSTFLAGS} --cfg qemu" >>"${GITHUB_ENV}"
# if: matrix.target != '' && !startsWith(matrix.target, 'i686') && !startsWith(matrix.target, 'x86_64') && !startsWith(matrix.os, 'macos')
# - run: |
# printf '%s\n' "RUSTFLAGS=${RUSTFLAGS} ${{ matrix.flags }}" >>"${GITHUB_ENV}"
# printf '%s\n' "RUSTDOCFLAGS=${RUSTDOCFLAGS} ${{ matrix.flags }}" >>"${GITHUB_ENV}"
# if: matrix.flags != ''
# # TODO: LLVM bug: Undefined temporary symbol error when building std.
# - run: printf 'RELEASE=--release\n' >>"${GITHUB_ENV}"
# if: startsWith(matrix.target, 'mips-') || startsWith(matrix.target, 'mipsel-')
# # - run: |
# # # /~https://github.com/taiki-e/dockerfiles/pkgs/container/qemu-user
# # docker create --name qemu-user ghcr.io/taiki-e/qemu-user
# # mkdir -p -- qemu-user
# # docker cp -- qemu-user:/usr/bin qemu-user/bin
# # docker rm -f -- qemu-user >/dev/null
# # sudo mv -- qemu-user/bin/qemu-sparc /usr/bin/
# # rm -rf -- ./qemu-user
# # printf '#!/bin/bash\n' >./qemu-sparc-wrapper
# # printf 'file $1 || true\n' >>./qemu-sparc-wrapper
# # printf 'readelf --file-header $1 || true\n' >>./qemu-sparc-wrapper
# # printf 'qemu-sparc "$@" || true\n' >>./qemu-sparc-wrapper
# # chmod +x ./qemu-sparc-wrapper
# # sudo mv -- ./qemu-sparc-wrapper /usr/bin/
# # mv target-specs/sparc-unknown-linux-gnu-leon3.json target-specs/sparc-unknown-linux-gnu.json
# # printf 'QEMU_CPU=LEON3\n' >>"${GITHUB_ENV}"
# # printf 'CARGO_TARGET_SPARC_UNKNOWN_LINUX_GNU_RUNNER=qemu-sparc-wrapper\n' >>"${GITHUB_ENV}"
# # sed -i 's/ -mv8plus/ -mno-v8plus/g' /usr/local/bin/sparc-unknown-linux-gnu-gcc
# # sed -i 's/ -mv8plus/ -mno-v8plus/g' /usr/local/bin/sparc-unknown-linux-gnu-g++
# # if: startsWith(matrix.target, 'sparc-') && contains(matrix.flags, 'gr712rc')
# # - run: |
# # mv target-specs/sparcv8plus-unknown-linux-gnu.json target-specs/sparc-unknown-linux-gnu.json
# # # sed -i 's/ -mv8plus/ -mno-v8plus/g' /usr/local/bin/sparc-unknown-linux-gnu-gcc
# # # sed -i 's/ -mv8plus/ -mno-v8plus/g' /usr/local/bin/sparc-unknown-linux-gnu-g++
# # if: startsWith(matrix.target, 'sparc-') && !contains(matrix.flags, 'gr712rc')
# - 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.
# # src/tests has extended copies of doctest, so this will not reduce test coverage.
# # x86_64 +cmpxchg16b
# # macOS is skipped because it is +cmpxchg16b by default
# - run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
# env:
# RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
# RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
# if: (matrix.target == '' || startsWith(matrix.target, 'x86_64')) && !startsWith(matrix.os, 'macos')
# # x86 -sse2
# - run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
# env:
# RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=-sse2
# RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=-sse2
# if: startsWith(matrix.target, 'i686')
# # x86 -x87
# - run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
# env:
# RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+soft-float,-x87,-mmx
# RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+soft-float,-x87,-mmx
# if: startsWith(matrix.target, 'i586')
# # 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
# # macOS is skipped because it is +rcpc,+lse,+lse2 by default
# if: startsWith(matrix.target, 'aarch64')
# # aarch64 +rcpc,+lse,+lse2
# - run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
# env:
# RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+rcpc,+lse,+lse2
# RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+rcpc,+lse,+lse2
# # macOS is skipped because it is +rcpc,+lse,+lse2 by default
# if: startsWith(matrix.target, 'aarch64')
# # arm v8 little endian
# - run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
# env:
# RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+v8
# RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+v8
# if: matrix.target == 'armv7-unknown-linux-gnueabi'
# # arm v6 with legacy cp15_barrier
# - run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
# env:
# RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} --cfg atomic_maybe_uninit_use_cp15_barrier
# RUSTFLAGS: ${{ env.RUSTFLAGS }} --cfg atomic_maybe_uninit_use_cp15_barrier
# if: matrix.target == 'arm-unknown-linux-gnueabi'
# # arm v7 big endian
# # armeb-unknown-linux-gnueabi is v8 by default, use custom target instead
# - run: tools/test.sh -vv --tests --target armebv7-unknown-linux-gnueabi -Z build-std ${RELEASE:-}
# env:
# CARGO_TARGET_ARMEBV7_UNKNOWN_LINUX_GNUEABI_LINKER: armeb-unknown-linux-gnueabi-gcc
# CARGO_TARGET_ARMEBV7_UNKNOWN_LINUX_GNUEABI_RUNNER: qemu-armeb
# if: startsWith(matrix.rust, 'nightly') && matrix.target == 'armeb-unknown-linux-gnueabi'
# # arm v4t
# - run: tools/test.sh -vv --tests --target armv4t-unknown-linux-gnueabi -Z build-std ${RELEASE:-}
# env:
# CARGO_TARGET_ARMV4T_UNKNOWN_LINUX_GNUEABI_LINKER: arm-linux-gnueabi-gcc
# CARGO_TARGET_ARMV4T_UNKNOWN_LINUX_GNUEABI_RUNNER: qemu-arm
# if: startsWith(matrix.rust, 'nightly') && matrix.target == 'armv5te-unknown-linux-gnueabi'
# # powerpc e500
# - run: tools/test.sh -vv --tests ${TARGET:-} -Z build-std ${RELEASE:-}
# env:
# RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-cpu=e500 --cfg atomic_maybe_uninit_target_feature="msync"
# RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-cpu=e500 --cfg atomic_maybe_uninit_target_feature="msync"
# QEMU_CPU: e500v2
# if: startsWith(matrix.rust, 'nightly') && startsWith(matrix.target, 'powerpc-')
# # 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-')
# # riscv +zabha
# - run: tools/test.sh -vv --tests ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
# env:
# RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+zabha
# RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+zabha
# QEMU_CPU: max
# if: startsWith(matrix.target, 'riscv')
# # 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')
# - run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-}
# - run: cargo minimal-versions build --workspace --no-private --detach-path-deps=skip-exact --all-features ${TARGET:-} ${BUILD_STD:-} ${RELEASE:-} --direct
# # -Z direct-minimal-versions requires Cargo 1.70.
# if: (!(startsWith(matrix.rust, '1.5') || startsWith(matrix.rust, '1.6') || startsWith(matrix.rust, 'nightly-2021') || startsWith(matrix.rust, 'nightly-2022') || startsWith(matrix.rust, 'nightly-2023')))
# build:
# needs: tidy
# name: build (${{ matrix.name || matrix.rust }})
# strategy:
# fail-fast: false
# matrix:
# include:
# - rust: '1.59'
# - rust: stable
# - rust: beta
# - rust: nightly-2023-08-23 # The last nightly version that doesn't support MaybeUninit registers.
# - rust: nightly-2023-08-24 # The oldest nightly version that supports MaybeUninit registers: /~https://github.com/rust-lang/rust/pull/114790
# - rust: nightly
# # Check that test suite can be built
# - name: nightly, --tests
# rust: nightly
# tests: 1
# runs-on: ubuntu-latest
# timeout-minutes: 60
# steps:
# - uses: taiki-e/checkout-action@v1
# - uses: taiki-e/github-actions/install-rust@main
# with:
# toolchain: ${{ matrix.rust }}
# - uses: taiki-e/install-action@cargo-hack
# - run: tools/build.sh
# env:
# TESTS: ${{ matrix.tests }}
no-std:
# needs: tidy
strategy:
fail-fast: false
matrix:
rust:
- '1.64' # LLVM 14
- '1.74' # LLVM 17 (oldest version that MaybeUninit register is supported)
- '1.75' # LLVM 17
- '1.76' # LLVM 17
- '1.77' # LLVM 17
- '1.78' # LLVM 17
- '1.79' # LLVM 17
- '1.80' # LLVM 17
- '1.81' # LLVM 18
- stable
- beta
- nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
- nightly
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- uses: taiki-e/github-actions/install-rust@main
with:
toolchain: ${{ matrix.rust }}
- uses: taiki-e/install-action@cargo-hack
if: matrix.rust == 'stable'
- uses: taiki-e/install-action@espup
if: matrix.rust == 'stable'
- run: |
retry() {
for i in {1..10}; do
if "$@"; then
return 0
else
sleep "${i}"
fi
done
"$@"
}
apt_packages=(
qemu-system-arm
qemu-system-misc
)
if [[ "${{ matrix.rust }}" == "nightly"* ]]; then
apt_packages+=(
avr-libc
gcc-avr
gcc-m68k-linux-gnu
libc6-dev-m68k-cross
qemu-system-sparc
simavr
)
if [[ "${{ matrix.rust }}" != "nightly-2023-08-24" ]]; then
apt_packages+=(
libnspr4
mspdebug
)
fi
fi
retry sudo apt-get -o Acquire::Retries=10 -qq update
retry sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends "${apt_packages[@]}"
# APT's qemu package doesn't provide firmware for riscv32: https://packages.ubuntu.com/en/jammy/all/qemu-system-data/filelist
opensbi_version=1.6 # /~https://github.com/riscv-software-src/opensbi/releases
retry 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"
if [[ "${{ matrix.rust }}" == "nightly"* ]]; then
if [[ "${{ matrix.rust }}" != "nightly-2023-08-24" ]]; then
mkdir -p -- "${HOME}"/{msp430-gcc,sparc-bcc-gcc,tsim}
# https://www.ti.com/tool/MSP430-GCC-OPENSOURCE
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-LlCjWuAbzH/9.3.1.2/msp430-gcc-9.3.1.11_linux64.tar.bz2 \
| tar xjf - --strip-components 1 -C "${HOME}"/msp430-gcc
printf '%s\n' "${HOME}"/msp430-gcc/bin >>"${GITHUB_PATH}"
# https://download.gaisler.com/anonftp/bcc2/bin/
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused https://download.gaisler.com/anonftp/bcc2/bin/bcc-2.3.1-gcc-sparc-linux64.tar.xz \
| tar xJf - --strip-components 1 -C "${HOME}"/sparc-bcc-gcc
printf '%s\n' "${HOME}"/sparc-bcc-gcc/bin >>"${GITHUB_PATH}"
# https://www.gaisler.com/products/tsim3
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused https://download.gaisler.com/products/TSIM3/bin/tsim-eval/tsim-eval-3.1.11.tar.gz \
| tar xzf - --strip-components 1 -C "${HOME}"/tsim
printf '%s\n' "${HOME}"/tsim/tsim/linux-x64 >>"${GITHUB_PATH}"
fi
# /~https://github.com/taiki-e/dockerfiles/pkgs/container/qemu-user
retry docker create --name qemu-user ghcr.io/taiki-e/qemu-user
mkdir -p -- qemu-user
docker cp -- qemu-user:/usr/bin qemu-user/bin
docker rm -f -- qemu-user >/dev/null
sudo mv -- qemu-user/bin/qemu-* /usr/bin/
rm -rf -- ./qemu-user
elif [[ "${{ matrix.rust }}" == "stable" ]]; then
retry espup install --targets esp32,esp32s2,esp32s3
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: rm -- tests/avr/rust-toolchain.toml
if: startsWith(matrix.rust, 'nightly-')
- run: tools/no-std.sh
- run: tools/build.sh +esp xtensa-esp32-none-elf xtensa-esp32s2-none-elf xtensa-esp32s3-none-elf
if: matrix.rust == 'stable'
- run: tools/build.sh +esp xtensa-esp32-none-elf xtensa-esp32s2-none-elf xtensa-esp32s3-none-elf
env:
TESTS: 1
if: matrix.rust == 'stable'
- run: tools/no-std.sh +esp xtensa-esp32-none-elf xtensa-esp32s2-none-elf xtensa-esp32s3-none-elf
if: matrix.rust == 'stable'
# valgrind:
# needs: tidy
# runs-on: ubuntu-latest
# timeout-minutes: 60
# steps:
# - uses: taiki-e/checkout-action@v1
# - uses: taiki-e/github-actions/install-rust@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
# # +cmpxchg16b
# - run: tools/test.sh valgrind -vv
# env:
# RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
# RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
# codegen:
# runs-on: ubuntu-latest
# timeout-minutes: 60
# permissions:
# contents: read
# pull-requests: write # for gh pr edit --add-assignee
# repository-projects: read # for gh pr edit --add-assignee
# steps:
# - uses: taiki-e/checkout-action@v1
# - uses: taiki-e/github-actions/install-rust@nightly
# - 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')
# - id: create-pull-request
# uses: peter-evans/create-pull-request@v7
# with:
# title: Update generated code
# body: |
# Auto-generated by CI using [create-pull-request](/~https://github.com/peter-evans/create-pull-request).
# branch: update-generated-code
# token: ${{ secrets.CREATE_PR_TOKEN }}
# if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
# - name: Notify PR author by assigning PR
# run: gh pr edit --add-assignee taiki-e "${PR_NUMBER:?}"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
# 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