Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature for doc_cfg, specify allowed cfgs in build.rs #158

Merged
merged 1 commit into from
Aug 3, 2024

Conversation

Tiwalun
Copy link
Contributor

@Tiwalun Tiwalun commented Jul 4, 2024

Specify possible configs as described in https://doc.rust-lang.org/nightly/rustc/check-cfg.html, and fix compilation with --cfg docsrs.

@ruabmbua ruabmbua merged commit dd640ce into ruabmbua:main Aug 3, 2024
9 checks passed
@JohnAZoidberg
Copy link

Seems this is only supported in nightly :/

> cargo build
    Updating crates.io index
  Downloaded hidapi v2.6.2
  Downloaded 1 crate (128.1 KB) in 0.26s
   Compiling libusb1-sys v0.7.0
   Compiling hidapi v2.6.2
error: unsupported output in build script of `hidapi v2.6.2`: `cargo::rustc-check-cfg=cfg(hidapi)`
Found a `cargo::key=value` build directive which is reserved for future use.
Either change the directive to `cargo:key=value` syntax (note the single `:`) or upgrade your version of Rust.
See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script for more information about build script outputs.
warning: build failed, waiting for other jobs to finish...

> cargo --version
cargo 1.75.0 (1d8b05cdd 2023-11-20)

@Tiwalun
Copy link
Contributor Author

Tiwalun commented Aug 7, 2024

I think this is related to the use of two colons in cargo::rustc-check-cfg=cfg(hidapi), if compatibility with versions older than 1.77 is required that has to be changed to cargo:rustc-check-cfg=cfg(hidapi). I don't think the actual rustc-check-cfg directive should cause a problem.

@ruabmbua Does this crate have any policies regarding which rust versions are supported?

@ruabmbua
Copy link
Owner

ruabmbua commented Aug 7, 2024

There is no explicit MSRV, but I try to keep it working for some (reasonably) recent packaged rustc versions from linux distros. Seems like debian stable does not have 1.77+ yet, so I will make a new release with a fix.

@ruabmbua
Copy link
Owner

ruabmbua commented Aug 7, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants