Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(nss): handle system-, cached-, and to-be-build-NSS #2142

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

mxinden
Copy link
Collaborator

@mxinden mxinden commented Oct 1, 2024

When the system NSS version is sufficient:

- name: Check system NSS version

Then one must not set the environment variables pointing to a local copy:

- name: Set up environment
shell: bash
run: |
NSS_TARGET="${{ inputs.type }}"
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"
echo "NSS_PREBUILT=1" >> "$GITHUB_ENV"
env:
NSS_DIR: ${{ github.workspace }}/nss
NSPR_DIR: ${{ github.workspace }}/nspr

Fixes #2141.

@mxinden mxinden marked this pull request as ready for review October 1, 2024 08:58
Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.35%. Comparing base (55e3a93) to head (a802d5b).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2142   +/-   ##
=======================================
  Coverage   95.35%   95.35%           
=======================================
  Files         112      112           
  Lines       36336    36336           
=======================================
  Hits        34648    34648           
  Misses       1688     1688           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@larseggert
Copy link
Collaborator

Is this fixing a bug?

When a prebuilt NSS is downloaded from the GitHub cache, BUILD_NSS is set to 0 but the environment still needs to be set up so it is found by the neqo build process.

Copy link

github-actions bot commented Oct 1, 2024

Failed Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

Copy link

github-actions bot commented Oct 1, 2024

Benchmark results

Performance differences relative to 55e3a93.

coalesce_acked_from_zero 1+1 entries: 💚 Performance has improved.
       time:   [99.642 ns 99.941 ns 100.25 ns]
       change: [-12.012% -11.570% -11.105%] (p = 0.00 < 0.05)

Found 13 outliers among 100 measurements (13.00%)
9 (9.00%) high mild
4 (4.00%) high severe

coalesce_acked_from_zero 3+1 entries: 💚 Performance has improved.
       time:   [117.92 ns 118.33 ns 118.76 ns]
       change: [-32.923% -32.618% -32.290%] (p = 0.00 < 0.05)

Found 22 outliers among 100 measurements (22.00%)
4 (4.00%) low mild
18 (18.00%) high severe

coalesce_acked_from_zero 10+1 entries: 💚 Performance has improved.
       time:   [117.20 ns 117.50 ns 117.90 ns]
       change: [-39.393% -35.094% -32.494%] (p = 0.00 < 0.05)

Found 14 outliers among 100 measurements (14.00%)
6 (6.00%) low severe
1 (1.00%) low mild
1 (1.00%) high mild
6 (6.00%) high severe

coalesce_acked_from_zero 1000+1 entries: 💚 Performance has improved.
       time:   [98.432 ns 98.576 ns 98.730 ns]
       change: [-31.383% -30.817% -30.182%] (p = 0.00 < 0.05)

Found 9 outliers among 100 measurements (9.00%)
4 (4.00%) high mild
5 (5.00%) high severe

RxStreamOrderer::inbound_frame(): Change within noise threshold.
       time:   [111.68 ms 111.74 ms 111.81 ms]
       change: [+0.2440% +0.3205% +0.3914%] (p = 0.00 < 0.05)

Found 20 outliers among 100 measurements (20.00%)
2 (2.00%) low severe
8 (8.00%) low mild
4 (4.00%) high mild
6 (6.00%) high severe

transfer/pacing-false/varying-seeds: No change in performance detected.
       time:   [25.917 ms 27.053 ms 28.191 ms]
       change: [-10.525% -5.3449% -0.1115%] (p = 0.06 > 0.05)
transfer/pacing-true/varying-seeds: No change in performance detected.
       time:   [34.464 ms 36.182 ms 37.918 ms]
       change: [-10.971% -5.5414% +0.4415%] (p = 0.09 > 0.05)
transfer/pacing-false/same-seed: Change within noise threshold.
       time:   [25.233 ms 26.036 ms 26.851 ms]
       change: [-8.5883% -4.8002% -0.6522%] (p = 0.03 < 0.05)
transfer/pacing-true/same-seed: No change in performance detected.
       time:   [39.706 ms 41.674 ms 43.710 ms]
       change: [-10.861% -4.7015% +1.6731%] (p = 0.15 > 0.05)
1-conn/1-100mb-resp (aka. Download)/client: Change within noise threshold.
       time:   [113.70 ms 114.36 ms 115.11 ms]
       thrpt:  [868.74 MiB/s 874.40 MiB/s 879.49 MiB/s]
change:
       time:   [-1.9679% -1.3456% -0.7499%] (p = 0.00 < 0.05)
       thrpt:  [+0.7556% +1.3639% +2.0074%]

Found 4 outliers among 100 measurements (4.00%)
2 (2.00%) low mild
2 (2.00%) high severe

1-conn/10_000-parallel-1b-resp (aka. RPS)/client: No change in performance detected.
       time:   [312.84 ms 316.84 ms 320.83 ms]
       thrpt:  [31.169 Kelem/s 31.562 Kelem/s 31.966 Kelem/s]
change:
       time:   [-2.7633% -1.0983% +0.6630%] (p = 0.21 > 0.05)
       thrpt:  [-0.6586% +1.1105% +2.8418%]
1-conn/1-1b-resp (aka. HPS)/client: 💔 Performance has regressed.
       time:   [34.193 ms 34.400 ms 34.628 ms]
       thrpt:  [28.879  elem/s 29.070  elem/s 29.245  elem/s]
change:
       time:   [+1.1200% +1.9545% +2.8118%] (p = 0.00 < 0.05)
       thrpt:  [-2.7349% -1.9170% -1.1076%]

Found 14 outliers among 100 measurements (14.00%)
5 (5.00%) low mild
2 (2.00%) high mild
7 (7.00%) high severe

Client/server transfer results

Transfer of 33554432 bytes over loopback.

Client Server CC Pacing Mean [ms] Min [ms] Max [ms] Relative
msquic msquic 111.6 ± 21.9 91.0 177.8 1.00
neqo msquic reno on 216.5 ± 6.5 209.3 228.6 1.00
neqo msquic reno 215.6 ± 9.8 202.7 230.7 1.00
neqo msquic cubic on 216.3 ± 11.1 204.3 239.2 1.00
neqo msquic cubic 216.4 ± 8.9 206.3 236.7 1.00
msquic neqo reno on 90.9 ± 9.9 81.9 117.9 1.00
msquic neqo reno 98.9 ± 19.1 81.3 165.6 1.00
msquic neqo cubic on 93.6 ± 23.9 82.5 203.6 1.00
msquic neqo cubic 96.1 ± 21.3 81.4 161.9 1.00
neqo neqo reno on 154.8 ± 36.7 123.3 272.1 1.00
neqo neqo reno 141.8 ± 11.1 124.4 165.6 1.00
neqo neqo cubic on 154.4 ± 27.4 127.3 221.6 1.00
neqo neqo cubic 169.6 ± 41.0 121.7 266.4 1.00

⬇️ Download logs

@mxinden
Copy link
Collaborator Author

mxinden commented Oct 1, 2024

coalesce_acked_from_zero 10+1 entries: 💚 Performance has improved.

   time:   [116.48 ns 116.99 ns 117.58 ns]
   change: [-39.843% -35.572% -33.050%] (p = 0.00 < 0.05)

Found 15 outliers among 100 measurements (15.00%)

Ufff, a 35% performance improvement on an unrelated change 🤔

@mxinden
Copy link
Collaborator Author

mxinden commented Oct 1, 2024

Is this fixing a bug?

Yes, this fixes #2141.

When a prebuilt NSS is downloaded from the GitHub cache, BUILD_NSS is set to 0 but the environment still needs to be set up so it is found by the neqo build process.

When NSS_DIR isn't set, pkg-config is used to find the system-wide installation of NSS:

neqo/neqo-crypto/build.rs

Lines 428 to 434 in 55e3a93

let flags = if cfg!(feature = "gecko") {
setup_for_gecko()
} else if let Ok(nss_dir) = env::var("NSS_DIR") {
setup_standalone(nss_dir.trim())
} else {
pkg_config()
};

Thus I don't think the environment variables need to be set when using the NSS installation from brew on MacOS.

@larseggert am I missing something?

@larseggert
Copy link
Collaborator

You are right that if NSS_DIR isn't set, we try and use the system NSS.

But if we need to use an NSS that was build from source, we need to set the environment variables, so that neqo can link against the NSS that was build by (or cache-restored by) the GitHub action.

With your change, is it still using the prebuilt-from-source NSS, or is it building it again as part of neqo?

Copy link

github-actions bot commented Oct 1, 2024

Firefox builds for this PR

The following builds are available for testing. Crossed-out builds did not succeed.

@mxinden
Copy link
Collaborator Author

mxinden commented Oct 1, 2024

I think I understand now. Thanks @larseggert. I missed that BUILD_NSS is overwritten on cache hit:

echo "Using cached prebuilt NSS"
echo "BUILD_NSS=0" >> "$GITHUB_ENV"

Let me take another look.

@mxinden mxinden changed the title ci(nss): don't set environment variables on BUILD_NSS 0 ci(nss): handle system, cached, and to-be-build NSS Oct 1, 2024
@mxinden mxinden changed the title ci(nss): handle system, cached, and to-be-build NSS ci(nss): handle system-, cached-, and to-be-build-NSS Oct 1, 2024
@mxinden mxinden marked this pull request as ready for review October 1, 2024 14:00
@larseggert larseggert added this pull request to the merge queue Oct 1, 2024
Merged via the queue into mozilla:main with commit 828169a Oct 1, 2024
63 of 65 checks passed
@@ -86,21 +86,21 @@ runs:
fi

- name: Checkout NSS
if: env.BUILD_NSS == '1'
if: env.USE_SYSTEM == '0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

USE_SYSTEM_NSS !

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uff, good catch. Thank you @martinthomson! Will be fixed in #2145.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ci: macos failing with bindings/nspr_io.h:7:10: fatal error: 'prio.h' file not found
3 participants