Skip to content

macOS builds failing with "unexpected cfg condition value: cargo-clippy" #229

Closed

Description

@micahrj

This is happening due to an issue in the objc crate: SSheldon/rust-objc#125

I think that ideally Baseview would just switch to the objc2 crate, but that would require a decent amount of work since it's not a drop-in replacement. The simpler workaround for now would probably be to point at the master branch of the rust-objc repo, since a fix for the issue has been merged but was never published to crates.io.

Activity

  1. micahrj commented on Apr 24, 2026

    @micahrj
    MemberAuthor

    I gave this a try and ran into the issue that the cocoa crate also depends on the objc crate, so the workaround would require forking cocoa as well.

  2. paravozz commented on Apr 24, 2026

    @paravozz
    Contributor

    @micahrj
    I dug into this earlier, tested a small build.rs workaround that silences the warning locally:

    fn main() {
      println!("cargo:rustc-check-cfg=cfg(feature, values(\"cargo-clippy\"))");
    }

    Happy to help with either, or with the objc2 migration.

    UPD: just in case, to speed things up, filed a PR with that fix: #231.

    UPD2: Filed #232 with the objc2 macros-only migration; supersedes #231. Kept cocoa for framework type bindings to leave the bigger cocoa-replacement decision open, since you flagged that direction. PR also folds in fixes for several latent @encode and NSException traps the stricter objc2 verification surfaces.

  3. micahrj commented on Apr 25, 2026

    @micahrj
    MemberAuthor

    It looks like we already had #![allow(unexpected_cfgs)] attributes in the relevant modules, but for some reason they have stopped working:

    1. #![allow(unexpected_cfgs)]
    2. #![allow(unexpected_cfgs)]

    I've found that if I move the attribute to the crate root it successfully silences the warning again: #233

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions