From 391f7ee113216b3e862794b495bb3e5cfd1ef858 Mon Sep 17 00:00:00 2001 From: David Pacheco Date: Wed, 8 Sep 2021 14:24:30 -0700 Subject: [PATCH] WIP: #213 --- Cargo.lock | 6 +++++- Cargo.toml | 5 +++-- omicron-bootstrap-agent/Cargo.toml | 2 ++ omicron-bootstrap-agent/build.rs | 8 ++++++++ omicron-common/Cargo.toml | 2 ++ omicron-common/build.rs | 8 ++++++++ omicron-nexus/Cargo.toml | 2 ++ omicron-nexus/build.rs | 7 +++++++ omicron-sled-agent/Cargo.toml | 2 ++ omicron-sled-agent/build.rs | 8 ++++++++ oximeter/oximeter/Cargo.toml | 2 ++ oximeter/oximeter/build.rs | 8 ++++++++ 12 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 omicron-bootstrap-agent/build.rs create mode 100644 omicron-common/build.rs create mode 100644 omicron-nexus/build.rs create mode 100644 omicron-sled-agent/build.rs create mode 100644 oximeter/oximeter/build.rs diff --git a/Cargo.lock b/Cargo.lock index 8b3b6c541b..4e45f43d83 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1232,6 +1232,7 @@ dependencies = [ "http", "hyper", "omicron-common", + "pq-sys", "serde", "serde_json", "slog", @@ -1263,6 +1264,7 @@ dependencies = [ "libc", "macaddr", "postgres-protocol", + "pq-sys", "propolis-server", "rayon", "reqwest", @@ -1314,6 +1316,7 @@ dependencies = [ "openapi-lint", "openapiv3", "oximeter", + "pq-sys", "schemars", "serde", "serde_json", @@ -1344,6 +1347,7 @@ dependencies = [ "ipnet", "mockall", "omicron-common", + "pq-sys", "propolis-client 0.1.0 (git+https://github.com/oxidecomputer/propolis?rev=3d58a6398)", "schemars", "serde", @@ -1442,6 +1446,7 @@ dependencies = [ "num-traits", "omicron-common", "oximeter-macro-impl", + "pq-sys", "reqwest", "schemars", "serde", @@ -1655,7 +1660,6 @@ checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "pq-sys" version = "0.4.6" -source = "git+https://github.com/oxidecomputer/pq-sys?branch=oxide#580b9da96e8d67c99975e55f360e36dc4272fdec" dependencies = [ "vcpkg", ] diff --git a/Cargo.toml b/Cargo.toml index 9ce25c0e42..e872e13ef2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,5 +39,6 @@ panic = "abort" # upstream, we can remove our fork. # [patch.crates-io.pq-sys] -git = 'https://github.com/oxidecomputer/pq-sys' -branch = "oxide" +#git = 'https://github.com/oxidecomputer/pq-sys' +#branch = "oxide" +path = "../pq-sys-dynamic" diff --git a/omicron-bootstrap-agent/Cargo.toml b/omicron-bootstrap-agent/Cargo.toml index 30c1d2d34e..0e1ce33087 100644 --- a/omicron-bootstrap-agent/Cargo.toml +++ b/omicron-bootstrap-agent/Cargo.toml @@ -6,6 +6,8 @@ edition = "2018" [dependencies] http = "0.2.0" hyper = "0.14" +# See build.rs for more about the "pq-sys" dependency. +pq-sys = "0.4" serde_json = "1.0" smf = "0.2" structopt = "0.3" diff --git a/omicron-bootstrap-agent/build.rs b/omicron-bootstrap-agent/build.rs new file mode 100644 index 0000000000..7a6915d356 --- /dev/null +++ b/omicron-bootstrap-agent/build.rs @@ -0,0 +1,8 @@ +// XXX comment and keep in sync with omicron-nexus +fn main() { + if let Some(rpaths) = std::env::var_os("DEP_PQ_LIBDIRS") { + for p in std::env::split_paths(&rpaths) { + println!("cargo:rustc-link-arg=-Wl,-R{}", p.to_string_lossy()); + } + } +} diff --git a/omicron-common/Cargo.toml b/omicron-common/Cargo.toml index 3cfba5cd61..bf8690341c 100644 --- a/omicron-common/Cargo.toml +++ b/omicron-common/Cargo.toml @@ -14,6 +14,8 @@ hyper = "0.14" libc = "0.2.98" propolis-server = { git = "https://github.com/oxidecomputer/propolis", rev = "b6da043d" } postgres-protocol = "0.6.1" +# See build.rs for more about the "pq-sys" dependency. +pq-sys = "0.4" rayon = "1.5" reqwest = { version = "0.11", default-features = false, features = ["rustls-tls"] } ring = "0.16" diff --git a/omicron-common/build.rs b/omicron-common/build.rs new file mode 100644 index 0000000000..7a6915d356 --- /dev/null +++ b/omicron-common/build.rs @@ -0,0 +1,8 @@ +// XXX comment and keep in sync with omicron-nexus +fn main() { + if let Some(rpaths) = std::env::var_os("DEP_PQ_LIBDIRS") { + for p in std::env::split_paths(&rpaths) { + println!("cargo:rustc-link-arg=-Wl,-R{}", p.to_string_lossy()); + } + } +} diff --git a/omicron-nexus/Cargo.toml b/omicron-nexus/Cargo.toml index bbfaa61360..9d09ea8616 100644 --- a/omicron-nexus/Cargo.toml +++ b/omicron-nexus/Cargo.toml @@ -17,6 +17,8 @@ ipnetwork = "0.18" lazy_static = "1.4.0" libc = "0.2.98" newtype_derive = "0.1.6" +# See build.rs for more about the "pq-sys" dependency. +pq-sys = "0.4" serde_json = "1.0" serde_with = "1.9.4" structopt = "0.3" diff --git a/omicron-nexus/build.rs b/omicron-nexus/build.rs new file mode 100644 index 0000000000..8e1df8a8d6 --- /dev/null +++ b/omicron-nexus/build.rs @@ -0,0 +1,7 @@ +fn main() { + if let Some(rpaths) = std::env::var_os("DEP_PQ_LIBDIRS") { + for p in std::env::split_paths(&rpaths) { + println!("cargo:rustc-link-arg=-Wl,-R{}", p.to_string_lossy()); + } + } +} diff --git a/omicron-sled-agent/Cargo.toml b/omicron-sled-agent/Cargo.toml index 490b98866c..cd848ca010 100644 --- a/omicron-sled-agent/Cargo.toml +++ b/omicron-sled-agent/Cargo.toml @@ -13,6 +13,8 @@ http = "0.2.0" hyper = "0.14" ipnet = "2.3" omicron-common = { path = "../omicron-common" } +# See build.rs for more about the "pq-sys" dependency. +pq-sys = "0.4" propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "3d58a6398" } schemars = { version = "0.8", features = [ "chrono", "uuid" ] } serde = { version = "1.0", features = [ "derive" ] } diff --git a/omicron-sled-agent/build.rs b/omicron-sled-agent/build.rs new file mode 100644 index 0000000000..7a6915d356 --- /dev/null +++ b/omicron-sled-agent/build.rs @@ -0,0 +1,8 @@ +// XXX comment and keep in sync with omicron-nexus +fn main() { + if let Some(rpaths) = std::env::var_os("DEP_PQ_LIBDIRS") { + for p in std::env::split_paths(&rpaths) { + println!("cargo:rustc-link-arg=-Wl,-R{}", p.to_string_lossy()); + } + } +} diff --git a/oximeter/oximeter/Cargo.toml b/oximeter/oximeter/Cargo.toml index 2cd45aabdb..c7c493330d 100644 --- a/oximeter/oximeter/Cargo.toml +++ b/oximeter/oximeter/Cargo.toml @@ -13,6 +13,8 @@ num-traits = "0.2.14" hyper = "0.14.10" oximeter-macro-impl = { path = "../oximeter-macro-impl" } omicron-common = { path = "../../omicron-common" } +# See build.rs for more about the "pq-sys" dependency. +pq-sys = "0.4" reqwest = { version = "0.11.4", features = [ "json" ] } schemars = { version = "0.8.3", features = [ "uuid", "bytes", "chrono" ] } serde = { version = "1", features = [ "derive" ] } diff --git a/oximeter/oximeter/build.rs b/oximeter/oximeter/build.rs new file mode 100644 index 0000000000..7a6915d356 --- /dev/null +++ b/oximeter/oximeter/build.rs @@ -0,0 +1,8 @@ +// XXX comment and keep in sync with omicron-nexus +fn main() { + if let Some(rpaths) = std::env::var_os("DEP_PQ_LIBDIRS") { + for p in std::env::split_paths(&rpaths) { + println!("cargo:rustc-link-arg=-Wl,-R{}", p.to_string_lossy()); + } + } +}