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

Cleanup for "Support compiling rustc without LLVM (try 2)" #43842

Merged
merged 7 commits into from
Aug 14, 2017

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Aug 13, 2017

This includes a small patch to allow running tests without llvm. Also check if you are not trying to compile a dylib.

cc #42932
r? @alexcrichton

unreachable!();
}

#[cfg(feature="llvm")]
Ok((outputs, trans))
})??
};

#[cfg(not(feature="llvm"))]
Copy link
Member

Choose a reason for hiding this comment

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

Is this #[cfg] still necessary with the lint allow directive above? Maybe it could just be a if cfg!?

}
}
if suite == "run-make" && !build.config.llvm_enabled {
println!("Ignoring run-make test suite");
Copy link
Member

Choose a reason for hiding this comment

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

Let's add some context to the message stating why it's being ignored.

// We need nested scopes here, because the intermediate results can keep
// large chunks of memory alive and we want to free them as soon as
// possible to keep the peak memory usage low
let (outputs, trans): (OutputFilenames, OngoingCrateTranslation) = {
let (outputs, trans): (OutputFilenames, write::OngoingCrateTranslation) = {
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we continue importing OngoingCrateTranslation above? Seems odd; we have allow(dead_code) already as far as I can tell...

@alexcrichton
Copy link
Member

This is looking like a great strategy to me, thanks @bjorn3!

@@ -73,11 +71,6 @@ pub fn compile_input(sess: &Session,
output: &Option<PathBuf>,
addl_plugins: Option<Vec<String>>,
control: &CompileController) -> CompileResult {
#[cfg(feature="llvm")]
use rustc_trans::back::write::OngoingCrateTranslation;
Copy link
Member

Choose a reason for hiding this comment

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

[00:15:02] error[E0412]: cannot find type `OngoingCrateTranslation` in this scope
[00:15:02]    --> /checkout/src/librustc_driver/driver.rs:110:45
[00:15:02]     |
[00:15:02] 110 |     let (outputs, trans): (OutputFilenames, OngoingCrateTranslation) = {
[00:15:02]     |                                             ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
[00:15:02]     |
[00:15:02] help: possible candidate is found in another module, you can import it into scope
[00:15:02]     |
[00:15:02] 73  |                      control: &CompileController) -> CompileResult use rustc_trans::back::write::OngoingCrateTranslation;
[00:15:02]     |
[00:15:02] 
[00:15:03] error: aborting due to previous error
[00:15:03] 
[00:15:03] error: Could not compile `rustc_driver`.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 13, 2017

📌 Commit 005bc2c has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Aug 14, 2017

⌛ Testing commit 005bc2c with merge e324594...

bors added a commit that referenced this pull request Aug 14, 2017
Cleanup for "Support compiling rustc without LLVM (try 2)"

This includes a small patch to allow running tests without llvm. Also check if you are not trying to compile a dylib.

cc #42932
r? @alexcrichton
@bors
Copy link
Contributor

bors commented Aug 14, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing e324594 to master...

@bors bors merged commit 005bc2c into rust-lang:master Aug 14, 2017
@bjorn3 bjorn3 deleted the no_llvm_cleanup branch August 14, 2017 09:44
return;
}

if suite != "run-make" {
Copy link
Contributor

Choose a reason for hiding this comment

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

This "run-make" string appears at least 3 times; maybe it would be worth making it a named constant?

Copy link
Member

Choose a reason for hiding this comment

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

I'd be happy to see a PR which moved all the suites to an enum. I'm not sure that the diff would look good, but if it does seems like a good improvement. Please file an issue if you'd like to implement something like that.

@bjorn3 bjorn3 mentioned this pull request Aug 25, 2017
3 tasks
bors added a commit that referenced this pull request Sep 25, 2017
Allow writing metadata without llvm

# Todo:

* [x] Rebase
* [x] Fix eventual errors
* [x] <strike>Find some crate to write elf files</strike> (will do it later)

Cc #43842
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