Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upDecouple proc_macro from the rest of the compiler. #49219
Conversation
rust-highfive
assigned
alexcrichton
Mar 20, 2018
rust-highfive
added
the
S-waiting-on-review
label
Mar 20, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors try |
This comment has been minimized.
This comment has been minimized.
|
|
eddyb
force-pushed the
eddyb:proc-macro-decouple
branch
from
67f317e
to
6e63e8d
Mar 20, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors try |
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Mar 20, 2018
eddyb
added
the
S-waiting-on-crater
label
Mar 20, 2018
This comment has been minimized.
This comment has been minimized.
|
cc @rust-lang/infra We shouldn't merge this without a crater run, although you might want to wait on a review as well (then again, the results could inform the review, so whichever comes first). |
This comment has been minimized.
This comment has been minimized.
|
|
Zoxc
reviewed
Mar 21, 2018
|
|
||
| #[unstable(feature = "proc_macro_internals", issue = "27812")] | ||
| #[doc(hidden)] | ||
| pub contents: Term, |
This comment has been minimized.
This comment has been minimized.
Zoxc
Mar 21, 2018
Contributor
Do we want to commit to using interning for literals? I'm not sure interning it terrible useful for that.
This comment has been minimized.
This comment has been minimized.
eddyb
Mar 21, 2018
Author
Member
Wait, I can make these fields private again. Definitely not considering stabilizing any of this.
Zoxc
reviewed
Mar 21, 2018
| @@ -11,3 +11,6 @@ crate-type = ["dylib", "rlib"] | |||
| [dependencies] | |||
| getopts = "0.2" | |||
| term = { path = "../libterm" } | |||
|
|
|||
| # not actually used but needed to always have proc_macro in the sysroot | |||
| proc_macro = { path = "../libproc_macro" } | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Could you use something like bincode for data bridging, instead of 800 lines of own code? |
This comment has been minimized.
This comment has been minimized.
|
@bjorn3 I'm not serializing the data (but rather using handles), and I am going to look into simplifying the bridge code, removing most |
This comment has been minimized.
This comment has been minimized.
|
I get it. |
This comment was marked as outdated.
This comment was marked as outdated.
|
Some awesome progress! The "dream" of deleting libserialize is coming ever closer... I'm personally having a lot of trouble following what's going on here though. Would it be possible to add a summary comment to the Perhaps you could detail an example of what happens when a small/example procedural macro is invoked? I'm also a little worried about all the One perhaps larger-than-intended change here as well is dealing with the standard library itself. Today because |
eddyb
changed the title
Decouple proc_macro from the rest of the compiler.
[WIP] Decouple proc_macro from the rest of the compiler.
Mar 22, 2018
eddyb
force-pushed the
eddyb:proc-macro-decouple
branch
from
6e63e8d
to
cd9ac21
Mar 22, 2018
This comment was marked as outdated.
This comment was marked as outdated.
I tried to have a reassuring comment in the PR description - we can always bootstrap the compiler, it'd just require fixing the ABI incompatibility within the in-tree I will try to address most if not all such issues before merging the PR - see the TODO bit at the end of the description, I've been convinced, since opening the PR, that I should redo some parts of it.
Heh, I tried this and ended up with the weird lists in the PR description, I'll try again once I've mad the code changes I plan to (for now I've also added [WIP] to the PR title).
Did you see the commit where I moved the panic silencing hook from the compiler to |
This comment has been minimized.
This comment has been minimized.
|
Not sure if you wanted perf, or whether this is even helpful, but http://perf.rust-lang.org/compare.html?start=75af15ee6ca0c12b699a17984b033363cd25e9c3&end=c4a77e121949c30306dbbf48259a49c3aeb55028&stat=instructions%3Au |
This comment has been minimized.
This comment has been minimized.
|
@Mark-Simulacrum It doesn't look bad, that's for sure, thanks! If we switch to spawning a thread (or even a process) per invocation it'd warrant another perf run. |
eddyb
force-pushed the
eddyb:proc-macro-decouple
branch
from
cd9ac21
to
76590d8
Mar 23, 2018
Phlosioneer
added a commit
to Phlosioneer/rust
that referenced
this pull request
Mar 25, 2018
This comment has been minimized.
This comment has been minimized.
|
Crater run started |
shepmaster
removed
the
S-waiting-on-review
label
Mar 30, 2018
eddyb
referenced this pull request
Mar 30, 2018
Merged
Reimplement public interface for stability #71
This comment has been minimized.
This comment has been minimized.
|
Hi @eddyb (crater requester), @Zoxc (PR reviewer)! Crater results are at: http://cargobomb-reports.s3.amazonaws.com/pr-49219/index.html. 'Blacklisted' crates (spurious failures etc) can be found here. If you see any spurious failures not on the list, please make a PR against that file. (interested observers: Crater is a tool for testing the impact of changes on the crates.io ecosystem. You can find out more at the repo if you're curious) |
eddyb
added some commits
Nov 27, 2018
eddyb
force-pushed the
eddyb:proc-macro-decouple
branch
from
329e4b8
to
3a04d44
Nov 30, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added
S-waiting-on-bors
and removed
S-waiting-on-review
labels
Nov 30, 2018
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Nov 30, 2018
This comment has been minimized.
This comment has been minimized.
|
|
bors
merged commit 3a04d44
into
rust-lang:master
Nov 30, 2018
This was referenced Nov 30, 2018
This comment has been minimized.
This comment has been minimized.
|
I can't believe you've done this! |
eddyb commentedMar 20, 2018
•
edited
This PR removes all dependencies of
proc_macroon compiler crates and allows multiple copies ofproc_macro, built even by different compilers (but from the same source), to interoperate.Practically, it allows:
-fulldepsto the regular suites)On the server (i.e. compiler front-end) side:
server::*traits are implemented to provide the concrete types and methodsproc_macropublic APIServeris to be passed toClient::runOn the client (i.e. proc macro) side (potentially using a different
proc_macroinstance!):client::Clientwraps around client-side (expansion) function pointersproc_macroinstance used by the clientrunmethod can be called by a server, to execute the client-side functioncurrently a thread is spawned, could use process isolation in the future(not the case anymore, see #56058)
staticholding a&[ProcMacro]ProcMacrocontains an appropriately typedClient<fn(...) -> ...>proc_macropublic APIs call into the server via an internal "bridge":Clientcan interact with those APIsproc_macroinstance)runits ownClient, but that may be inefficientbridgeuses serialization, C ABI and integer handles to avoid Rust ABI instabilityproc_macrohandlesr? @alexcrichton cc @jseyfried @nikomatsakis @Zoxc @thepowersgang