Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

Commit 9ecd377

Browse files
Pat Hickeyjedisct1
andauthored
silence deprecation warnings in lucet-benchmarks (#679)
* silence deprecation warnings in lucet-benchmarks * cargo audit: ignore RUSTSEC-2020-0159 we do not believe this vulnerablity is reachable in our project * Fix macOS support on Big Sur & Monterey Co-authored-by: Frank Denis <github@pureftpd.org>
1 parent f6f4d64 commit 9ecd377

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
- name: Install Rust (rustup)
134134
run: rustup update
135135
- run: cargo install cargo-audit
136-
- run: cargo audit
136+
- run: cargo audit --ignore RUSTSEC-2020-0159
137137

138138
docs:
139139
name: Build docs

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ bench:
8787

8888
.PHONY: audit
8989
audit:
90-
cargo audit
90+
cargo audit --ignore RUSTSEC-2020-0159
9191

9292
.PHONY: clean
9393
clean:

benchmarks/lucet-benchmarks/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This crate uses several Criterion APIs which are deprecated. However, the
2+
// Lucet project is in maintence mode and we no longer really care about
3+
// maintaining and updating these interfaces, so we will ignore these
4+
// warnings:
5+
#![allow(deprecated)]
6+
17
mod compile;
28
mod context;
39
mod modules;

lucetc/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,15 @@ fn ldflags_default(target: &Triple, target_version: &TargetVersion) -> String {
472472
| OperatingSystem::Freebsd
473473
| OperatingSystem::Dragonfly
474474
| OperatingSystem::Netbsd
475-
| OperatingSystem::Openbsd => "-shared",
475+
| OperatingSystem::Openbsd => "-shared".to_string(),
476476
OperatingSystem::Darwin | OperatingSystem::MacOSX { .. } => {
477-
"-dylib -dead_strip -export_dynamic -undefined dynamic_lookup"
477+
let sdk_path = std::process::Command::new("xcrun")
478+
.args(&["-sdk", "macosx", "--show-sdk-path"])
479+
.output()
480+
.expect("xcrun failed")
481+
.stdout;
482+
let sdk_path = std::str::from_utf8(&sdk_path).expect("invalid sdk_path").trim();
483+
format!("-dylib -dead_strip -export_dynamic -undefined dynamic_lookup -L {}/usr/lib -lSystem", sdk_path)
478484
}
479485
_ => panic!(
480486
"Cannot determine default flags for {}.

0 commit comments

Comments
 (0)