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

std: Use backtrace-sys from crates.io #56836

Merged
merged 1 commit into from
Dec 25, 2018

Conversation

alexcrichton
Copy link
Member

This commit switches the standard library to using the backtrace-sys
crate from crates.io instead of duplicating the logic here in the Rust
repositor with the backtrace-sys's crate's logic.

Eventually this will hopefully be a good step towards using the
backtrace crate directly from crates.io itself, but we're not quite
there yet! Hopefully this is a small incremental first step we can take.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(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 Dec 15, 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.

r=me, with or without the glob import

src/libstd/sys_common/gnu/libbacktrace.rs Outdated Show resolved Hide resolved
@rust-highfive

This comment has been minimized.

@@ -79,67 +67,3 @@ fn main() {
println!("cargo:rustc-link-lib=compiler_rt");
}
}

fn build_libbacktrace(target: &str) -> Result<(), ()> {
let native = native_lib_boilerplate(
Copy link
Contributor

Choose a reason for hiding this comment

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

At least one drawback of this change is that backtrace-sys is no longer built once for all stages, but is built again for each stage.

Copy link
Member Author

Choose a reason for hiding this comment

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

True! Nowadays though it uses the cc crate instead of a configure script, so it's much faster. It's only 4-5 object files ish

@bors

This comment has been minimized.

@alexcrichton
Copy link
Member Author

@bors: r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Dec 15, 2018

📌 Commit 77f2688671ce8b3276ad5db6ed4f63ba8e09b9c2 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 Dec 15, 2018
@rust-highfive

This comment has been minimized.

@alexcrichton
Copy link
Member Author

@bors: r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 15, 2018
@bors

This comment has been minimized.

@alexcrichton
Copy link
Member Author

@bors: r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Dec 17, 2018

📌 Commit 04c35c36e67d01d7bc737fda92f1d1c38bb4e954 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 17, 2018
@nikomatsakis
Copy link
Contributor

r? @Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Dec 20, 2018

⌛ Testing commit 04c35c36e67d01d7bc737fda92f1d1c38bb4e954 with merge 71526eb9a88ebc954cfd41e216a6f270c503a9da...

@bors
Copy link
Contributor

bors commented Dec 20, 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 Dec 20, 2018
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 23, 2018
@bors
Copy link
Contributor

bors commented Dec 23, 2018

⌛ Testing commit d175cac7e2ab2ed0e391219ddb16fd067638fd44 with merge ea3e89bec278e1ff19938eaf00a9454dc9eb8cb2...

@bors
Copy link
Contributor

bors commented Dec 23, 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 Dec 23, 2018
@rust-highfive
Copy link
Collaborator

The job wasm32-unknown 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:49:14] [RUSTC-TIMING] libc test:false 0.104
[00:49:18] [RUSTC-TIMING] compiler_builtins test:false 3.385
[00:49:18]    Compiling alloc v0.0.0 (/checkout/src/liballoc)
[00:49:18]    Compiling rustc-demangle v0.1.10
[00:49:18] error[E0432]: unresolved imports `libc::c_void`, `libc::c_char`, `libc::c_int`, `libc::uintptr_t`
[00:49:18]   |
[00:49:18]   |
[00:49:18] 6 | use libc::{c_void, c_char, c_int, uintptr_t};
[00:49:18]   |            ^^^^^^  ^^^^^^  ^^^^^  ^^^^^^^^^ no `uintptr_t` in the root
[00:49:18]   |            |       |       no `c_int` in the root
[00:49:18]   |            |       no `c_char` in the root
[00:49:18]   |            no `c_void` in the root
[00:49:18] 
---
travis_time:end:1729dfa3:start=1545543838428127534,finish=1545543838436516227,duration=8388693
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:10a1fc24
$ 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:01deeb10
travis_time:start:01deeb10
$ 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:1ed2b2a1
$ 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 kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 23, 2018
@alexcrichton
Copy link
Member Author

@bors: r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Dec 23, 2018

📌 Commit bfc8ed774cf4e442a9090d5d866020ff494b2b8d 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 23, 2018
@bors
Copy link
Contributor

bors commented Dec 24, 2018

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout std-backtrace-sys (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self std-backtrace-sys --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
warning: Cannot merge binary files: Cargo.lock (HEAD vs. heads/homu-tmp)
Auto-merging src/libstd/lib.rs
Removing src/libbacktrace
Auto-merging Cargo.lock
CONFLICT (content): Merge conflict in Cargo.lock
Automatic merge failed; fix conflicts and then commit the result.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 24, 2018
@bors
Copy link
Contributor

bors commented Dec 24, 2018

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout std-backtrace-sys (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self std-backtrace-sys --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
warning: Cannot merge binary files: Cargo.lock (HEAD vs. heads/homu-tmp)
Auto-merging src/libstd/lib.rs
Removing src/libbacktrace
Auto-merging Cargo.lock
CONFLICT (content): Merge conflict in Cargo.lock
Automatic merge failed; fix conflicts and then commit the result.

This commit switches the standard library to using the `backtrace-sys`
crate from crates.io instead of duplicating the logic here in the Rust
repositor with the `backtrace-sys`'s crate's logic.

Eventually this will hopefully be a good step towards using the
`backtrace` crate directly from crates.io itself, but we're not quite
there yet! Hopefully this is a small incremental first step we can take.
@alexcrichton
Copy link
Member Author

@bors: r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Dec 24, 2018

📌 Commit 8d50057 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 24, 2018
@bors
Copy link
Contributor

bors commented Dec 24, 2018

⌛ Testing commit 8d50057 with merge ad781a0...

bors added a commit that referenced this pull request Dec 24, 2018
std: Use backtrace-sys from crates.io

This commit switches the standard library to using the `backtrace-sys`
crate from crates.io instead of duplicating the logic here in the Rust
repositor with the `backtrace-sys`'s crate's logic.

Eventually this will hopefully be a good step towards using the
`backtrace` crate directly from crates.io itself, but we're not quite
there yet! Hopefully this is a small incremental first step we can take.
@bors
Copy link
Contributor

bors commented Dec 25, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: Mark-Simulacrum
Pushing ad781a0 to master...

@bors bors merged commit 8d50057 into rust-lang:master Dec 25, 2018
@alexcrichton alexcrichton deleted the std-backtrace-sys branch March 12, 2019 20:27
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.

7 participants