From 012e715faccdef31adabe75e6ca5328d40287a7d Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 13 Mar 2024 10:33:27 +0200 Subject: [PATCH] Update CI --- .github/actions/nss/action.yml | 68 ---------------------------------- .github/workflows/bench.yml | 3 -- .github/workflows/check.yml | 41 ++------------------ 3 files changed, 3 insertions(+), 109 deletions(-) delete mode 100644 .github/actions/nss/action.yml diff --git a/.github/actions/nss/action.yml b/.github/actions/nss/action.yml deleted file mode 100644 index 23232ebc13..0000000000 --- a/.github/actions/nss/action.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Fetch and build NSS -description: Fetch and build NSS - -inputs: - type: - description: "Whether to do a debug or release build of NSS" - default: "Release" - -# This step might be removed if the distro included a recent enough -# version of NSS. Ubuntu 20.04 only has 3.49, which is far too old. -# (neqo-crypto/build.rs would also need to query pkg-config to get the -# right build flags rather than building NSS.) -# -# Also see https://github.com/mozilla/neqo/issues/1711 - -runs: - using: composite - steps: - # Ideally, we'd use this. But things are sufficiently flaky that we're better off - # trying both hg and git. Leaving this here in case we want to re-try in the future. - # - # - name: Checkout NSPR - # uses: actions/checkout@v4 - # with: - # repository: "nss-dev/nspr" - # path: ${{ github.workspace }}/nspr - - # - name: Checkout NSS - # uses: actions/checkout@v4 - # with: - # repository: "nss-dev/nss" - # path: ${{ github.workspace }}/nss - - - name: Checkout NSPR - shell: bash - run: | - hg clone https://hg.mozilla.org/projects/nspr "${{ github.workspace }}/nspr" || \ - git clone --depth=1 https://github.com/nss-dev/nspr "${{ github.workspace }}/nspr" - - - name: Checkout NSS - shell: bash - run: | - hg clone https://hg.mozilla.org/projects/nss "${{ github.workspace }}/nss" || \ - git clone --depth=1 https://github.com/nss-dev/nss "${{ github.workspace }}/nss" - - - name: Build - shell: bash - run: | - if [ "${{ inputs.type }}" != "Debug" ]; then - # We want to do an optimized build for accurate CPU profiling, but - # we also want debug symbols and frame pointers for that, which the normal optimized NSS - # build process doesn't provide. - OPT="-o" - NSS_TARGET=Release - [ "${{ runner.os }}" != "Windows" ] && export CFLAGS="-ggdb3 -fno-omit-frame-pointer" - else - NSS_TARGET=Debug - fi - $NSS_DIR/build.sh -g -Ddisable_tests=1 $OPT --static - echo "NSS_TARGET=$NSS_TARGET" >> "$GITHUB_ENV" - NSS_OUT="$NSS_DIR/../dist/$NSS_TARGET" - echo "LD_LIBRARY_PATH=$NSS_OUT/lib" >> "$GITHUB_ENV" - echo "DYLD_FALLBACK_LIBRARY_PATH=$NSS_OUT/lib" >> "$GITHUB_ENV" - echo "$NSS_OUT/lib" >> "$GITHUB_PATH" - echo "NSS_DIR=$NSS_DIR" >> "$GITHUB_ENV" - env: - NSS_DIR: ${{ github.workspace }}/nss - NSPR_DIR: ${{ github.workspace }}/nspr diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 7c7f812341..5b7986226b 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -32,9 +32,6 @@ jobs: version: $TOOLCHAIN components: rustfmt - - name: Fetch and build NSS and NSPR - uses: ./.github/actions/nss - - name: Build run: | cargo "+$TOOLCHAIN" bench --features bench --no-run diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 10085ffda6..1ab105ead3 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -46,65 +46,30 @@ jobs: env: DEBIAN_FRONTEND: noninteractive run: | - sudo apt-get install -y --no-install-recommends gyp mercurial ninja-build lld + sudo apt-get install -y --no-install-recommends lld libnss3-dev echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV" - # 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 llvm + brew install llvm nss echo "/opt/homebrew/opt/llvm/bin" >> "$GITHUB_PATH" - ln -s /opt/homebrew/bin/python3 /opt/homebrew/bin/python - # python3 -m pip install gyp-next - # Above does not work, since pypi only has gyp 0.15.0, which is too old - # for the homebrew python3. Install from source instead. - python3 -m pip install git+https://github.com/nodejs/gyp-next - python3 -m pip install packaging - echo "$(python3 -m site --user-base)/bin" >> "$GITHUB_PATH" echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV" - name: Use MSYS2 environment and install more dependencies (Windows) if: runner.os == 'Windows' - run: | - # shellcheck disable=SC2028 - { - echo "C:\\msys64\\usr\\bin" - echo "C:\\msys64\\mingw64\\bin" - } >> "$GITHUB_PATH" - /c/msys64/usr/bin/pacman -S --noconfirm nsinstall - python3 -m pip install git+https://github.com/nodejs/gyp-next - echo "$(python3 -m site --user-base)/bin" >> "$GITHUB_PATH" + run: /c/msys64/usr/bin/pacman -S --noconfirm nss - name: Set up MSVC build environment (Windows) if: runner.os == 'Windows' uses: ilammy/msvc-dev-cmd@v1 - - name: Set up NSS/NSPR build environment (Windows) - if: runner.os == 'Windows' - run: | - { - echo "GYP_MSVS_OVERRIDE_PATH=$VSINSTALLDIR" - echo "GYP_MSVS_VERSION=2022" - echo "BASH=$SHELL" - } >> "$GITHUB_ENV" - # See https://github.com/ilammy/msvc-dev-cmd#name-conflicts-with-shell-bash - rm /usr/bin/link.exe - - name: Install Rust uses: ./.github/actions/rust with: version: ${{ matrix.rust-toolchain }} components: rustfmt, clippy, llvm-tools-preview - - name: Fetch and build NSS and NSPR - uses: ./.github/actions/nss - - name: Build run: | # shellcheck disable=SC2086