From 74eeb22ad22e19e621e1c6d4c9296455d7590efa Mon Sep 17 00:00:00 2001 From: Tobias Naumann Date: Thu, 20 Jul 2023 13:21:41 +0200 Subject: [PATCH] Build for thumbv7em-none-eabihf as a no_std target to check that build succeed without std support --- .github/workflows/test.yml | 11 ++++++++++- ct.sh | 13 ++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9024b2c47..51d445427 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,9 @@ jobs: - rust: stable target: x86_64-fortanix-unknown-sgx os: ubuntu-20.04 + - rust: stable + target: thumbv7em-none-eabihf + os: ubuntu-20.04 - rust: beta target: x86_64-unknown-linux-gnu os: ubuntu-20.04 @@ -48,12 +51,18 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install dependencies + - name: Install qemu for aarch64-unknown-linux-musl if: matrix.target == 'aarch64-unknown-linux-musl' run: | sudo apt-get update sudo apt-get install -y qemu-user + - name: Install arm-none-eabi-gcc toolchain for thumbv7em-none-eabihf + if: matrix.target == 'thumbv7em-none-eabihf' + run: | + sudo apt-get update + sudo apt-get install -y gcc-arm-none-eabi + - name: Setup Rust toolchain uses: actions-rs/toolchain@v1 with: diff --git a/ct.sh b/ct.sh index bda77d8c8..111bc9f96 100755 --- a/ct.sh +++ b/ct.sh @@ -87,8 +87,14 @@ if [ "$TRAVIS_RUST_VERSION" == "stable" ] || [ "$TRAVIS_RUST_VERSION" == "beta" rustup target add --toolchain $TRAVIS_RUST_VERSION $TARGET printenv - # The SGX target cannot be run under test like a ELF binary - if [ "$TARGET" != "x86_64-fortanix-unknown-sgx" ]; then + if [ "$TARGET" == "x86_64-fortanix-unknown-sgx" ]; then + # The SGX target cannot be run under test like a ELF binary + cargo +$TRAVIS_RUST_VERSION test --no-run --target=$TARGET + cargo +$TRAVIS_RUST_VERSION test --no-default-features --features dsa,force_aesni_support,mpi_force_c_code,rdrand,std,time,tls13 --no-run --target=$TARGET + elif [ "$TARGET" == "thumbv7em-none-eabihf" ]; then + # thumbv7em-none-eabihf is a no_std target, the tests can not be run, we can only check that it builds successfully + cargo build --no-default-features --features no_std_deps --target $TARGET + else # make sure that explicitly providing the default target works cargo nextest run --target $TARGET --release cargo nextest run --features dsa --target $TARGET @@ -107,9 +113,6 @@ if [ "$TRAVIS_RUST_VERSION" == "stable" ] || [ "$TRAVIS_RUST_VERSION" == "beta" if [ "$TARGET" == "x86_64-apple-darwin" ]; then cargo nextest run --no-default-features --features no_std_deps --target $TARGET fi - else - cargo +$TRAVIS_RUST_VERSION test --no-run --target=$TARGET - cargo +$TRAVIS_RUST_VERSION test --no-default-features --features dsa,force_aesni_support,mpi_force_c_code,rdrand,std,time,tls13 --no-run --target=$TARGET fi else