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

Does rust nightly require the lints.rust exceptions for system-deps dependencies? #98

Open
federicomenaquintero opened this issue Jul 16, 2024 · 2 comments

Comments

@federicomenaquintero
Copy link

On rust nightly, librsvg is getting a lot of these:

error: unexpected `cfg` condition name: `system_deps_have_fontconfig`
   --> rsvg/src/test_utils/mod.rs:124:9
    |
124 |     not(system_deps_have_fontconfig),
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(system_deps_have_fontconfig)'] }

And sure enough, per the help message and this note about automatic checking of cfgs, things work fine when I add those chunks to Cargo.toml.

That page also suggests printing some magic info from build.rs as an alternative (search for "build.rs example" in it). Is this something that system-deps could do itself?

@gdesmott
Copy link
Owner

Interesting.

If it's as simple as printing those "cargo::rustc-check-cfg=cfg(has_foo)" then sure, system-deps could easily do that.

@federicomenaquintero
Copy link
Author

I haven't tried doing it from build.rs, as it seemed more convenient to just copy the compiler's suggestion into Cargo.toml.

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

No branches or pull requests

2 participants