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

Save metadata even with -Z no-trans (e.g. for multi-crate cargo check). #33602

Merged
merged 8 commits into from
May 25, 2016

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented May 12, 2016

Removes the item symbol map in metadata, as we can now generate them in a deterministic manner.
The -Z no-trans change lets the LLVM passes and linking run, but with just metadata and no code.
It fails while trying to link a binary because there's no main function, which is correct but not good UX.

There's also no way to easily throw away all of the artifacts to rebuild with actual code generation.
We might want cargo check to do that using cargo-internal information and then it would just work.

cc @alexcrichton @nikomatsakis @Aatch @michaelwoerister

@rust-highfive
Copy link
Collaborator

r? @jroesch

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

@michaelwoerister
Copy link
Member

I'm going to review this right now..

@michaelwoerister
Copy link
Member

@bors: r+

Perfect, @eddyb!

@bors
Copy link
Contributor

bors commented May 12, 2016

📌 Commit adee551 has been approved by michaelwoerister

@eddyb
Copy link
Member Author

eddyb commented May 13, 2016

@eddyb
Copy link
Member Author

eddyb commented May 13, 2016

@bors r=michaelwoerister d'oh this PR wasn't even in the rollup 😫

@bors
Copy link
Contributor

bors commented May 13, 2016

📌 Commit adee551 has been approved by michaelwoerister

eddyb added a commit to eddyb/rust that referenced this pull request May 13, 2016
…rister

Save metadata even with -Z no-trans (e.g. for multi-crate cargo check).

Removes the item symbol map in metadata, as we can now generate them in a deterministic manner.
The `-Z no-trans` change lets the LLVM passes and linking run, but with just metadata and no code.
It fails while trying to link a binary because there's no `main` function, which is correct but not good UX.

There's also no way to easily throw away all of the artifacts to rebuild with actual code generation.
We might want `cargo check` to do that using cargo-internal information and then it would just work.

cc @alexcrichton @nikomatsakis @Aatch @michaelwoerister
@eddyb
Copy link
Member Author

eddyb commented May 13, 2016

@bors rollup-

@bors
Copy link
Contributor

bors commented May 14, 2016

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

@eddyb
Copy link
Member Author

eddyb commented May 14, 2016

@bors r=michaelwoerister

@bors
Copy link
Contributor

bors commented May 14, 2016

📌 Commit 5087556 has been approved by michaelwoerister

@eddyb
Copy link
Member Author

eddyb commented May 14, 2016

Oh wait I didn't fix the failure in @alexcrichton's test.

@bors r-

@eddyb
Copy link
Member Author

eddyb commented May 14, 2016

@bors r=michaelwoerister

@bors
Copy link
Contributor

bors commented May 14, 2016

📌 Commit d2ded31 has been approved by michaelwoerister

@bors
Copy link
Contributor

bors commented May 15, 2016

⌛ Testing commit d2ded31 with merge 33a8175...

@bors
Copy link
Contributor

bors commented May 25, 2016

💔 Test failed - auto-linux-64-opt-rustbuild

@eddyb
Copy link
Member Author

eddyb commented May 25, 2016

@bors r=michaelwoerister

@bors
Copy link
Contributor

bors commented May 25, 2016

📌 Commit a619901 has been approved by michaelwoerister

@bors
Copy link
Contributor

bors commented May 25, 2016

⌛ Testing commit a619901 with merge 5229e0e...

bors added a commit that referenced this pull request May 25, 2016
Save metadata even with -Z no-trans (e.g. for multi-crate cargo check).

Removes the item symbol map in metadata, as we can now generate them in a deterministic manner.
The `-Z no-trans` change lets the LLVM passes and linking run, but with just metadata and no code.
It fails while trying to link a binary because there's no `main` function, which is correct but not good UX.

There's also no way to easily throw away all of the artifacts to rebuild with actual code generation.
We might want `cargo check` to do that using cargo-internal information and then it would just work.

cc @alexcrichton @nikomatsakis @Aatch @michaelwoerister
@bors bors merged commit a619901 into rust-lang:master May 25, 2016
@eddyb eddyb deleted the no-trans--check branch May 25, 2016 14:23
bors added a commit that referenced this pull request Jun 22, 2016
…haelwoerister

Drive trans from the output of the translation item collector

This PR changes the way how translation works above the item level. Instead of walking the HIR and calling `trans_item()` on everything encountered (while instantiating monomorphizations on-demand), we now just process the list of translation items generated by the `trans::collector`. Using the collector has the benefit of being able to know the exact set of monomorphizations and symbols before actually running translation, something that is crucial for incremental compilation (but also has [other benefits](#33602)).

The collector has existed for quite a while now, but so far it's output was only used for running some auto-tests. With this PR it becomes the only source of truth about what gets translated.

One modification we had to make, compared to the initial approach, is that closures are not represented as their own `TransItems`. Doing so, while still supporting non-MIR-based translation, would have been prohibitively complex, and not worth the trouble since legacy-trans will disappear sooner or later. Once there is solely MIR-trans, it would be a good idea to make closures `TransItems` again.

This PR removes the most obvious functions and tables that are not needed anymore, but there's definitely still more cleanup possible later on (e.g. `monomorphize::monomorphic_fn()` does very little at this point). Since there are already more than 10 commits in here, doing this in a separate PR seems to be a better idea.

These changes definitely warrant a crater run.

Thanks @Aatch, for taking on one of the more tedious tasks during the dev-sprint!
Thanks @eddyb, for doing some nice refactorings to symbol name generation and making sure these landed so I could use them!

cc @rust-lang/compiler
cc @rust-lang/tools
bors added a commit that referenced this pull request Jun 28, 2016
Drive trans from the output of the translation item collector

This PR changes the way how translation works above the item level. Instead of walking the HIR and calling `trans_item()` on everything encountered (while instantiating monomorphizations on-demand), we now just process the list of translation items generated by the `trans::collector`. Using the collector has the benefit of being able to know the exact set of monomorphizations and symbols before actually running translation, something that is crucial for incremental compilation (but also has [other benefits](#33602)).

The collector has existed for quite a while now, but so far it's output was only used for running some auto-tests. With this PR it becomes the only source of truth about what gets translated.

One modification we had to make, compared to the initial approach, is that closures are not represented as their own `TransItems`. Doing so, while still supporting non-MIR-based translation, would have been prohibitively complex, and not worth the trouble since legacy-trans will disappear sooner or later. Once there is solely MIR-trans, it would be a good idea to make closures `TransItems` again.

This PR removes the most obvious functions and tables that are not needed anymore, but there's definitely still more cleanup possible later on (e.g. `monomorphize::monomorphic_fn()` does very little at this point). Since there are already more than 10 commits in here, doing this in a separate PR seems to be a better idea.

These changes definitely warrant a crater run.

Thanks @Aatch, for taking on one of the more tedious tasks during the dev-sprint!
Thanks @eddyb, for doing some nice refactorings to symbol name generation and making sure these landed so I could use them!

cc @rust-lang/compiler
cc @rust-lang/tools
bors added a commit that referenced this pull request Jul 8, 2016
Drive trans from the output of the translation item collector

This PR changes the way how translation works above the item level. Instead of walking the HIR and calling `trans_item()` on everything encountered (while instantiating monomorphizations on-demand), we now just process the list of translation items generated by the `trans::collector`. Using the collector has the benefit of being able to know the exact set of monomorphizations and symbols before actually running translation, something that is crucial for incremental compilation (but also has [other benefits](#33602)).

The collector has existed for quite a while now, but so far it's output was only used for running some auto-tests. With this PR it becomes the only source of truth about what gets translated.

One modification we had to make, compared to the initial approach, is that closures are not represented as their own `TransItems`. Doing so, while still supporting non-MIR-based translation, would have been prohibitively complex, and not worth the trouble since legacy-trans will disappear sooner or later. Once there is solely MIR-trans, it would be a good idea to make closures `TransItems` again.

This PR removes the most obvious functions and tables that are not needed anymore, but there's definitely still more cleanup possible later on (e.g. `monomorphize::monomorphic_fn()` does very little at this point). Since there are already more than 10 commits in here, doing this in a separate PR seems to be a better idea.

These changes definitely warrant a crater run.

Thanks @Aatch, for taking on one of the more tedious tasks during the dev-sprint!
Thanks @eddyb, for doing some nice refactorings to symbol name generation and making sure these landed so I could use them!

cc @rust-lang/compiler
cc @rust-lang/tools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants