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

Deny clashing extern declarations by default. #75192

Closed

Conversation

jumbatm
Copy link
Contributor

@jumbatm jumbatm commented Aug 5, 2020

Changes the clashing_extern_declarations lint to be deny by default, as the lint addresses a soundness issue (see #70496).

Note that this change should go through a crater-check run before being merged (as mentioned in #70946 (comment)).

r? @nagisa

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 5, 2020
@joshtriplett
Copy link
Member

joshtriplett commented Aug 5, 2020

Looks good to me.

@bors try

@bors
Copy link
Contributor

bors commented Aug 5, 2020

⌛ Trying commit 40db56c with merge d85ecff64d4ec32056a636d93cc8427a25ef742d...

@rust-lang rust-lang deleted a comment from craterbot Aug 5, 2020
@bors
Copy link
Contributor

bors commented Aug 5, 2020

⌛ Trying commit 40db56c with merge 169954edd744527414c631e9af1bbdc537b0cdf2...

@rust-lang rust-lang deleted a comment from craterbot Aug 5, 2020
@bors
Copy link
Contributor

bors commented Aug 5, 2020

☀️ Try build successful - checks-actions, checks-azure
Build commit: 169954edd744527414c631e9af1bbdc537b0cdf2 (169954edd744527414c631e9af1bbdc537b0cdf2)

@joshtriplett
Copy link
Member

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-75192 created and queued.
🤖 Automatically detected try build 169954edd744527414c631e9af1bbdc537b0cdf2
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 5, 2020
@crlf0710 crlf0710 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Aug 21, 2020
@craterbot
Copy link
Collaborator

🚧 Experiment pr-75192 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-75192 is completed!
📊 11 regressed and 4 fixed (116161 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 29, 2020
@nagisa
Copy link
Member

nagisa commented Aug 31, 2020

Looks like there may be some genuine regressions in there (most notably about crates using a (same? didn’t check) structure as an argument, where the structure is defined twice. Some others are genuine problems in the crates themselves. Some others are signal 9s (probably OOMs or out-of-times).

@jumbatm
Copy link
Contributor Author

jumbatm commented Sep 1, 2020

I took a closer look at the regressed (by clashing_extern_declarations) crates. As a summary:

Given these results, and some further reflection, I don't think we should proceed with making clashing_extern_declarations deny because

  • It would break builds using generated code (until tools like bindgen were updated, anyway)
  • Without knowing the behaviour of the external C code, I feel like we don't really have all the information we need to warrant erroring out the build -- gli being an example of this

Thinking about this more, I also realise the user doesn't really get any more value out of making the lint deny-by-default: as a warning, the lint already pushes the user to fix mistakes in the extern function declaration or allow the clash if they know it's safe.

For these reasons, I'm going to close this PR. Feel free to re-open -- I'm happy to discuss further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants