|
41 | 41 | with: |
42 | 42 | env-vars: "RUST_TOOLCHAIN=${{ matrix.toolchain }}" |
43 | 43 | key: ${{ matrix.os }}-${{ matrix.toolchain }} |
44 | | - # https://github.com/rust-lang/cmake-rs/pull/259 breaks handling of long Windows paths |
45 | | - # https://github.com/cloudflare/boring/issues/414 |
46 | | - # https://github.com/0x676e67/boring/commit/efacedb5bf409d0d773e8ce4f5080cb4b4c10f54 |
47 | | - - name: Pin some dependencies, temporary patch for cmake breakage |
48 | | - if: startsWith(matrix.os, 'windows') |
49 | | - run: | |
50 | | - cargo update --package cmake --precise 0.1.54 |
51 | 44 | - name: check |
52 | 45 | run: | |
53 | 46 | cargo check --workspace --all-targets --all-features |
|
89 | 82 | with: |
90 | 83 | env-vars: "RUST_TOOLCHAIN=${{ matrix.toolchain }}" |
91 | 84 | key: ${{ matrix.os }}-${{ matrix.toolchain }} |
92 | | - # https://github.com/rust-lang/cmake-rs/pull/259 breaks handling of long Windows paths |
93 | | - # https://github.com/cloudflare/boring/issues/414 |
94 | | - # https://github.com/0x676e67/boring/commit/efacedb5bf409d0d773e8ce4f5080cb4b4c10f54 |
95 | | - - name: Pin some dependencies, temporary patch for cmake breakage |
96 | | - if: startsWith(matrix.os, 'windows') |
97 | | - run: | |
98 | | - cargo update --package cmake --precise 0.1.54 |
99 | 85 | - name: clippy |
100 | 86 | run: | |
101 | 87 | cargo clippy --workspace --all-targets --all-features |
@@ -142,13 +128,6 @@ jobs: |
142 | 128 | with: |
143 | 129 | key: ${{ matrix.os }}-${{ matrix.toolchain }}-${{ matrix.target }} |
144 | 130 | env-vars: "RUST_TOOLCHAIN=${{ matrix.toolchain }}" |
145 | | - # https://github.com/rust-lang/cmake-rs/pull/259 breaks handling of long Windows paths |
146 | | - # https://github.com/cloudflare/boring/issues/414 |
147 | | - # https://github.com/0x676e67/boring/commit/efacedb5bf409d0d773e8ce4f5080cb4b4c10f54 |
148 | | - - name: Pin some dependencies, temporary patch for cmake breakage |
149 | | - if: startsWith(matrix.os, 'windows') |
150 | | - run: | |
151 | | - cargo update --package cmake --precise 0.1.54 |
152 | 131 | - name: Run tests (cargo test) |
153 | 132 | run: cargo nextest run --all-features --workspace |
154 | 133 | - name: Run doc tests (cargo test) |
@@ -308,34 +287,39 @@ jobs: |
308 | 287 | env-vars: "RUST_TOOLCHAIN=${{ matrix.rust }}" |
309 | 288 | key: ${{ matrix.os }}-${{ matrix.rust }}-${{ matrix.target }} |
310 | 289 | - run: rustup target add ${{ matrix.target }} |
311 | | - - name: Setup Android NDK |
312 | | - if: endsWith(matrix.thing, '-android') |
313 | | - uses: nttld/setup-ndk@v1 |
314 | | - with: |
315 | | - ndk-version: r26d |
316 | 290 | - name: Configure Android toolchain env |
317 | 291 | if: endsWith(matrix.thing, '-android') |
318 | 292 | shell: bash |
319 | 293 | run: | |
320 | 294 | ANDROID_API=21 |
| 295 | +
|
| 296 | + # Normalize NDK env vars |
| 297 | + echo "ANDROID_NDK_HOME=${ANDROID_NDK_HOME:-$ANDROID_NDK}" >> "$GITHUB_ENV" |
| 298 | + echo "ANDROID_NDK=${ANDROID_NDK:-$ANDROID_NDK_HOME}" >> "$GITHUB_ENV" |
| 299 | +
|
321 | 300 | TOOLCHAIN="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin" |
322 | 301 | echo "${TOOLCHAIN}" >> "$GITHUB_PATH" |
323 | 302 |
|
324 | 303 | TRIPLE="${{ matrix.target }}" |
325 | | -
|
326 | | - # What Cargo expects for the linker env var name |
327 | 304 | TARGET_UPPER="$(echo "${TRIPLE}" | tr '[:lower:]-' '[:upper:]_')" |
328 | | -
|
329 | | - # What cc-rs expects for CC_*/CXX_* env var names |
330 | 305 | TARGET_LOWER_UNDERSCORES="$(echo "${TRIPLE}" | tr '-' '_' | tr '[:upper:]' '[:lower:]')" |
331 | | -
|
332 | | - # What the NDK clang wrapper is called |
333 | 306 | NDK_TRIPLE="$(echo "${TRIPLE}" | sed 's/^armv7/armv7a/')" |
334 | 307 |
|
335 | | - echo "CARGO_TARGET_${TARGET_UPPER}_LINKER=${TOOLCHAIN}/${NDK_TRIPLE}${ANDROID_API}-clang++" >> "$GITHUB_ENV" |
336 | | - echo "CC_${TARGET_LOWER_UNDERSCORES}=${TOOLCHAIN}/${NDK_TRIPLE}${ANDROID_API}-clang" >> "$GITHUB_ENV" |
337 | | - echo "CXX_${TARGET_LOWER_UNDERSCORES}=${TOOLCHAIN}/${NDK_TRIPLE}${ANDROID_API}-clang++" >> "$GITHUB_ENV" |
338 | | - echo "AR_${TARGET_LOWER_UNDERSCORES}=${TOOLCHAIN}/llvm-ar" >> "$GITHUB_ENV" |
| 308 | + CC_PATH="${TOOLCHAIN}/${NDK_TRIPLE}${ANDROID_API}-clang" |
| 309 | + CXX_PATH="${TOOLCHAIN}/${NDK_TRIPLE}${ANDROID_API}-clang++" |
| 310 | + AR_PATH="${TOOLCHAIN}/llvm-ar" |
| 311 | +
|
| 312 | + echo "CARGO_TARGET_${TARGET_UPPER}_LINKER=${CXX_PATH}" >> "$GITHUB_ENV" |
| 313 | +
|
| 314 | + # Target specific for cc-rs style |
| 315 | + echo "CC_${TARGET_LOWER_UNDERSCORES}=${CC_PATH}" >> "$GITHUB_ENV" |
| 316 | + echo "CXX_${TARGET_LOWER_UNDERSCORES}=${CXX_PATH}" >> "$GITHUB_ENV" |
| 317 | + echo "AR_${TARGET_LOWER_UNDERSCORES}=${AR_PATH}" >> "$GITHUB_ENV" |
| 318 | +
|
| 319 | + # Also set generic vars in case your Config only reads CC/CXX/AR |
| 320 | + echo "CC=${CC_PATH}" >> "$GITHUB_ENV" |
| 321 | + echo "CXX=${CXX_PATH}" >> "$GITHUB_ENV" |
| 322 | + echo "AR=${AR_PATH}" >> "$GITHUB_ENV" |
339 | 323 | - name: check |
340 | 324 | env: ${{ matrix.custom_env }} |
341 | 325 | run: | |
@@ -415,13 +399,6 @@ jobs: |
415 | 399 | with: |
416 | 400 | key: ${{ matrix.os }}-${{ matrix.toolchain }} |
417 | 401 | env-vars: "RUST_TOOLCHAIN=${{ matrix.toolchain }}" |
418 | | - # https://github.com/rust-lang/cmake-rs/pull/259 breaks handling of long Windows paths |
419 | | - # https://github.com/cloudflare/boring/issues/414 |
420 | | - # https://github.com/0x676e67/boring/commit/efacedb5bf409d0d773e8ce4f5080cb4b4c10f54 |
421 | | - - name: Pin some dependencies, temporary patch for cmake breakage |
422 | | - if: startsWith(matrix.os, 'windows') |
423 | | - run: | |
424 | | - cargo update --package cmake --precise 0.1.54 |
425 | 402 | - name: Run tests (--ignored) |
426 | 403 | run: | |
427 | 404 | cargo nextest run --all-features --workspace --run-ignored=only |
@@ -454,13 +431,6 @@ jobs: |
454 | 431 | with: |
455 | 432 | key: ${{ matrix.os }}-${{ matrix.toolchain }} |
456 | 433 | env-vars: "RUST_TOOLCHAIN=${{ matrix.toolchain }}" |
457 | | - # https://github.com/rust-lang/cmake-rs/pull/259 breaks handling of long Windows paths |
458 | | - # https://github.com/cloudflare/boring/issues/414 |
459 | | - # https://github.com/0x676e67/boring/commit/efacedb5bf409d0d773e8ce4f5080cb4b4c10f54 |
460 | | - - name: Pin some dependencies, temporary patch for cmake breakage |
461 | | - if: startsWith(matrix.os, 'windows') |
462 | | - run: | |
463 | | - cargo update --package cmake --precise 0.1.54 |
464 | 434 | - name: Run tests in release mode (--ignored) |
465 | 435 | run: | |
466 | 436 | cargo nextest run --all-features --release --workspace --run-ignored=only |
|
0 commit comments