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

Deprecate using rustc_plugin without the rustc_driver dylib. #62727

Merged
merged 1 commit into from
Aug 20, 2019

Conversation

SimonSapin
Copy link
Contributor

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 16, 2019
@eddyb
Copy link
Member

eddyb commented Jul 16, 2019

r? @Zoxc

@rust-highfive rust-highfive assigned Zoxc and unassigned petrochenkov Jul 16, 2019
@Zoxc
Copy link
Contributor

Zoxc commented Jul 16, 2019

How does this trickery work?

@Centril
Copy link
Contributor

Centril commented Jul 16, 2019

At this point I think we should look to remove the plugin support from rustc.

@SimonSapin
Copy link
Contributor Author

@Zoxc Do you mean this PR?

At first I tried adding #![rustc_deprecated] to the rustc_plugin crate so that depending on it directly causes a warning. But that caused every item to be deprecated as well. So instead this PR renames the crate to rustc_plugin_ (note the suffix, I was not inspired for another name) and creates a new crate with the old name that reexports all of its items. Only the new crate is deprecated.

Or do you mean the bug that it fixes? I’m not sure exactly. It looks like on Windows and macOS, failing to depend on the appropriate dylib crate results in there being two copies of a TLS variable or something. You found the same work-around in 7198687.


@Centril On one hand, we’ve arguably already been at that point for a couple years. On the other hand, Servo’s memory safety unfortunately still depends on a custom lint that checks that GC pointers on the stack are properly rooted: https://github.com/servo/servo/tree/cef98d2e5179/components/script_plugins

I would love to find another solution, this plugin is regularly giving us headaches. But until we do, if the plugin API is removed Servo will be unable to upgrade and will be stuck on an old Rust Nightly.

@Centril
Copy link
Contributor

Centril commented Jul 21, 2019

@Centril On one hand, we’ve arguably already been at that point for a couple years. On the other hand, Servo’s memory safety unfortunately still depends on a custom lint that checks that GC pointers on the stack are properly rooted: https://github.com/servo/servo/tree/cef98d2e5179/components/script_plugins

I would love to find another solution, this plugin is regularly giving us headaches. But until we do, if the plugin API is removed Servo will be unable to upgrade and will be stuck on an old Rust Nightly.

So there has been no movement since last time we discussed this. That's unfortunate. At some point however, I think it stops being reasonable for rustc to indefinitely maintain the plugin interface solely for the benefit of servo. What would it take to get rid of your reliance on this?

@SimonSapin
Copy link
Contributor Author

What would it take to get rid of your reliance on this?

I’ve opened #62868 to discuss this, as I feel it doesn’t need to block this PR.

@SimonSapin
Copy link
Contributor Author

@Zoxc friendly review ping

@bors
Copy link
Contributor

bors commented Jul 27, 2019

☔ The latest upstream changes (presumably #62086) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Jul 27, 2019

☔ The latest upstream changes (presumably #63029) made this pull request unmergeable. Please resolve the merge conflicts.

@JohnTitor
Copy link
Member

Ping from triage: @Zoxc, waiting on your review. And @SimonSapin, you should resolve merge conflicts.

@joelpalmer
Copy link

Ping from triage: @Zoxc, any update on the review?

@SimonSapin
Copy link
Contributor Author

@rust-lang/compiler, can anyone else review this?

@petrochenkov
Copy link
Contributor

r? @petrochenkov

@rust-highfive rust-highfive assigned petrochenkov and unassigned Zoxc Aug 19, 2019
doctest = false

[dependencies]
rustc_plugin_ = { path = ".." }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this compatibility shim is necessary.
rustc_plugin is almost unused at this point, so it should be ok to make people to migrate to rustc_driver::plugin in one step.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s fair, but now that the shim is already implemented it’s the same amount of work to remove it now or later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is merged now, I'll have to make a PR removing it myself once this PR lands, I don't want to do that + I'd prefer some pointless back and forth to not exist in git history.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see, Cargo uses it, and we cannot land this PR with broken cargo.
Ok, let's land this with the shim.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking extern crate rustc_plugin; in the same PR as we make its replacement available means that Clippy and RLS will be broken for a few Nightlies until we can get the multi-repo coordination dance together. This doesn’t sound great when it’s easily avoided.

If you’d like I can be on the hook for making the follow-up PR that removes the deprecated shim later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you’d like I can be on the hook for making the follow-up PR that removes the deprecated shim later.

Yeah, that would be great.

@petrochenkov
Copy link
Contributor

@SimonSapin
Could you

  • rename rustc_plugin_ into rustc_plugin_impl
  • check whether some docs in this repo (like unstable book or something) still mention rustc_plugin

Otherwise this looks good.

@petrochenkov petrochenkov 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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 19, 2019
@SimonSapin
Copy link
Contributor Author

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Aug 19, 2019

📌 Commit d0bbc60 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 19, 2019
@bors
Copy link
Contributor

bors commented Aug 20, 2019

⌛ Testing commit d0bbc60 with merge d8d99ba...

bors added a commit that referenced this pull request Aug 20, 2019
Deprecate using rustc_plugin without the rustc_driver dylib.

CC #59800, 7198687

Fix #62717
@bors
Copy link
Contributor

bors commented Aug 20, 2019

☀️ Test successful - checks-azure
Approved by: petrochenkov
Pushing d8d99ba to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 20, 2019
@bors bors merged commit d0bbc60 into rust-lang:master Aug 20, 2019
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #62727!

Tested on commit d8d99ba.
Direct link to PR: #62727

💔 rls on windows: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Aug 20, 2019
Tested on commit rust-lang/rust@d8d99ba.
Direct link to PR: <rust-lang/rust#62727>

💔 rls on windows: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).
bors added a commit to rust-lang/rust-clippy that referenced this pull request Aug 20, 2019
Import rustc_plugin from its new location

Depends on rust-lang/rust#62727

changelog: none
@SimonSapin SimonSapin deleted the plugins-tls-dylib branch August 20, 2019 11:03
SimonSapin added a commit to SimonSapin/rust that referenced this pull request Aug 20, 2019
It was accidentally removed in a rebase of rust-lang#62727

Fixes rust-lang#63729
Centril added a commit to Centril/rust that referenced this pull request Aug 20, 2019
Restore the rustc_plugin crate in the sysroot

It was accidentally removed in a rebase of rust-lang#62727

Fixes rust-lang#63729 (rls build failure)
Centril added a commit to Centril/rust that referenced this pull request Aug 20, 2019
Restore the rustc_plugin crate in the sysroot

It was accidentally removed in a rebase of rust-lang#62727

Fixes rust-lang#63729 (rls build failure)
Centril added a commit to Centril/rust that referenced this pull request Aug 20, 2019
Restore the rustc_plugin crate in the sysroot

It was accidentally removed in a rebase of rust-lang#62727

Fixes rust-lang#63729 (rls build failure)
SimonSapin added a commit to SimonSapin/rls that referenced this pull request Aug 22, 2019
denisandroid added a commit to clucompany/cluCStr that referenced this pull request Aug 22, 2019
SimonSapin added a commit to SimonSapin/cargo that referenced this pull request Aug 24, 2019
bors added a commit to rust-lang/cargo that referenced this pull request Aug 24, 2019
Tests: Import rustc_plugin from its new location

CC rust-lang/rust#62727
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Nov 19, 2019
rustc_plugin: Remove the compatibility shim

The compatibility crate was introduced in rust-lang#62727 to migrate Cargo and some other tools, but now it's no longer necessary.
Centril added a commit to Centril/rust that referenced this pull request Nov 20, 2019
rustc_plugin: Remove the compatibility shim

The compatibility crate was introduced in rust-lang#62727 to migrate Cargo and some other tools, but now it's no longer necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE "no ImplicitCtxt stored in tls" in Servo on Windows and macOS
9 participants