Skip to content

Commit 0eaaf2c

Browse files
committed
Merge branch 'main' into fix/3641-neqo-ack-32-range-limit
2 parents 05b05c5 + 9f9c801 commit 0eaaf2c

212 files changed

Lines changed: 10681 additions & 7681 deletions

File tree

Some content is hidden

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

‎.clippy.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ allow-unwrap-in-tests = true
1010
allow-dbg-in-tests = true
1111
avoid-breaking-exported-api = false # We have one consumer and can afford to break the API.
1212
pass-by-value-size-limit = 32
13-
doc-valid-idents = ["HyStart", "CHokepoint", ".."]
13+
doc-valid-idents = ["HyStart", "CHokepoint", "CodSpeed", ".."]

‎.github/CODEOWNERS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* @KershawChang @martinthomson @larseggert @mxinden
2+
/neqo-transport/ @omansfeld @KershawChang @martinthomson @larseggert @mxinden

‎.github/actionlint.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
self-hosted-runner:
33
# Labels of self-hosted runner in array of strings.
44
labels:
5-
- moonshot
6-
- moonshot-exp
7-
- codspeed-macro
5+
- codspeed-macro-x86-ryzen-9950x-ubuntu-24-04
6+
7+
# actionlint 1.7.12 does not know the `$/` syntax, see https://github.com/rhysd/actionlint/issues/711
8+
paths:
9+
.github/workflows/**/*.{yml,yaml}:
10+
ignore:
11+
- 'specifying action "\$/[^"]+" in invalid format because ref is missing'
12+
- 'reusable workflow call "\$/[^"]+" at "uses" is not following the format'
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Prepare machine for benchmarks
2+
description: >
3+
Widen the loopback MTU, install the debug symbols samply needs, and report which CPUs to
4+
pin benchmarks to. The runners already set the governor, disable SMT and turbo, relax the
5+
perf restrictions, and reserve an isolated CPU die. Each job gets its own runner, so
6+
nothing has to be restored afterwards.
7+
8+
inputs:
9+
mtu:
10+
description: MTU to set on the loopback interface
11+
default: ""
12+
13+
outputs:
14+
server-cpu:
15+
description: CPU to pin the server to
16+
value: ${{ steps.machine.outputs.server-cpu }}
17+
client-cpu:
18+
description: CPU to pin the client to
19+
value: ${{ steps.machine.outputs.client-cpu }}
20+
bench-cpus:
21+
description: Both CPUs, for benchmarks that serve from a thread of their own
22+
value: ${{ steps.machine.outputs.bench-cpus }}
23+
24+
runs:
25+
using: composite
26+
steps:
27+
- id: machine
28+
shell: bash
29+
env:
30+
MTU: ${{ inputs.mtu }}
31+
run: |
32+
# The runner's hostname does not resolve, which makes `sudo` warn on every call.
33+
grep -qw "$(hostname)" /etc/hosts ||
34+
echo "127.0.0.1 $(hostname)" | sudo tee -a /etc/hosts > /dev/null
35+
36+
[ -z "$MTU" ] || sudo ip link set dev lo mtu "$MTU"
37+
38+
# `libc6-dbg` lets samply symbolicate libc frames.
39+
[ "$APT_UPDATED" ] || sudo apt-get update && echo "APT_UPDATED=1" >> "$GITHUB_ENV"
40+
sudo apt-get install -y --no-install-recommends libc6-dbg
41+
42+
ALLOWED=$(sed -n 's/^Cpus_allowed_list:[[:space:]]*//p' /proc/self/status)
43+
CPUS=()
44+
for RANGE in ${ALLOWED//,/ }; do # A bare CPU number is a range of one.
45+
for ((CPU=${RANGE%-*}; CPU<=${RANGE#*-}; CPU++)); do CPUS+=("$CPU"); done
46+
done
47+
if [ ${#CPUS[@]} -lt 2 ]; then
48+
echo "::error::Need a CPU each for client and server, runner allows only: $ALLOWED"
49+
exit 1
50+
fi
51+
echo "Runner allows CPUs $ALLOWED, pinning the server to ${CPUS[-1]}, the client to ${CPUS[-2]}"
52+
{
53+
echo "server-cpu=${CPUS[-1]}"
54+
echo "client-cpu=${CPUS[-2]}"
55+
echo "bench-cpus=${CPUS[-2]},${CPUS[-1]}"
56+
} >> "$GITHUB_OUTPUT"

‎.github/actions/bench-matrix/action.yml‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Determine the list of benchmarks from cargo metadata
33

44
outputs:
55
benches:
6-
description: JSON array of benchmarks for CodSpeed (non-walltime, with runner)
6+
description: JSON array of benchmarks for CodSpeed
77
value: ${{ steps.benches.outputs.benches }}
88
all:
99
description: JSON array of all unique crate/bench pairs (for profiling)
@@ -43,13 +43,10 @@ runs:
4343
)
4444
]')
4545
46-
# CodSpeed benchmarks (non-walltime, with runner)
47-
NON_WALLTIME=$(echo "$ALL_BENCHES" | jq -c '[.[] | select(.mode != "walltime") | . + {runner: "ubuntu-24.04"}]')
48-
4946
# All unique crate/bench pairs (for profiling)
5047
ALL_UNIQUE=$(echo "$ALL_BENCHES" | jq -c '[.[] | {crate, bench}] | unique')
5148
5249
{
53-
echo "benches=$NON_WALLTIME"
50+
echo "benches=$ALL_BENCHES"
5451
echo "all=$ALL_UNIQUE"
5552
} >> "$GITHUB_OUTPUT"

‎.github/actions/build-neqo/action.yml‎

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ description: >
55
and upload everything as a single artifact.
66
77
inputs:
8-
token:
9-
description: GitHub token
10-
required: true
118
artifact-name:
129
description: Name for the uploaded artifact
1310
required: true
@@ -17,9 +14,6 @@ inputs:
1714
baseline-ref:
1815
description: Git ref to build baseline binaries from
1916
default: "origin/main"
20-
nss-minimum-version:
21-
description: Minimum NSS version required by nss-rs
22-
required: true
2317

2418
runs:
2519
using: composite
@@ -30,17 +24,11 @@ runs:
3024
[ "$APT_UPDATED" ] || sudo apt-get update && echo "APT_UPDATED=1" >> "$GITHUB_ENV"
3125
sudo apt-get install -y --no-install-recommends clang lld
3226
33-
- name: Install Rust
34-
uses: mozilla/actions/rust@c7f9db3409fff64a55f16ac0cacbc4cdd05ae435 # v1.1.19
27+
- name: Install Rust and NSS
28+
uses: $/.github/actions/install-build-deps
3529
with:
3630
version: stable
37-
token: ${{ inputs.token }}
38-
39-
- name: Install NSS
40-
uses: mozilla/actions/nss@c7f9db3409fff64a55f16ac0cacbc4cdd05ae435 # v1.1.19
41-
with:
42-
minimum-version: ${{ inputs.nss-minimum-version }}
43-
token: ${{ inputs.token }}
31+
working-directory: neqo
4432

4533
- name: Build neqo
4634
shell: bash
@@ -87,21 +75,11 @@ runs:
8775
if [[ "$BENCHES" == "true" ]]; then build_walltime_benches ../dist/neqo; fi
8876
cp target/release/neqo-client target/release/neqo-server ../dist/neqo/
8977
90-
- name: Bundle NSS libraries and test fixture
91-
shell: bash
92-
run: |
93-
mkdir -p dist/lib
94-
if [ -d "$NSS_DIR/../dist/Release/lib" ]; then
95-
cp -L "$NSS_DIR"/../dist/Release/lib/*.so dist/lib/ 2>/dev/null || true
96-
cp -L "$NSS_DIR"/../dist/Release/lib/*.so.* dist/lib/ 2>/dev/null || true
97-
else
98-
for lib in nss3 nssutil3 smime3 ssl3 nspr4 plc4 plds4; do
99-
cp -L /usr/lib/*/lib${lib}.so* dist/lib/ 2>/dev/null || true
100-
done
101-
fi
102-
NSS_DB=$(cd neqo && cargo metadata --format-version 1 | jq -r 'first(.packages[] | select(.name == "test-fixture" and (.source // "" | startswith("git+"))) | .manifest_path | rtrimstr("/Cargo.toml"))')/db
103-
mkdir -p dist/test-fixture
104-
cp -r "$NSS_DB" dist/test-fixture/
78+
- name: Bundle NSS runtime files
79+
uses: $/.github/actions/bundle-nss
80+
with:
81+
path: dist
82+
working-directory: neqo
10583

10684
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
10785
with:
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Bundle NSS runtime files
2+
description: >
3+
Copy what neqo binaries need at runtime into <path>: the NSS shared libraries they link
4+
against into lib/, and the test-fixture certificate database into test-fixture/db.
5+
Requires install-build-deps to have run first, which sets NSS_DIR, and a Cargo workspace at
6+
<working-directory> to resolve test-fixture from.
7+
8+
inputs:
9+
path:
10+
description: Directory to create lib/ and test-fixture/ under
11+
required: true
12+
working-directory:
13+
description: Directory containing the Cargo.toml that pins test-fixture
14+
default: "."
15+
16+
runs:
17+
using: composite
18+
steps:
19+
- shell: bash
20+
env:
21+
DEST: ${{ inputs.path }}
22+
WORKING_DIRECTORY: ${{ inputs.working-directory }}
23+
run: |
24+
mkdir -p "$DEST/lib"
25+
if [ -d "$NSS_DIR/../dist/Release/lib" ]; then
26+
cp -L "$NSS_DIR"/../dist/Release/lib/*.so "$DEST/lib/" 2>/dev/null || true
27+
cp -L "$NSS_DIR"/../dist/Release/lib/*.so.* "$DEST/lib/" 2>/dev/null || true
28+
else
29+
for lib in nss3 nssutil3 smime3 ssl3 nspr4 plc4 plds4; do
30+
cp -L /usr/lib/*/lib${lib}.so* "$DEST/lib/" 2>/dev/null || true
31+
done
32+
fi
33+
if [ -z "$(ls -A "$DEST/lib")" ]; then
34+
echo "::error::No NSS libraries found (NSS_DIR=${NSS_DIR:-unset})"
35+
exit 1
36+
fi
37+
# Without TEST_FIXTURE_DB, test-fixture falls back to the cargo checkout path.
38+
NSS_DB=$(cd "$WORKING_DIRECTORY" && cargo metadata --format-version 1 | jq -r 'first(.packages[] | select(.name == "test-fixture" and (.source // "" | startswith("git+"))) | .manifest_path | rtrimstr("/Cargo.toml"))')/db
39+
if [ ! -d "$NSS_DB" ]; then
40+
echo "::error::No nss-rs test-fixture db found (looked in $NSS_DB)"
41+
exit 1
42+
fi
43+
mkdir -p "$DEST/test-fixture"
44+
cp -r "$NSS_DB" "$DEST/test-fixture/"

‎.github/actions/check-android/action.yml‎

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,45 +17,37 @@ inputs:
1717
# https://searchfox.org/mozilla-central/search?q=\bapi_level=&path=taskcluster/scripts/misc/build-llvm-common.sh&regexp=true
1818
# However, NSS requires an API >= 23 for a few symbols.
1919
default: "23"
20-
minimum-nss-version:
21-
description: "If NSS is required, the minimum version required."
22-
default: ""
23-
github-token:
24-
description: "A Github PAT"
25-
required: true
20+
nss:
21+
description: "Whether to install NSS."
22+
default: "true"
2623

2724
runs:
2825
using: composite
2926
steps:
30-
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
27+
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
3128
with:
3229
distribution: zulu
3330
java-version: 23
3431

35-
- uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
32+
- uses: android-actions/setup-android@be39fa834029ff78f1a44aa3bb0819b8fc2bd8fd # v4.0.4
3633
with:
3734
accept-android-sdk-licenses: true
3835
log-accepted-android-sdk-licenses: false
36+
packages: platform-tools
3937

4038
- shell: bash
4139
env:
4240
NDK_VERSION: ${{ inputs.ndk-version }}
4341
WD: ${{ inputs.working-directory }}
4442
run: cd "$WD" && sdkmanager --install "ndk;$NDK_VERSION"
4543

46-
- uses: mozilla/actions/rust@c7f9db3409fff64a55f16ac0cacbc4cdd05ae435 # v1.1.19
44+
- uses: $/.github/actions/install-build-deps
4745
with:
4846
version: stable
49-
targets: ${{ inputs.target }}
50-
tools: cargo-ndk@^4
51-
token: ${{ inputs.github-token }}
52-
53-
- uses: mozilla/actions/nss@c7f9db3409fff64a55f16ac0cacbc4cdd05ae435 # v1.1.19
54-
if: ${{ inputs.minimum-nss-version != '' }}
55-
with:
56-
minimum-version: ${{ inputs.minimum-nss-version }}
5747
target: ${{ inputs.target }}
58-
token: ${{ inputs.github-token }}
48+
tools: cargo-ndk@^4
49+
nss: ${{ inputs.nss }}
50+
working-directory: ${{ inputs.working-directory }}
5951

6052
- shell: bash
6153
env:
@@ -90,14 +82,14 @@ runs:
9082
adb push "$test" "$TMP/"
9183
adb shell chmod +x "$TMP/$(basename "$test")"
9284
# See https://unix.stackexchange.com/a/451140/409256
93-
adb shell "CARGO_TERM_COLOR=always RUST_BACKTRACE=1 LD_LIBRARY_PATH=$TMP/lib NSS_DB_PATH=$TMP/db API_LEVEL=$API_LEVEL $TMP/$(basename "$test") || echo _FAIL_" 2>&1 | tee output
85+
adb shell "CARGO_TERM_COLOR=always RUST_BACKTRACE=1 LD_LIBRARY_PATH=$TMP/lib TEST_FIXTURE_DB=$TMP/db API_LEVEL=$API_LEVEL $TMP/$(basename "$test") || echo _FAIL_" 2>&1 | tee output
9486
grep _FAIL_ output > /dev/null && any_failures=1
9587
done
9688
exit $any_failures
9789
EOF
9890
chmod a+x /tmp/rust-android-run-tests-on-emulator.sh
9991
100-
- uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # v2.37.0
92+
- uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d # v2.38.0
10193
if: ${{ !startsWith(inputs.target, 'aarch64') }}
10294
with:
10395
api-level: ${{ inputs.api-level }}

‎.github/actions/check-vm/action.yml‎

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ inputs:
1414
bindgen-args:
1515
description: "bindgen arguments for generating BSD bindings. Non-empty enables binding generation."
1616
default: ""
17+
nss-version-check:
18+
description: "Whether to check the system NSS version against the minimum required by nss-rs."
19+
default: "true"
1720

1821
runs:
1922
using: composite
@@ -25,7 +28,17 @@ runs:
2528
PLATFORM: ${{ inputs.platform }}
2629
WORKSPACE: ${{ inputs.working-directory == '.' && '--workspace' || '' }}
2730
BINDGEN_ARGS: ${{ inputs.bindgen-args }}
31+
NSS_VERSION_CHECK: ${{ inputs.nss-version-check }}
2832
run: |
33+
# Minimum NSS version required by nss-rs, so that we can detect a too-old system NSS below.
34+
if [ "$NSS_VERSION_CHECK" = "true" ]; then
35+
NSS_MIN_VERSION=$(cargo metadata --locked --format-version=1 -q \
36+
| jq -r '.packages[] | select(.name=="nss-rs") | .metadata.nss["min-version"]')
37+
case "$NSS_MIN_VERSION" in
38+
*[!0-9.]*|"") echo "Could not determine minimum NSS version"; exit 1 ;;
39+
esac
40+
fi
41+
2942
cat <<EOF > prepare.sh
3043
# This executes as root
3144
set -ex
@@ -55,6 +68,16 @@ runs:
5568
set -ex
5669
cd "$WD"
5770
pwd
71+
NSS_MIN_VERSION='$NSS_MIN_VERSION'
72+
if [ -n "\$NSS_MIN_VERSION" ]; then
73+
if ! pkg-config --exists nss; then
74+
echo "::warning::No nss.pc on $PLATFORM, cannot check the NSS version"
75+
elif ! pkg-config --atleast-version="\$NSS_MIN_VERSION" nss; then
76+
echo "Skipping $PLATFORM: system NSS \$(pkg-config --modversion nss) is older than the required \$NSS_MIN_VERSION" > nss-skipped.txt
77+
echo "::warning::\$(cat nss-skipped.txt)"
78+
exit 0
79+
fi
80+
fi
5881
case "$PLATFORM" in
5982
openbsd) export LIBCLANG_PATH=/usr/local/llvm21/lib
6083
export LLVM_COV=/usr/local/llvm21/bin/llvm-cov
@@ -123,7 +146,7 @@ runs:
123146
echo "envs=CARGO_TERM_COLOR RUST_BACKTRACE RUST_LOG RUST_TEST_TIME_UNIT RUST_TEST_TIME_INTEGRATION RUST_TEST_TIME_DOCTEST WD" >> "$GITHUB_OUTPUT"
124147
125148
- if: ${{ inputs.platform == 'freebsd' }}
126-
uses: vmactions/freebsd-vm@a6de9343ef5747433d9c25784c90e84998b9d69a # v1.4.6
149+
uses: vmactions/freebsd-vm@4469451fe39bee80be4066836c5170362e9349f3 # v1.5.7
127150
with:
128151
usesh: true
129152
disable-cache: true
@@ -133,7 +156,7 @@ runs:
133156
run: ${{ steps.prep.outputs.run }}
134157

135158
- if: ${{ inputs.platform == 'openbsd' }}
136-
uses: vmactions/openbsd-vm@fcf799d7ce9c305ad89eabef1fb2fa5c1c42d0ee # v1.4.3
159+
uses: vmactions/openbsd-vm@86cdc08415d9d0865267e686561e276c52d62530 # v1.4.7
137160
with:
138161
usesh: true
139162
disable-cache: true
@@ -143,7 +166,7 @@ runs:
143166
run: ${{ steps.prep.outputs.run }}
144167

145168
- if: ${{ inputs.platform == 'netbsd' }}
146-
uses: vmactions/netbsd-vm@99816dccf75edf233ed6cd00a159e3a5b85ea373 # v1.4.0
169+
uses: vmactions/netbsd-vm@20ee93a005c9fc78743e6e05269f4cb023b87413 # v1.5.0
147170
with:
148171
usesh: true
149172
disable-cache: true
@@ -153,7 +176,7 @@ runs:
153176
run: ${{ steps.prep.outputs.run }}
154177

155178
- if: ${{ inputs.platform == 'solaris' }}
156-
uses: vmactions/solaris-vm@d30dd6c228c8661ade859e36ead7660b9a62efcc # v1.3.7
179+
uses: vmactions/solaris-vm@a11f407d3720a3717673d4194f19ee63b284977e # v1.4.0
157180
with:
158181
release: "11.4-gcc"
159182
usesh: true
@@ -163,14 +186,22 @@ runs:
163186
prepare: ${{ steps.prep.outputs.prepare }}
164187
run: ${{ steps.prep.outputs.run }}
165188

189+
- shell: bash
190+
env:
191+
WORKING_DIR: ${{ inputs.working-directory }}
192+
run: |
193+
if [ -f "$WORKING_DIR/nss-skipped.txt" ]; then
194+
echo "### $(cat "$WORKING_DIR/nss-skipped.txt")" >> "$GITHUB_STEP_SUMMARY"
195+
fi
196+
166197
- id: check-coverage
167198
shell: bash
168199
env:
169200
WORKING_DIR: ${{ inputs.working-directory }}
170201
run: test -f "$WORKING_DIR/codecov.json" && echo "exists=true" >> "$GITHUB_OUTPUT" || true
171202

172203
- if: ${{ steps.check-coverage.outputs.exists == 'true' }}
173-
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
204+
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
174205
with:
175206
files: codecov.json
176207
working-directory: ${{ inputs.working-directory }}

0 commit comments

Comments
 (0)