Skip to content

Commit

Permalink
Debug MacOS intermittent CI failure (mozilla#1528)
Browse files Browse the repository at this point in the history
* Debug MacOS intermittent CI failure

* DYLD_PRINT_LIBRARIES=true

* More testing

* Again

* Potential fix

* Fix conditional

* Different try

* Try harder

* Try

* DYLD_FALLBACK_LIBRARY_PATH

* More

* env

* cp

* ls

* cp

* sudo

* local

* No sudo

* sudo needed

* Tweaks

* Debug DYLD

* Fix

* Try canary

* Again

* Again

* Not yet

* DYLD_FALLBACK_LIBRARY_PATH

* Add comment

* Properly skip

* grep

* Reword comment

* true

* Use filter expression

* Expr

* Fix filter

* Update .github/workflows/check.yml

Co-authored-by: Martin Thomson <[email protected]>

* csrutil status

* System Integrity Protection status: enabled.

* 113

* Simplify

* Fix

* x

* Finalize

* Good to go?

---------

Co-authored-by: Martin Thomson <[email protected]>
  • Loading branch information
larseggert and martinthomson authored Jan 3, 2024
1 parent eb75aef commit 096c46b
Showing 1 changed file with 16 additions and 26 deletions.
42 changes: 16 additions & 26 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,17 @@ on:
paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
check:
name: Build & test
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
rust-toolchain: [1.70.0, stable]
ignore_clippy_errors: [false]
# Add beta toolchain, but don't fail CI on clippy errors.
include:
- os: ubuntu
rust-toolchain: beta
ignore_clippy_errors: true
- os: macos
rust-toolchain: beta
ignore_clippy_errors: true
- os: windows
rust-toolchain: beta
ignore_clippy_errors: true
runs-on: ${{ matrix.os }}-latest
os: [ubuntu-latest, macos-13, windows-latest]
rust-toolchain: [1.70.0, stable, beta]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
Expand All @@ -49,9 +38,15 @@ jobs:
sudo apt-get install -y --no-install-recommends gyp mercurial ninja-build
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
# In addition to installing dependencies, first make sure System Integrity Protection (SIP)
# is disabled on this MacOS runner. This is needed to allow the NSS libraries to be loaded
# from the build directory and avoid various other test failures. This seems to always be
# the case on any macos-13 runner, but not consistently on macos-latest (which is currently
# macos-12, FWIW).
- name: Install dependencies (MacOS)
if: runner.os == 'MacOS'
run: |
csrutil status | grep disabled
brew install ninja mercurial cargo-binstall
# python3 -m pip install gyp-next
# Above does not work, since pypi only has gyp 0.15.0, which is too old
Expand All @@ -74,12 +69,12 @@ jobs:
python3 -m pip install git+https://github.com/nodejs/gyp-next
echo "$(python3 -m site --user-base)/bin" >> "$GITHUB_PATH"
- name: Set up Windows build environment
- name: Set up MSVC build environment (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

- name: Install Rust tools
run: cargo +${{ matrix.rust-toolchain }} binstall --no-confirm cargo-llvm-cov
run: cargo +${{ matrix.rust-toolchain }} binstall --no-confirm cargo-llvm-cov cargo-nextest

- name: Checkout
uses: actions/checkout@v4
Expand All @@ -98,7 +93,7 @@ jobs:
NSS_DIR: ${{ github.workspace }}/nss
NSPR_DIR: ${{ github.workspace }}/nspr

- name: Set up environment for NSS build.sh (Windows)
- name: Set up NSS/NSPR build environment (Windows)
if: runner.os == 'Windows'
run: |
echo "GYP_MSVS_OVERRIDE_PATH=$VSINSTALLDIR" >> "$GITHUB_ENV"
Expand All @@ -111,16 +106,11 @@ jobs:
run: |
cargo +${{ matrix.rust-toolchain }} build -v --all-targets
echo "LD_LIBRARY_PATH=${{ github.workspace }}/dist/Debug/lib" >> "$GITHUB_ENV"
echo "DYLD_LIBRARY_PATH=${{ github.workspace }}/dist/Debug/lib" >> "$GITHUB_ENV"
echo "DYLD_FALLBACK_LIBRARY_PATH=${{ github.workspace }}/dist/Debug/lib" >> "$GITHUB_ENV"
echo "${{ github.workspace }}/dist/Debug/lib" >> "$GITHUB_PATH"
env:
RUST_BACKTRACE: 1
- name: Run tests and determine coverage
run: cargo +${{ matrix.rust-toolchain }} llvm-cov test --features ci --all-targets --no-fail-fast --lcov --output-path lcov.info
env:
RUST_BACKTRACE: 1
RUST_LOG: neqo=debug
run: cargo +${{ matrix.rust-toolchain }} llvm-cov nextest --features ci --all-targets --no-fail-fast --lcov --output-path lcov.info

- name: Check formatting
run: cargo +${{ matrix.rust-toolchain }} fmt --all -- --check
Expand All @@ -129,7 +119,7 @@ jobs:
- name: Clippy
run: cargo +${{ matrix.rust-toolchain }} clippy -v --tests -- -D warnings
if: success() || failure()
continue-on-error: ${{ matrix.ignore_clippy_errors }}
continue-on-error: ${{ matrix.rust-toolchain == 'beta' }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down

0 comments on commit 096c46b

Please sign in to comment.