-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add rustc_trans to x.py check #49890
Conversation
Ideally we'd only do this if we could skip the LLVM build, otherwise I don't know that it's all that useful. Could you remove the LLVM build from check (and maybe make sure you don't have a pre-built LLVM we could be linking to) and see if that works? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should work, and we probably can't easily jettison the LLVM build, so we'll just leave it in at least for now.
src/bootstrap/check.rs
Outdated
_ => panic!("unknown backend: {}", self.backend), | ||
} | ||
|
||
let tmp_stamp = build.cargo_out(compiler, Mode::Librustc, target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might want to be different so we don't end up causing spurious rebuilds or lack thereof for non-check builds (cc @alexcrichton).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good point! Fixed.
Hm it looks like there's a lot of code duplication here? Could that be shared between the normal build step and the check one? |
Hmm, I could pull the LLVM code out, which is identical. There are other scattered duplicated lines, but they might be too fragmented to make abstracting them worthwhile. |
Yes this instantiation looks fine. I'm not sure whether it interacts well with rebuilds, I think you'd need to test locally for that |
@alexcrichton: testing both |
@alexcrichton, @Mark-Simulacrum: Friendly triage ping, what is the status of this? |
@bors: r+ |
📌 Commit 7e2daf1 has been approved by |
⌛ Testing commit 7e2daf1f1048fbe6515b2672636a6ee2adf74618 with merge 536d0631111fe60dbc6122242a427d3e59728ca9... |
💔 Test failed - status-travis |
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
1 similar comment
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
I can't tell if this is a problem with my change or not — the errors are coming from LLVM, but perhaps the refactoring broke something? What do you think @alexcrichton? |
I believe this is the mingw-check bot added recently which doesn't have the necessary prerequisites to build LLVM. When that's being executed I believe the intention was to entirely skip compilation of LLVM as it's not needed anyway if we're just running |
The difficulty I had was with the Is there a way around this, or might it be best to opt out of checking |
Yeah that script will need to be stubbed out in check mode. We don't actually link anything when checking so there's no need for LLVM to exist. |
7e2daf1
to
61b78e0
Compare
I've added a |
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
☔ The latest upstream changes (presumably #49972) made this pull request unmergeable. Please resolve the merge conflicts. |
This deduplicates the LLVM building functionality from compile.rs and check.rs.
7783ed1
to
84f52a7
Compare
@alexcrichton: looks like this is passing the mingw-check tests now :) |
let compiler = builder.compiler(0, builder.config.build); | ||
let target = self.target; | ||
let backend = self.backend; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to clear_if_dirty
anything here (or add this to the clear_if_dirty
sections of any of the other steps)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe? If it in general works I wouldn't worry too much, we can patch it in later.
@@ -28,6 +28,11 @@ fn detect_llvm_link() -> (&'static str, &'static str) { | |||
} | |||
|
|||
fn main() { | |||
if env::var_os("RUST_CHECK").is_some() { | |||
// If we're just running `check`, there's no need for LLVM to be built. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this print out rerun-if-env-changed
to automatically detect when this is altered?
@bors: r+ |
📌 Commit 86acb09 has been approved by |
Add rustc_trans to x.py check r? @Mark-Simulacrum I looked at `bootstrap/compile.rs` and `bootstrap/check.rs` to try to work out which steps were appropriate, but I'm sure I've overlooked some details here, so it's worth checking carefully I've got all the steps right (e.g. I wasn't sure whether we want to build LLVM if necessary with `x.py check`, though I thought it was probably better to than to not). From a quick test, it seems to be working, though.
☀️ Test successful - status-appveyor, status-travis |
r? @Mark-Simulacrum
I looked at
bootstrap/compile.rs
andbootstrap/check.rs
to try to work out which steps were appropriate, but I'm sure I've overlooked some details here, so it's worth checking carefully I've got all the steps right (e.g. I wasn't sure whether we want to build LLVM if necessary withx.py check
, though I thought it was probably better to than to not).From a quick test, it seems to be working, though.