Skip to content

Commit ee6f44c

Browse files
authored
Merge branch 'main' into initial-rtt-configurability
2 parents a72a8b8 + 3d0efa2 commit ee6f44c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+615
-539
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @KershawChang @martinthomson @larseggert
1+
* @KershawChang @martinthomson @larseggert @mxinden

.github/actions/nss/action.yml

+81-21
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
1-
name: Fetch and build NSS
2-
description: Fetch and build NSS
1+
name: Install NSS
2+
description: Install NSS
33

44
inputs:
55
type:
6-
description: "Whether to do a debug or release build of NSS"
6+
description: "When building, whether to do a debug or release build of NSS"
77
default: "Release"
8-
9-
# This step might be removed if the distro included a recent enough
10-
# version of NSS. Ubuntu 20.04 only has 3.49, which is far too old.
11-
# (neqo-crypto/build.rs would also need to query pkg-config to get the
12-
# right build flags rather than building NSS.)
13-
#
14-
# Also see https://github.com/mozilla/neqo/issues/1711
8+
minimum-version:
9+
description: "Minimum required version of NSS"
10+
required: true
1511

1612
runs:
1713
using: composite
1814
steps:
15+
- name: Install system NSS (Linux)
16+
shell: bash
17+
if: runner.os == 'Linux' && runner.environment == 'github-hosted'
18+
env:
19+
DEBIAN_FRONTEND: noninteractive
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install -y --no-install-recommends libnss3-dev pkg-config
23+
24+
- name: Install system NSS (MacOS)
25+
shell: bash
26+
if: runner.os == 'MacOS' && runner.environment == 'github-hosted'
27+
run: |
28+
brew update
29+
brew install nss
30+
1931
- name: Check system NSS version
20-
id: check
2132
shell: bash
2233
run: |
2334
if ! command -v pkg-config &> /dev/null; then
@@ -38,8 +49,8 @@ runs:
3849
fi
3950
NSS_MAJOR=$(echo "$NSS_VERSION" | cut -d. -f1)
4051
NSS_MINOR=$(echo "$NSS_VERSION" | cut -d. -f2)
41-
REQ_NSS_MAJOR=$(cut -d. -f1 < neqo-crypto/min_version.txt)
42-
REQ_NSS_MINOR=$(cut -d. -f2 < neqo-crypto/min_version.txt)
52+
REQ_NSS_MAJOR=$(echo "${{ inputs.minimum-version}}" | cut -d. -f1)
53+
REQ_NSS_MINOR=$(echo "${{ inputs.minimum-version}}" | cut -d. -f2)
4354
if [[ "$NSS_MAJOR" -lt "$REQ_NSS_MAJOR" || "$NSS_MAJOR" -eq "$REQ_NSS_MAJOR" && "$NSS_MINOR" -lt "$REQ_NSS_MINOR" ]]; then
4455
echo "System NSS is too old: $NSS_VERSION"
4556
echo "BUILD_NSS=1" >> "$GITHUB_ENV"
@@ -70,8 +81,59 @@ runs:
7081
id: cache-nss
7182
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
7283
with:
73-
path: ${{ github.workspace }}/dist
74-
key: nss-${{ runner.os }}-${{ runner.arch }}-${{ inputs.type }}-${{ hashFiles('nss/lib/nss/nss.h') }}
84+
path: |
85+
${{ github.workspace }}/dist
86+
${{ github.workspace }}/nss/out
87+
${{ github.workspace }}/nspr/Debug
88+
${{ github.workspace }}/nspr/Release
89+
key: nss-${{ runner.os }}-${{ runner.arch }}-${{ inputs.type }}-${{ hashFiles('nss/lib/nss/nss.h', 'nspr/pr/include/prinit.h') }}
90+
91+
- name: Install build dependencies (Linux)
92+
shell: bash
93+
if: runner.os == 'Linux' && env.BUILD_NSS == '1' && runner.environment == 'github-hosted'
94+
env:
95+
DEBIAN_FRONTEND: noninteractive
96+
run: sudo apt-get install -y --no-install-recommends git mercurial gyp ninja-build
97+
98+
- name: Install build dependencies (MacOS)
99+
shell: bash
100+
if: runner.os == 'MacOS' && env.BUILD_NSS == '1'
101+
run: |
102+
brew install mercurial ninja
103+
echo "gyp-next>=0.18.1" > req.txt
104+
python3 -m pip install --user --break-system-packages -r req.txt
105+
echo "$(python3 -m site --user-base)/bin" >> "$GITHUB_PATH"
106+
107+
- name: Install build dependencies (Windows)
108+
shell: bash
109+
if: runner.os == 'Windows' && env.BUILD_NSS == '1'
110+
run: |
111+
# shellcheck disable=SC2028
112+
{
113+
echo C:/msys64/usr/bin
114+
echo C:/msys64/mingw64/bin
115+
} >> "$GITHUB_PATH"
116+
/c/msys64/usr/bin/pacman -S --noconfirm python3-pip mercurial nsinstall
117+
echo "gyp-next>=0.18.1" > req.txt
118+
python3 -m pip install -r req.txt
119+
120+
- name: Set up MSVC (Windows)
121+
if: runner.os == 'Windows' && env.BUILD_NSS == '1'
122+
uses: ilammy/msvc-dev-cmd@v1
123+
# TODO: Would like to pin this, but the Mozilla org allowlist requires "ilammy/msvc-dev-cmd@v1*"
124+
# uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
125+
126+
- name: Set up build environment (Windows)
127+
shell: bash
128+
if: runner.os == 'Windows' && env.BUILD_NSS == '1'
129+
run: |
130+
{
131+
echo "GYP_MSVS_OVERRIDE_PATH=$VSINSTALLDIR"
132+
echo "GYP_MSVS_VERSION=2022"
133+
echo "BASH=$SHELL"
134+
} >> "$GITHUB_ENV"
135+
# See https://github.com/ilammy/msvc-dev-cmd#name-conflicts-with-shell-bash
136+
rm /usr/bin/link.exe || true
75137
76138
- name: Build
77139
shell: bash
@@ -82,20 +144,18 @@ runs:
82144
# we also want debug symbols and frame pointers for that, which the normal optimized NSS
83145
# build process doesn't provide.
84146
OPT="-o"
85-
NSS_TARGET=Release
86147
[ "${{ runner.os }}" != "Windows" ] && export CFLAGS="-ggdb3 -fno-omit-frame-pointer"
87-
else
88-
NSS_TARGET=Debug
89-
fi
90-
if [ "${{ steps.cache-nss.outputs.cache-hit }}" != "true" ]; then
91-
$NSS_DIR/build.sh -g -Ddisable_tests=1 $OPT --static
92148
fi
149+
NSS_TARGET="${{ inputs.type }}"
93150
echo "NSS_TARGET=$NSS_TARGET" >> "$GITHUB_ENV"
94151
NSS_OUT="$NSS_DIR/../dist/$NSS_TARGET"
95152
echo "LD_LIBRARY_PATH=$NSS_OUT/lib" >> "$GITHUB_ENV"
96153
echo "DYLD_FALLBACK_LIBRARY_PATH=$NSS_OUT/lib" >> "$GITHUB_ENV"
97154
echo "$NSS_OUT/lib" >> "$GITHUB_PATH"
98155
echo "NSS_DIR=$NSS_DIR" >> "$GITHUB_ENV"
156+
if [ "${{ steps.cache-nss.outputs.cache-hit }}" != "true" ]; then
157+
$NSS_DIR/build.sh -g -Ddisable_tests=1 $OPT --static
158+
fi
99159
env:
100160
NSS_DIR: ${{ github.workspace }}/nss
101161
NSPR_DIR: ${{ github.workspace }}/nspr

.github/actions/pr-comment-data-export/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ runs:
3131
echo "${{ inputs.log-url }}" > comment-data/log-url
3232
fi
3333
- if: github.event_name == 'pull_request'
34-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
34+
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
3535
with:
3636
name: ${{ inputs.name }}
3737
path: comment-data

.github/actions/quic-interop-runner/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ runs:
8383
done
8484
shell: bash
8585

86-
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
86+
- uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
8787
id: upload-logs
8888
with:
8989
name: '${{ inputs.client }} vs. ${{ inputs.server }} logs'
@@ -97,7 +97,7 @@ runs:
9797
mv result.json.tmp result.json
9898
shell: bash
9999

100-
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
100+
- uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
101101
with:
102102
name: '${{ inputs.client }} vs. ${{ inputs.server }} results'
103103
path: |

.github/actions/rust/action.yml

+24-5
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,45 @@ inputs:
88
components:
99
description: 'Rust components to install'
1010
default: ''
11+
tools:
12+
description: 'Additional Rust tools to install'
13+
default: ''
1114

1215
runs:
1316
using: composite
1417
steps:
18+
- name: Upgrade rustup (MacOS)
19+
shell: bash
20+
if: runner.os == 'MacOS'
21+
run: brew update && brew upgrade rustup
22+
1523
- name: Install Rust
16-
uses: dtolnay/rust-toolchain@bb45937a053e097f8591208d8e74c90db1873d07 # master
24+
uses: dtolnay/rust-toolchain@21dc36fb71dd22e3317045c0c31a3f4249868b17 # master
1725
with:
1826
toolchain: ${{ inputs.version }}
1927
components: ${{ inputs.components }}
2028

29+
- name: Set up MSVC (Windows)
30+
if: runner.os == 'Windows'
31+
uses: ilammy/msvc-dev-cmd@v1
32+
# TODO: Would like to pin this, but the Mozilla org allowlist requires "ilammy/msvc-dev-cmd@v1*"
33+
# uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
34+
35+
# See https://github.com/ilammy/msvc-dev-cmd#name-conflicts-with-shell-bash
36+
- name: Set up build environment (Windows)
37+
shell: bash
38+
if: runner.os == 'Windows'
39+
run: rm /usr/bin/link.exe || true
40+
2141
- name: Install cargo-quickinstall
2242
shell: bash
43+
if: inputs.tools != ''
2344
run: cargo +${{ inputs.version }} install cargo-quickinstall
2445

2546
- name: Install Rust tools
2647
shell: bash
27-
run: |
28-
cargo +${{ inputs.version }} quickinstall --no-binstall \
29-
cargo-llvm-cov cargo-nextest flamegraph cargo-hack cargo-mutants hyperfine \
30-
cargo-machete cargo-fuzz
48+
if: inputs.tools != ''
49+
run: cargo +${{ inputs.version }} quickinstall --no-binstall $(echo ${{ inputs.tools }} | tr -d ",")
3150

3251
# sccache slows CI down, so we leave it disabled.
3352
# Leaving the steps below commented out, so we can re-evaluate enabling it later.

.github/workflows/bench.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,16 @@ jobs:
4444
uses: ./.github/actions/rust
4545
with:
4646
version: $TOOLCHAIN
47-
components: rustfmt
47+
tools: hyperfine
4848

49-
- name: Fetch and build NSS and NSPR
49+
- name: Get minimum NSS version
50+
id: nss-version
51+
run: echo "minimum=$(cat neqo-crypto/min_version.txt)" >> "$GITHUB_OUTPUT"
52+
53+
- name: Install NSS
5054
uses: ./.github/actions/nss
55+
with:
56+
minimum-version: ${{ steps.nss-version.outputs.minimum }}
5157

5258
- name: Build neqo
5359
run: |
@@ -200,7 +206,7 @@ jobs:
200206
fi
201207
sed -E -e 's/^ //gi' \
202208
-e 's/((change|time|thrpt):[^%]*% )([^%]*%)(.*)/\1<b>\3<\/b>\4/gi' results.txt |\
203-
perl -p -0777 -e 's/(.*?)\n(.*?)((No change|Change within|Performance has).*?)(\nFound .*?)?\n\n/<details><summary>$1: $3<\/summary><pre>\n$2$5<\/pre><\/details>\n/gs' |\
209+
perl -p -0777 -e 's/(.*?)\n(.*?)(((No change|Change within|Performance has).*?)(\nFound .*?)?)?\n\n/<details><summary>$1: $4<\/summary><pre>\n$2$6<\/pre><\/details>\n/gs' |\
204210
sed -E -e 's/(Performance has regressed.)/:broken_heart: <b>\1<\/b>/gi' \
205211
-e 's/(Performance has improved.)/:green_heart: <b>\1<\/b>/gi' \
206212
-e 's/^ +((<\/pre>|Found).*)/\1/gi' \
@@ -231,7 +237,7 @@ jobs:
231237

232238
- name: Export perf data
233239
id: export
234-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
240+
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
235241
with:
236242
name: ${{ github.event.repository.name }}-${{ github.sha }}
237243
path: |

.github/workflows/check.yml

+10-47
Original file line numberDiff line numberDiff line change
@@ -45,60 +45,21 @@ jobs:
4545
- name: Checkout
4646
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4747

48-
- name: Install dependencies (Linux)
49-
if: runner.os == 'Linux'
50-
env:
51-
DEBIAN_FRONTEND: noninteractive
52-
run: |
53-
sudo apt-get install -y --no-install-recommends libnss3-dev pkg-config lld
54-
echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV"
55-
56-
- name: Install dependencies (MacOS)
57-
if: runner.os == 'MacOS'
58-
run: |
59-
brew update
60-
brew install llvm nss
61-
echo "/opt/homebrew/opt/llvm/bin" >> "$GITHUB_PATH"
62-
echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV"
63-
64-
- name: Install dependencies (Windows)
65-
if: runner.os == 'Windows'
66-
run: |
67-
# shellcheck disable=SC2028
68-
{
69-
echo C:/msys64/usr/bin
70-
echo C:/msys64/mingw64/bin
71-
} >> "$GITHUB_PATH"
72-
/c/msys64/usr/bin/pacman -S --noconfirm nsinstall
73-
echo "gyp-next==0.15.0 --hash=sha256:3600f2a80fa33d3574f51bbb3d4bfc843373dafbe84059958aea3f1c9560f95a" > requirements.txt
74-
python3 -m pip install --require-hashes -r requirements.txt
75-
echo "$(python3 -m site --user-base)/bin" >> "$GITHUB_PATH"
76-
77-
- name: Set up MSVC build environment (Windows)
78-
if: runner.os == 'Windows'
79-
uses: ilammy/msvc-dev-cmd@v1
80-
# TODO: Would like to pin this, but the Mozilla org allowlist requires "ilammy/msvc-dev-cmd@v1*"
81-
# uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
82-
83-
- name: Set up NSS/NSPR build environment (Windows)
84-
if: runner.os == 'Windows'
85-
run: |
86-
{
87-
echo "GYP_MSVS_OVERRIDE_PATH=$VSINSTALLDIR"
88-
echo "GYP_MSVS_VERSION=2022"
89-
echo "BASH=$SHELL"
90-
} >> "$GITHUB_ENV"
91-
# See https://github.com/ilammy/msvc-dev-cmd#name-conflicts-with-shell-bash
92-
rm /usr/bin/link.exe
93-
9448
- name: Install Rust
9549
uses: ./.github/actions/rust
9650
with:
9751
version: ${{ matrix.rust-toolchain }}
9852
components: rustfmt, clippy, llvm-tools-preview
53+
tools: cargo-llvm-cov, cargo-nextest, cargo-hack, cargo-fuzz, cargo-machete
54+
55+
- name: Get minimum NSS version
56+
id: nss-version
57+
run: echo "minimum=$(cat neqo-crypto/min_version.txt)" >> "$GITHUB_OUTPUT"
9958

100-
- name: Fetch and build NSS and NSPR
59+
- name: Install NSS
10160
uses: ./.github/actions/nss
61+
with:
62+
minimum-version: ${{ steps.nss-version.outputs.minimum }}
10263

10364
- name: Build
10465
run: |
@@ -168,6 +129,8 @@ jobs:
168129
fail_ci_if_error: false
169130
token: ${{ secrets.CODECOV_TOKEN }}
170131
verbose: true
132+
env:
133+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
171134
if: matrix.type == 'debug' && matrix.rust-toolchain == 'stable'
172135

173136
bench:

.github/workflows/firefox.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
114114
- name: Export binary
115115
id: upload
116-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
116+
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
117117
with:
118118
name: ${{ runner.os }}-${{ env.FIREFOX }}-${{ matrix.type }}.tgz
119119
path: ${{ env.FIREFOX }}.tar
@@ -122,7 +122,7 @@ jobs:
122122
- run: echo "${{ steps.upload.outputs.artifact-url }}" >> artifact
123123

124124
- name: Export artifact URL
125-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
125+
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
126126
with:
127127
name: artifact-${{ runner.os }}-${{ env.FIREFOX }}-${{ matrix.type }}
128128
path: artifact

.github/workflows/mutants.yml

+8-9
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,19 @@ jobs:
2222
with:
2323
fetch-depth: 0
2424

25-
- name: Install dependencies
26-
env:
27-
DEBIAN_FRONTEND: noninteractive
28-
run: |
29-
sudo apt-get install -y --no-install-recommends libnss3-dev pkg-config lld
30-
echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV"
25+
- name: Get minimum NSS version
26+
id: nss-version
27+
run: echo "minimum=$(cat neqo-crypto/min_version.txt)" >> "$GITHUB_OUTPUT"
3128

32-
- name: Fetch and build NSS and NSPR
29+
- name: Install NSS
3330
uses: ./.github/actions/nss
31+
with:
32+
minimum-version: ${{ steps.nss-version.outputs.minimum }}
3433

3534
- name: Install Rust
3635
uses: ./.github/actions/rust
3736
with:
38-
version: stable
37+
tools: cargo-mutants
3938

4039
- name: Find incremental mutants
4140
if: github.event_name == 'pull_request'
@@ -64,7 +63,7 @@ jobs:
6463
} > "$GITHUB_STEP_SUMMARY"
6564
6665
- name: Archive mutants.out
67-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
66+
uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
6867
if: always()
6968
with:
7069
name: mutants.out

0 commit comments

Comments
 (0)