Skip to content

Commit 79f359d

Browse files
authored
fix(build): fix build failure and instructions (mozilla#3031)
- handling error in `neqo-crypto/build.rs` by defaulting to `NSS_TARGET=Release` if it is not set and we don't have a prior build to reference the latest target from - overhauled the README instructions for building with seperate NSS Signed-off-by: Oskar Mansfeld <git@omansfeld.net>
1 parent 254a0af commit 79f359d

1 file changed

Lines changed: 19 additions & 15 deletions

File tree

README.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,30 @@ To run test HTTP/3 programs (`neqo-client` and `neqo-server`):
4040

4141
## Build with separate NSS/NSPR
4242

43-
You can clone [NSS][NSS] and [NSPR][NSPR] into the same directory and export an
44-
environment variable called `NSS_DIR` pointing to NSS. This causes the build to
45-
use the existing NSS checkout. However, in order to run anything that depends
46-
on NSS, you need to set an environment as follows:
43+
1. Clone [NSS][NSS] and [NSPR][NSPR] into the same directory and export an environment variable called `NSS_DIR` pointing to NSS.
44+
For example if you have a folder `$HOME/neqo-dependencies` and cloned NSS and NSPR into it you'd set `NSS_DIR=$HOME/neqo-dependencies/nss`.
4745

48-
### Linux
46+
2. If you did not already compile NSS separately, you need to have [Mercurial (hg)][HG] installed.
47+
NSS builds require [GYP][GYP] and [Ninja][NINJA] to be installed.
4948

50-
```shell
51-
export LD_LIBRARY_PATH="$(find . -name libssl3.so -print | head -1 | xargs dirname | xargs realpath)"
52-
```
49+
3. Run `cargo build` in your `neqo` checkout. The prior steps enable `cargo build` to use the existing NSS build or build it from the existing checkout if it hasn't been built yet.
5350

54-
### macOS
51+
4. Now that NSS has been built you need to set another environment variable to be able to actually do anything that depends on NSS.
52+
- For Linux:
5553

56-
```shell
57-
export DYLD_LIBRARY_PATH="$(find . -name libssl3.dylib -print | head -1 | xargs dirname | xargs realpath)"
58-
```
54+
```shell
55+
export LD_LIBRARY_PATH="$(find $NSS_DIR/.. -name libssl3.so -print | head -1 | xargs dirname | xargs realpath)"
56+
```
57+
58+
- For MacOS:
59+
60+
```shell
61+
export DYLD_LIBRARY_PATH="$(find $NSS_DIR/.. -name libssl3.dylib -print | head -1 | xargs dirname | xargs realpath)"
62+
```
63+
64+
5. (optional) After having an NSS build you can set the `NSS_PREBUILT=1` environment variable to skip building NSS again on future `cargo build` invocations.
5965

60-
Note: If you did not already compile NSS separately, you need to have
61-
[Mercurial (hg)][HG], installed. NSS builds require [GYP][GYP] and
62-
[Ninja][NINJA] to be installed.
66+
To confirm the NSS setup works you can run `cargo test -p neqo-crypto --lib`.
6367

6468
## Debugging Neqo
6569

0 commit comments

Comments
 (0)