diff options
author | Daniel Mueller <muellerd@meta.com> | 2024-02-02 06:10:48 -0800 |
---|---|---|
committer | Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> | 2024-02-02 06:10:48 -0800 |
commit | ec61b3b443ab4defbda8dd1b8800aed919def635 (patch) | |
tree | e0959ed36f0af140e770f35db0f36d1fe3a20718 | |
parent | 37ee74ce1827a65b41b0f0cfeb55840e58df534d (diff) |
Fix build with no-vendor feature
Summary:
The build was broken because as of D53102023, libbpf-rs no longer provided the
novendor feature, as it was replaced with the proper set of default features.
With this change we explicitly enable said default features by this program's
default feature.
Furthermore, to make no-vendor do the right thing, require that it be used
*without* default features via the build script. This is admittedly a breaking
change, but it seems to be unavoidable: there is no sensible way to combine
negative features ("no<...>") with positive ones. Cargo strongly suggests that
all features be additive in nature, and no-vendor violates that. However, that
can't be easily fixed, because of zstd's feature set.
Reviewed By: dtolnay
Differential Revision: D53323353
fbshipit-source-id: b36a7a84892e5b6ec2a4888649b6c737148d6a9b
-rw-r--r-- | below/Cargo.toml | 3 | ||||
-rw-r--r-- | below/build.rs | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/below/Cargo.toml b/below/Cargo.toml index fb6a55ce..f364d470 100644 --- a/below/Cargo.toml +++ b/below/Cargo.toml @@ -55,5 +55,6 @@ portpicker = "0.1.1" libbpf-cargo = { version = "0.22", git = "https://github.com/libbpf/libbpf-rs.git", rev = "56dca575089ab2144f51b7949a9ee4c9fc226a47", default-features = false } [features] +default = ["libbpf-cargo/default", "libbpf-rs/default"] enable_backtrace = [] -no-vendor = ["libbpf-cargo/novendor", "libbpf-rs/novendor", "store/no-vendor"] +no-vendor = ["store/no-vendor"] diff --git a/below/build.rs b/below/build.rs index 9f6723e0..bad1adcb 100644 --- a/below/build.rs +++ b/below/build.rs @@ -31,4 +31,9 @@ fn main() { } builder.build_and_generate(out).unwrap(); println!("cargo:rerun-if-changed={}", SRC); + + #[cfg(all(feature = "no-vendor", feature = "default"))] + compile_error!( + "In order to build without vendored dependencies please disable default features" + ); } |