hobofan / cargo-nono

Check your crate for (possible) no_std compatibility
Apache License 2.0
209 stars 12 forks source link

Check for no_std gated by not(test) #38

Closed xoloki closed 5 years ago

xoloki commented 5 years ago

The no_std check in main files does not catch the case where the no_std is gated on not(test). This change adds that check before failing with SourceOffense::MissingNoStdAttribute.

This fixes a false positive with the widely used clear_on_drop crate, which prevents using cargo nono in CI for crates which depend on clear_on_drop.

hobofan commented 5 years ago

Thanks for the contribution! 👏

It would be great if you can add a test case for that. For that you can just copy one of the projects in the test directory and adjust it.

I'll also have to change the CI here to ignore the Linux build for the time being, as it's broken right now. (#37)

xoloki commented 5 years ago

Okay @hobofan, I added a test for the new behavior copied from an existing test. The new test is succeeding on the macos platform.

Let me know if there's anything else you want me to do.

xoloki commented 5 years ago

I updated CI to disable the linux builds as per issue #37 @hobofan. CI is now passing. There was a weird file locking error the first time CI ran, but after triggering a second build it succeeded, so I think the error was spurious.

Let me know if there's anything else you want me to do.

hobofan commented 5 years ago

LGTM 👍

Thanks for the patience!

hobofan commented 5 years ago

Released in 0.1.5!

xoloki commented 5 years ago

Excellent, thanks @hobofan!

I noticed that cargo install cargo-nono is still picking up v1.1.4, do you have any idea what needs to happen for the release to propagate?

xoloki commented 5 years ago

I emailed help@crates.io to ask them to update the index. Hopefully that should take care of it.

hobofan commented 5 years ago

Sorry, I had only published it as a binary via Github Releases 🙈. Should be on crates.io now.