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

Skip linking if it is not required #81118

Merged
merged 1 commit into from
Jan 20, 2021
Merged

Conversation

ojeda
Copy link
Contributor

@ojeda ojeda commented Jan 17, 2021

This allows to use --emit=metadata,obj and other metadata + non-link combinations.

Fixes #81117.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ecstatic-morse (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 17, 2021
@ojeda
Copy link
Contributor Author

ojeda commented Jan 17, 2021

The added should_link() looked like the right local fix, but someone with more knowledge around other should_codegen() callers should probably take a look.

@nagisa
Copy link
Member

nagisa commented Jan 17, 2021

This seems reasonable enough. Thank you!

@bors r+

@bors
Copy link
Contributor

bors commented Jan 17, 2021

📌 Commit b7ba8b8c50367d43d930d86902f3fc3af9b2943f has been approved by nagisa

@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-review Status: Awaiting review from the assignee but also interested parties. labels Jan 17, 2021
This allows to use `--emit=metadata,obj` and other metadata
+ non-link combinations.

Fixes rust-lang#81117.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.channel         := nightly
configure: rust.debug-assertions := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
configure: 
---
skip untracked path cpu-usage.csv during rustfmt invocations
skip untracked path src/doc/book/ during rustfmt invocations
skip untracked path src/doc/rust-by-example/ during rustfmt invocations
skip untracked path src/llvm-project/ during rustfmt invocations
Diff in /checkout/compiler/rustc_codegen_ssa/src/back/link.rs at line 123:
             };
 
 
-            if sess.opts.output_types.should_link()
-                && !preserve_objects_for_their_debuginfo(sess)
-            {
+            if sess.opts.output_types.should_link() && !preserve_objects_for_their_debuginfo(sess) {
                 for module in &codegen_results.modules {
                     remove_temps_from_module(module);
                 }
Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt" "--config-path" "/checkout" "--edition" "2018" "--unstable-features" "--skip-children" "--check" "/checkout/compiler/rustc_codegen_ssa/src/back/link.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
Build completed unsuccessfully in 0:00:14

@ojeda
Copy link
Contributor Author

ojeda commented Jan 17, 2021

Thanks to you! That was a quick review. :)

Fixed the formatting.

@nagisa
Copy link
Member

nagisa commented Jan 17, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Jan 17, 2021

📌 Commit f9275e1 has been approved by nagisa

@bors
Copy link
Contributor

bors commented Jan 20, 2021

⌛ Testing commit f9275e1 with merge a4cbb44...

@bors
Copy link
Contributor

bors commented Jan 20, 2021

☀️ Test successful - checks-actions
Approved by: nagisa
Pushing a4cbb44 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 20, 2021
@bors bors merged commit a4cbb44 into rust-lang:master Jan 20, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 20, 2021
@ojeda ojeda deleted the metadata-obj branch January 20, 2021 12:14
ojeda added a commit to Rust-for-Linux/linux that referenced this pull request Jan 21, 2021
It allows us to save a bit of space, ignore the duplicate object files,
and the archiving steps; e.g.:

      643544 libcompiler_builtins.rlib
    64171752 libcore.rlib

vs.

      530004 libcompiler_builtins.rmeta
    63679866 libcore.rmeta

We couldn't do it right away in [1] because `rustc` required a fix [2,3].
The fix is now in [4] and available since the 2021-01-21 nightly, so now
we can go ahead and make the change.

Fixes #75.

[1] #52
[2] rust-lang/rust#81117
[3] rust-lang/rust#81118
[4] rust-lang/rust@f9275e1

Suggested-by: bjorn3
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
ojeda added a commit to Rust-for-Linux/linux that referenced this pull request Jan 21, 2021
It allows us to save a bit of space, ignore the duplicate object files,
and the archiving steps; e.g.:

      643544 libcompiler_builtins.rlib
    64171752 libcore.rlib

vs.

      530004 libcompiler_builtins.rmeta
    63679866 libcore.rmeta

We couldn't do it right away in [1] because `rustc` required a fix [2,3].
The fix is now in [4] and available since the 2021-01-21 nightly, so now
we can go ahead and make the change.

Fixes #75.

[1] #52
[2] rust-lang/rust#81117
[3] rust-lang/rust#81118
[4] rust-lang/rust@f9275e1

Suggested-by: bjorn3
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
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.

Cannot emit metadata,obj without link
7 participants