-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert many things, keep building NSS from source unless system versi…
…on is OK
- Loading branch information
1 parent
ac5c166
commit bbcaaf5
Showing
5 changed files
with
169 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
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: | ||
- name: Check system NSS version | ||
shell: bash | ||
run: | | ||
if ! command -v pkg-config &> /dev/null; then | ||
echo "BUILD_NSS=1" >> "$GITHUB_ENV | ||
exit 0 | ||
fi | ||
NSS_VERSION=$(pkg-config --modversion nss) | ||
NSS_MAJOR=$(echo $NSS_VERSION | cut -d. -f1) | ||
NSS_MINOR=$(echo $NSS_VERSION | cut -d. -f2) | ||
if [ $NSS_MAJOR -ne 3 ] || [ $NSS_MINOR -lt 98 ]; then | ||
echo "System NSS is too old: $NSS_VERSION" | ||
echo "BUILD_NSS=1" >> "$GITHUB_ENV | ||
else | ||
echo "System NSS is suitable: $NSS_VERSION" | ||
echo "BUILD_NSS=0" >> "$GITHUB_ENV | ||
fi | ||
# 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 | ||
# if: env.BUILD_NSS | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# repository: "nss-dev/nspr" | ||
# path: ${{ github.workspace }}/nspr | ||
|
||
# - name: Checkout NSS | ||
# if: env.BUILD_NSS | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# repository: "nss-dev/nss" | ||
# path: ${{ github.workspace }}/nss | ||
|
||
- name: Checkout NSPR | ||
shell: bash | ||
if: env.BUILD_NSS | ||
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 | ||
if: env.BUILD_NSS | ||
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 | ||
if: env.BUILD_NSS | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters