From e814ca51d9d97583d2fde633c8c0ed6f10e608b3 Mon Sep 17 00:00:00 2001 From: Erik Everson <32311723+ErikEverson@users.noreply.github.com> Date: Tue, 20 Feb 2024 15:36:10 -0700 Subject: [PATCH] Added tvos-sim support (#951) --- .github/workflows/main.yml | 37 ++++++++++++++++++++++++++++--------- src/lib.rs | 2 +- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3695332f..653c6d12 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -95,23 +95,42 @@ jobs: - run: cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --release - run: cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --features parallel - # This is separate from the matrix above because there is no prebuilt rust-std component for the target. + # This is separate from the matrix above because there is no prebuilt rust-std component for these targets. check-tvos: - name: Test aarch64-apple-tvos - runs-on: macos-latest + name: Test build-std + runs-on: ${{ matrix.os }} + strategy: + matrix: + build: [aarch64-tvos, aarch64-tvos-sim, x86_64-tvos] + include: + - build: aarch64-tvos + os: macos-latest + rust: nightly + target: aarch64-apple-tvos + no_run: --no-run + - build: aarch64-tvos-sim + os: macos-latest + rust: nightly + target: aarch64-apple-tvos-sim + no_run: --no-run + - build: x86_64-tvos + os: macos-latest + rust: nightly + target: x86_64-apple-tvos + no_run: --no-run steps: - uses: actions/checkout@v4 - name: Install Rust (rustup) run: | set -euxo pipefail - rustup toolchain install nightly --no-self-update --profile minimal - rustup component add rust-src --toolchain nightly - rustup default nightly + rustup toolchain install ${{ matrix.rust }} --no-self-update --profile minimal + rustup component add rust-src --toolchain ${{ matrix.rust }} + rustup default ${{ matrix.rust }} shell: bash - uses: Swatinem/rust-cache@v2 - - run: cargo test -Z build-std=std --no-run --workspace --target aarch64-apple-tvos - - run: cargo test -Z build-std=std --no-run --workspace --target aarch64-apple-tvos --release - - run: cargo test -Z build-std=std --no-run --workspace --target aarch64-apple-tvos --features parallel + - run: cargo test -Z build-std=std ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} + - run: cargo test -Z build-std=std ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --release + - run: cargo test -Z build-std=std ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --features parallel cuda: name: Test CUDA support diff --git a/src/lib.rs b/src/lib.rs index 6c45aa06..edb941b2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1929,7 +1929,7 @@ impl Build { .into(), ); } - } else if target.contains("x86_64-apple-tvos") { + } else if target.contains("tvos-sim") || target.contains("x86_64-apple-tvos") { if let Some(arch) = map_darwin_target_from_rust_to_compiler_architecture(target) {