Skip to content

Commit

Permalink
Prospective CI fix for warnings about unexpected cfg
Browse files Browse the repository at this point in the history
```
error: unexpected `cfg` condition value: `noop`
  --> api/node/rust/lib.rs:17:1
   |
17 | #[napi]
   | ^^^^^^^
   |
   = note: expected values for `feature` are: `accessibility`, `backend-linuxkms`, `backend-linuxkms-noseat`, `backend-qt`, `backend-winit`, `backend-winit-wayland`, `backend-winit-x11`, `default`, `renderer-femtovg`, `renderer-skia`, `renderer-skia-opengl`, `renderer-skia-vulkan`, `renderer-software`, and `testing`
   = help: consider adding `noop` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `-D unexpected-cfgs` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unexpected_cfgs)]`
   = note: this error originates in the attribute macro `napi` (in Nightly builds, run with -Z macro-backtrace for more info)

error: unexpected `cfg` condition value: `used_linker`
  --> api/node/rust/lib.rs:17:1
   |
17 | #[napi]
   | ^^^^^^^
   |
   = note: expected values for `feature` are: `accessibility`, `backend-linuxkms`, `backend-linuxkms-noseat`, `backend-qt`, `backend-winit`, `backend-winit-wayland`, `backend-winit-x11`, `default`, `renderer-femtovg`, `renderer-skia`, `renderer-skia-opengl`, `renderer-skia-vulkan`, `renderer-software`, and `testing`
   = help: consider adding `used_linker` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: this error originates in the attribute macro `napi::bindgen_prelude::ctor` (in Nightly builds, run with -Z macro-backtrace for more info)a

...
```
  • Loading branch information
ogoffart committed Nov 20, 2024
1 parent 6bd043a commit 766aa8d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/node/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@

fn main() {
napi_build::setup();

// workaround bug that the `#[napi]` macro generate some invalid `#[cfg(feature="...")]`
println!("cargo:rustc-check-cfg=cfg(feature,values(\"noop\", \"used_linker\"))");
}

0 comments on commit 766aa8d

Please sign in to comment.