Skip to content

Commit df106c7

Browse files
larseggertCopilot
authored andcommitted
chore: Always build an optimized nss (#3094)
* chore: Always build an optimized nss And always use all cores to do so. * Update neqo-crypto/build.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Lars Eggert <lars@eggert.org> * Update .github/actions/nss/action.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Lars Eggert <lars@eggert.org> --------- Signed-off-by: Lars Eggert <lars@eggert.org> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent a3f5dce commit df106c7

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

build.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -153,24 +153,18 @@ fn get_bash() -> PathBuf {
153153
)
154154
}
155155

156-
fn build_nss(dir: PathBuf, nsstarget: &str) {
156+
fn build_nss(dir: PathBuf) {
157157
let mut build_nss = vec![
158158
String::from("./build.sh"),
159159
String::from("-Ddisable_tests=1"),
160160
String::from("-Ddisable_dbm=1"),
161161
String::from("-Ddisable_libpkix=1"),
162162
String::from("-Ddisable_ckbi=1"),
163163
String::from("-Ddisable_fips=1"),
164+
String::from("--opt"),
164165
// Generate static libraries in addition to shared libraries.
165166
String::from("--static"),
166167
];
167-
if nsstarget == "Release" {
168-
build_nss.push(String::from("-o"));
169-
}
170-
if let Ok(d) = env::var("NSS_JOBS") {
171-
build_nss.push(String::from("-j"));
172-
build_nss.push(d);
173-
}
174168
let target = env::var("TARGET").unwrap();
175169
if target.strip_prefix("aarch64-").is_some() {
176170
build_nss.push(String::from("--target=arm64"));
@@ -404,19 +398,14 @@ fn setup_standalone(nss_dir: String) -> Vec<String> {
404398
// $NSS_DIR/../dist/
405399
let nssdist = nss.parent().unwrap().join("dist");
406400
println!("cargo:rerun-if-env-changed={}", nssdist.display());
401+
let nsstarget = "Release";
407402

408403
// If NSS_PREBUILT is set, we assume that the NSS libraries are already built.
409-
let nsstarget;
410404
if env::var("NSS_PREBUILT").is_err() {
411-
// If NSS is not already built, we can't read the build mode of the last build
412-
nsstarget = env::var("NSS_TARGET").unwrap_or_else(|_| String::from("Release"));
413-
build_nss(nss, &nsstarget);
414-
} else {
415-
nsstarget = env::var("NSS_TARGET")
416-
.unwrap_or_else(|_| fs::read_to_string(nssdist.join("latest")).unwrap());
405+
build_nss(nss);
417406
}
418-
let nsstarget = nssdist.join(nsstarget.trim());
419407

408+
let nsstarget = nssdist.join(nsstarget);
420409
let includes = get_includes(&nsstarget, &nssdist);
421410

422411
let nsslibdir = nsstarget.join("lib");

0 commit comments

Comments
 (0)