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

error: unexpected cfg condition value: cargo-clippy #125

Open
glandium opened this issue Dec 18, 2024 · 5 comments
Open

error: unexpected cfg condition value: cargo-clippy #125

glandium opened this issue Dec 18, 2024 · 5 comments

Comments

@glandium
Copy link

Using the msg_send! macro yields warnings like this with upcoming rustc 1.84.0:

error: unexpected `cfg` condition value: `cargo-clippy`
     --> /opt/worker/tasks/task_171225436694629/build/obj-build/x86_64-apple-darwin/debug/build/cocoabind-fb71164ed4d87a08/out/cocoa_bindings.rs:23030:9
      |
23030 |         msg_send!(class!(NSColor), whiteColor)
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = note: no expected values for `feature`
      = help: consider adding `cargo-clippy` 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 macro `sel_impl` which comes from the expansion of the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info)
@glandium
Copy link
Author

(this is an error in the log because we build with -D warnings)

@glandium
Copy link
Author

err, so this was actually fixed in #75, but never made it to crates.io.

@raphamorim
Copy link

I patched those changes in a fork https://crates.io/crates/objc-rs

Feel free to use, if objc crate get any update I gladly will remove/drop my fork

@madsmtm
Copy link

madsmtm commented Jan 21, 2025

Hey, just gonna pipe in and say that I also maintain a fork (and have maintained it for a few years now), called objc2 - I suspect that can also solve your problems, if not, then I'd love to combine efforts @raphamorim!

@raphamorim
Copy link

objc2 is great, I use on Rio too (actually way more than objc) but some projects I wrote a long time ago I just want to maintain without much work.

but yes, I would recommend objc2 nowadays instead

joseluis added a commit to joseluis/miniquad that referenced this issue Feb 7, 2025
- Warnings related to unsafe code has not been touched.
- The number of warnings has been reduced from 381 to 7 errors (denied lints).

Fixes:
- replaced unmaintained objc crate with fork SSheldon/rust-objc#125.
  - Ideally it would be replaced with https://github.com/madsmtm/objc2 but that'd be too much work.
- simplified zero pointers and redundant casts and clones.
- fixed slow zero-filling vector initialization.
- simplified unneeded explicit returns.
- simplified unnecessary lifetimes.
- ...among others.
joseluis added a commit to joseluis/miniquad that referenced this issue Feb 7, 2025
- Warnings related to unsafe code has not been touched.
- The number of warnings has been reduced from 381 to 7 errors (denied lints).

Fixes:
- replaced unmaintained objc crate with fork SSheldon/rust-objc#125.
  - Ideally it would be replaced with https://github.com/madsmtm/objc2 but that'd be too much work.
- simplified zero pointers and redundant casts and clones.
- fixed slow zero-filling vector initialization.
- simplified unneeded explicit returns.
- simplified unnecessary lifetimes.
- ...among others.
not-fl3 pushed a commit to not-fl3/miniquad that referenced this issue Feb 7, 2025
- Warnings related to unsafe code has not been touched.
- The number of warnings has been reduced from 381 to 7 errors (denied lints).

Fixes:
- replaced unmaintained objc crate with fork SSheldon/rust-objc#125.
  - Ideally it would be replaced with https://github.com/madsmtm/objc2 but that'd be too much work.
- simplified zero pointers and redundant casts and clones.
- fixed slow zero-filling vector initialization.
- simplified unneeded explicit returns.
- simplified unnecessary lifetimes.
- ...among others.
wez added a commit to wezterm/wezterm that referenced this issue Feb 8, 2025
This is a PITA. The objc crate does some stuff that spews warnings
everywhere that the sel! and msg_send! macros are used.

That crate is not currently maintained

There is a fork of the crate which resolves the spew, but we also
use the cocoa crate which pulls in the original crate

The new fork is not compatible with cargo workspace patching.

There is an alternative objc2 crate with a nicer, more type-safe
API, but the API changes to migrate are pretty huge: I just lost
a couple of hours on this and still hadn't gotten past the migrating
the NSMenu stuff over.

So, the approach here is to simply ignore the warnings in the modules
that use the objc crate.

This will need to be fixed by someone someday, but that day is not
today.

refs: SSheldon/rust-objc#125
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

3 participants