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

Improve verify_llvm_ir config option #55031

Merged
merged 1 commit into from
Oct 18, 2018
Merged

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Oct 13, 2018

LLVM IR verification has been disabled by default in #51230. However, the implementation doesn't quite match what was discussed in the discussion. This patch implements two changes:

  • Make verify_llvm_ir influence the behavior of the compiled rustc binary, rather than just the rustc build system. That is, if verify_llvm_ir=true, even manual invocations of the built rustc will verify LLVM IR.
  • Enable verification of LLVM IR in CI, for non-deploy and deploy-alt builds. This is similar to how LLVM assertions are handled.

@rust-highfive
Copy link
Collaborator

r? @cramertj

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 13, 2018
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

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

Looks good with the nit fixed, r=me

fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-env-changed=CFG_LIBDIR_RELATIVE");
println!("cargo:rerun-if-env-changed=CFG_COMPILER_HOST_TRIPLE");

if env::var_os("RUSTC_VERIFY_LLVM_IR").is_some() {
Copy link
Member

Choose a reason for hiding this comment

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

You'll want to also add a rerun if env changed directive here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

* Make it influence the behavior of the compiled rustc, rather than
  just the rustc build system. That is, if verify_llvm_ir=true,
  even manual invocations of the built rustc will verify LLVM IR.
* Enable verification of LLVM IR in CI, for non-deploy and
  deploy-alt builds. This is similar to how LLVM assertions are
  handled.
@cramertj
Copy link
Member

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Oct 15, 2018

📌 Commit b57366a has been approved by Mark-Simulacrum

@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 Oct 15, 2018
@bors
Copy link
Contributor

bors commented Oct 16, 2018

⌛ Testing commit b57366a with merge 7ddca6c42002db902e65545481b37d3e9b5eafc4...

@bors
Copy link
Contributor

bors commented Oct 16, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 16, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-distcheck of 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.
[00:01:21] configure: 
[00:01:21] configure: rust.debug-assertions := True
[00:01:21] configure: rust.ignore-git      := False
[00:01:21] configure: build.print-step-timings := True
[00:01:21] configure: rust.verify-llvm-ir  := True
[00:01:21] configure: llvm.assertions      := True
[00:01:21] configure: build.locked-deps    := True
[00:01:21] configure: llvm.ccache          := sccache
[00:01:21] configure: build.openssl-static := True
---
[00:14:55] configure: 
[00:14:55] configure: rust.debug-assertions := True
[00:14:55] configure: rust.ignore-git      := False
[00:14:55] configure: build.print-step-timings := True
[00:14:55] configure: rust.verify-llvm-ir  := True
[00:14:55] configure: build.submodules     := False
[00:14:55] configure: llvm.assertions      := True
[00:14:55] configure: build.locked-deps    := True
[00:14:55] configure: llvm.ccache          := sccache
---
[02:22:10] warning: spurious network error (2 tries remaining): curl error: Could not resolve host: github.com
[02:22:10] ; class=Net (12)
[02:22:31] warning: spurious network error (1 tries remaining): curl error: Could not resolve host: github.com
[02:22:31] ; class=Net (12)
[02:22:51] error: failed to load source for a dependency on `rand`
[02:22:51] Caused by:
[02:22:51]   Unable to update registry `https://github.com/rust-lang/crates.io-index`
[02:22:51] 
[02:22:51] Caused by:
[02:22:51] Caused by:
[02:22:51]   failed to fetch `https://github.com/rust-lang/crates.io-index`
[02:22:51] 
[02:22:51] Caused by:
[02:22:51]   curl error: Could not resolve host: github.com
[02:22:51] ; class=Net (12)
[02:22:51] 
[02:22:51] 
[02:22:51] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "generate-lockfile" "--manifest-path" "/checkout/obj/build/tmp/distcheck-src/rust-src/lib/rustlib/src/rust/src/libstd/Cargo.toml"
[02:22:51] 
[02:22:51] 
[02:22:51] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test distcheck
[02:22:51] Build completed unsuccessfully in 2:19:42
---
travis_time:end:0108fa8e:start=1539673356022073514,finish=1539673356030718510,duration=8644996
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:18881eac
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0d5eff60
travis_time:start:0d5eff60
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0ba58860
$ dmesg | grep -i kill

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 @TimNN. (Feature Requests)

@kennytm
Copy link
Member

kennytm commented Oct 16, 2018

@bors retry travis-ci/travis-ci#9696

@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 Oct 16, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Oct 18, 2018
…crum

Improve verify_llvm_ir config option

LLVM IR verification has been disabled by default in rust-lang#51230. However, the implementation doesn't quite match what was discussed in the discussion. This patch implements two changes:

* Make `verify_llvm_ir` influence the behavior of the compiled rustc binary, rather than just the rustc build system. That is, if `verify_llvm_ir=true`, even manual invocations of the built rustc will verify LLVM IR.
* Enable verification of LLVM IR in CI, for non-deploy and deploy-alt builds. This is similar to how LLVM assertions are handled.
bors added a commit that referenced this pull request Oct 18, 2018
Rollup of 18 pull requests

Successful merges:

 - #54646 (improve documentation on std::thread::sleep)
 - #54933 (Cleanup the rest of codegen_llvm)
 - #54964 (Run both lldb and gdb tests)
 - #55016 (Deduplicate some code and compile-time values around vtables)
 - #55031 (Improve verify_llvm_ir config option)
 - #55050 (doc std::fmt: the Python inspiration is already mentioned in precedin…)
 - #55077 (rustdoc: Use dyn keyword when rendering dynamic traits)
 - #55080 (Detect if access to localStorage is forbidden by the user's browser)
 - #55090 (regression test for move out of borrow via pattern)
 - #55102 (resolve: Do not skip extern prelude during speculative resolution)
 - #55104 (Add test for #34229)
 - #55111 ([Rustc Book] Explain --cfg's arguments)
 - #55122 (Cleanup mir/borrowck)
 - #55127 (Remove HybridBitSet::dummy)
 - #55128 (Fix LLVMRustInlineAsmVerify return type mismatch)
 - #55142 (miri: layout should not affect CTFE checks (outside of validation))
 - #55151 (Cleanup nll)
 - #55161 ([librustdoc] Disable spellcheck for search field)
@bors bors merged commit b57366a into rust-lang:master Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants