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

[WIP]: Remove libbacktrace #51408

Closed
wants to merge 10 commits into from
Closed

Conversation

est31
Copy link
Member

@est31 est31 commented Jun 7, 2018

Remove libbacktrace in favour of the pure Rust library addr2line. See issue #46439.

Right now this PR is only a testbed as I'm trying to find out how to fix all the problems.

This PR currently bases on #51440 as it requires its changes. I want to enable review by different people of the two changes thus I've filed two PRs.

Blockers:

Very WIP. DO NOT MERGE

@rust-highfive
Copy link
Collaborator

r? @joshtriplett

(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 Jun 7, 2018
@est31 est31 force-pushed the libbacktrace_riir branch 2 times, most recently from de853d2 to 55527be Compare June 7, 2018 05:20
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 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:02:38]  Downloading cpp_demangle v0.2.9
[00:02:38]  Downloading object v0.9.0
[00:02:39]  Downloading intervaltree v0.2.3
[00:02:39]  Downloading lazycell v1.0.0
[00:02:39]  Downloading gimli v0.16.0
[00:02:39]  Downloading rustc-demangle v0.1.7
[00:02:39]  Downloading rustc-ap-rustc_cratesio_shim v147.0.0
[00:02:39]  Downloading proc-macro2 v0.4.6
[00:02:39]  Downloading chalk-macros v0.1.0
---
[00:02:41]  Downloading datafrog v0.1.0
[00:02:41]  Downloading rls-span v0.4.0
[00:02:41]  Downloading rls-data v0.16.0
[00:02:41]  Downloading rand v0.3.22
[00:02:42]  Downloading uuid v0.6.5
[00:02:42]  Downloading goblin v0.0.15
[00:02:42]  Downloading scroll v0.9.0
[00:02:42]  Downloading backtrace-sys v0.1.22
[00:02:42]  Downloading polonius-engine v0.5.0
[00:02:42]  Downloading either v1.5.0
[00:02:42]  Downloading log_settings v0.1.1
---
[00:02:58] Caused by:
[00:02:58]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name cfg_if /cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cfg-if-0.1.2/src/lib.rs --color always --error-format json --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=540c185278ab8f78 -C extra-filename=-540c185278ab8f78 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/release/deps --cap-lints allow` (exit code: 101)
[00:02:58] warning: build failed, waiting for other jobs to finish...
[00:03:19] error: build failed
[00:03:19] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:03:19] expected success, got: exit code: 101
[00:03:19] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1091:9
[00:03:19] travis_fold:end:stage0-std

[00:03:19] travis_time:end:stage0-std:start=1528349088372726257,finish=1528349109847452381,duration=21474726124


[00:03:19] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:19] Build completed unsuccessfully in 0:00:22
[00:03:19] Makefile:79: recipe for target 'tidy' failed
[00:03:19] make: *** [tidy] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:2e4054c8
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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)

@@ -19,6 +19,7 @@ use std::fs::File;

fn main() {
let target = env::var("TARGET").expect("TARGET was not set");
/*
Copy link
Member

Choose a reason for hiding this comment

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

I assume the final version will actually delete code, rather than commenting it out?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.

@joshtriplett
Copy link
Member

@est31 Could I get an acronym expansion on "RIIR"? "Re-Implementation In Rust"?

@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 Jun 7, 2018
@retep998
Copy link
Member

retep998 commented Jun 8, 2018

@joshtriplett Rewrite It In Rust.

@est31 est31 force-pushed the libbacktrace_riir branch 2 times, most recently from 81c18b6 to 9dda8d4 Compare June 10, 2018 01:09
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.

Let me know if I can further clarify these details or if you want me to write up how I'd change the comments directly.

(I'm trying to explain rather than do that in the hope that more people can understand how rustbuild works).

@@ -840,7 +840,13 @@ impl<'a> Builder<'a> {
// already-passed -C metadata flag with our own. Our rustc.rs
// wrapper around the actual rustc will detect -C metadata being
// passed and frob it with this extra string we're passing in.
Copy link
Member

Choose a reason for hiding this comment

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

So the wording above was correct where the compiler was the only crate graph depending on crates.io, but since now std itself also does that, we need to apply this metadata mangling to differ std's and rustc's symbols as well. Let me know if you want further explanation or you think that's enough to update the wording.

Mode::Std => "rustc-std",
Mode::Test => "rustc-test",
Mode::Codegen | Mode::Rustc => "rustc-rustc",
Mode::ToolStd | Mode::ToolTest | Mode::ToolRustc => "rustc-tools",
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 stick an unreachable in this arm to be a little clearer (this is in an if statement where we've checked for tool already).


// If this was output in the `deps` dir then this is a precise file
// name (hash included) so we start tracking it.
if filename.starts_with(&target_deps_dir) {
Copy link
Member

Choose a reason for hiding this comment

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

Update this comment to state something along the lines of "We've already added this in the previous loop iteration"

let filename = Path::new(&*filename);

// If this was an output file in the "host dir" we don't actually
// worry about it, it's not relevant for us.
Copy link
Member

Choose a reason for hiding this comment

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

If the host dir contains a file that wasn't in the target dir, also promote it. This primarily is the case for things like proc macros, where if std depends on that, we'll need to make sure that the proc macro artifact is also promoted -- but since it's host only, it won't be in the target dir.

}

let filename = Path::new(&*filename);
let filename = Path::new(&**filename);

// If this was an output file in the "host dir" we don't actually
// worry about it, it's not relevant for us.
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 change this comment to basically refer to this same condition below and say see why there.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 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.
########################################################                  79.1%
######################################################################## 100.0%
[00:01:15] extracting /checkout/obj/build/cache/2018-05-10/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:01:17]     Updating registry `https://github.com/rust-lang/crates.io-index`
[00:01:37]     Updating git repository `https://github.com/est31/addr2line`
[00:01:49]     Updating git repository `https://github.com/est31/gimli`
[00:01:56]     Updating git repository `https://github.com/rust-lang-nursery/rustfmt`
[00:01:58]     Updating git repository `https://github.com/gimli-rs/cpp_demangle`
[00:01:59]     Updating git repository `https://github.com/kevinaboos/stable_deref_trait`
[00:02:00]  Downloading cmake v0.1.30
[00:02:00]  Downloading num_cpus v1.8.0
[00:02:00]  Downloading getopts v0.2.17
[00:02:00]  Downloading lazy_static v0.2.11
---
[00:03:15]  Downloading core-foundation-sys v0.6.0
[00:03:15]  Downloading backtrace-sys v0.1.22
[00:03:15]  Downloading rustc-demangle v0.1.7
[00:03:15]  Downloading is-match v0.1.0
[00:03:15]  Downloading goblin v0.0.15
[00:03:16]  Downloading scroll v0.9.0
[00:03:16]  Downloading uuid v0.6.5
[00:03:17]  Downloading byteorder v1.2.2
[00:03:17]  Downloading chalk-engine v0.6.0
[00:03:18]  Downloading difference v2.0.0
[00:03:18]  Downloading openssl v0.10.6
---
[00:03:56]    Compiling plain v0.2.3
[00:03:56]    Compiling build_helper v0.1.0 (file:///checkout/src/build_helper)
[00:03:56]    Compiling libc v0.0.0 (file:///checkout/src/rustc/libc_shim)
[00:03:57]    Compiling byteorder v1.2.2
[00:03:58]    Compiling stable_deref_trait v1.0.0 (https://github.com/kevinaboos/stable_deref_trait?rev=8aa58b57a20b0dc215084f84de81e0f7e7dea76e#8aa58b57)
[00:03:58]    Compiling smallvec v0.4.4
[00:03:58]    Compiling smallvec v0.6.0
[00:03:59]    Compiling lazycell v1.0.0
[00:03:59]    Compiling cmake v0.1.30
---
[00:04:01]    Compiling alloc_system v0.0.0 (file:///checkout/src/liballoc_system)
[00:04:01]    Compiling panic_abort v0.0.0 (file:///checkout/src/libpanic_abort)
[00:04:01]    Compiling alloc_jemalloc v0.0.0 (file:///checkout/src/liballoc_jemalloc)
[00:04:02]    Compiling std v0.0.0 (file:///checkout/src/libstd)
[00:04:03]    Compiling intervaltree v0.2.3
[00:04:04]    Compiling cpp_demangle v0.2.9 (https://github.com/gimli-rs/cpp_demangle?rev=6d5320d2f5c119923647b6d7d2a7d563717a4ddf#6d5320d2)
[00:04:04]    Compiling gimli v0.16.0 (https://github.com/est31/gimli?rev=304caacf8b73f117813b1a0d436ce24403459bf2#304caacf)
[00:04:06]    Compiling rustc_asan v0.0.0 (file:///checkout/src/librustc_asan)
[00:04:07]    Compiling rustc_msan v0.0.0 (file:///checkout/src/librustc_msan)
[00:04:09]    Compiling rustc_lsan v0.0.0 (file:///checkout/src/librustc_lsan)
[00:04:09]    Compiling panic_unwind v0.0.0 (file:///checkout/src/libpanic_unwind)
[00:04:09]    Compiling panic_unwind v0.0.0 (file:///checkout/src/libpanic_unwind)
[00:04:10]    Compiling quote v0.6.3
[00:04:11]    Compiling syn v0.14.2
[00:04:31]    Compiling scroll_derive v0.9.4
[00:04:34]    Compiling scroll v0.9.0
[00:04:34]    Compiling goblin v0.0.15
[00:04:49]    Compiling object v0.9.0
[00:04:51]    Compiling addr2line v0.6.0 (https://github.com/est31/addr2line?branch=no_std_prototype#19fca3a5)
[00:05:14] Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
[00:05:14] travis_fold:end:stage0-std

[00:05:14] travis_time:end:stage0-std:start=1528650788525222851,finish=1528650894934990582,duration=106409767731
---
[00:20:57]    Compiling build_helper v0.1.0 (file:///checkout/src/build_helper)
[00:20:57]    Compiling rustc_codegen_llvm v0.0.0 (file:///checkout/src/librustc_codegen_llvm)
[00:20:57]    Compiling cc v1.0.15
[00:20:58] error: build failed
[00:20:58] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--manifest-path" "/checkout/src/librustc_codegen_llvm/Cargo.toml" "--features" " jemalloc" "--message-format" "json"
[00:20:58] expected success, got: exit code: 101
[00:20:58] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1196:9
[00:20:58] travis_fold:start:stage0-rustc_codegen_llvm
travis_time:start:stage0-rustc_codegen_llvm
travis_fold:end:stage0-rustc_codegen_llvm


[00:20:58] travis_time:end:stage0-rustc_codegen_llvm:start=1528651837295640117,finish=1528651838733527239,duration=1437887122

[00:20:58] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:20:58] Build completed unsuccessfully in 0:14:48
[00:20:58] make: *** [all] Error 1
[00:20:58] Makefile:28: recipe for target 'all' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:03b67012
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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)

@est31
Copy link
Member Author

est31 commented Jun 10, 2018

Sooo.... below a mountain of rustbuild changes, and a bunch of patches to addr2line, gimli, as well as stable_deref_trait, I have managed to create a preview of addr2line in std!

For a simple crate foo with a main function that contains a panic!(), this is the current output of this PR, using addr2line:

thread 'main' panicked at 'explicit panic', src/main.rs:2:5
stack backtrace:
   0: rust_metadata_std_45dfd7403b36bafdf62465e43946faf3
   1: rust_metadata_std_45dfd7403b36bafdf62465e43946faf3
   2: rust_metadata_std_45dfd7403b36bafdf62465e43946faf3
   3: rust_metadata_std_45dfd7403b36bafdf62465e43946faf3
   4: std::panicking::rust_panic_with_hook
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: rust_metadata_std_45dfd7403b36bafdf62465e43946faf3
   9: __rust_maybe_catch_panic
  10: std::rt::lang_start_internal
  11: <unknown>
  12: __libc_start_main
  13: <unknown>

While this is the output of Rust nightly:

thread 'main' panicked at 'explicit panic', src/main.rs:2:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:511
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:445
   6: foo::main
             at src/main.rs:2
   7: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
   8: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
   9: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105
  10: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:374
             at libstd/rt.rs:58
  11: std::rt::lang_start
             at /checkout/src/libstd/rt.rs:74
  12: main
  13: __libc_start_main
  14: _start

I'm not sure how much of this is an addr2line problem, and how much of this is a problem of my usage of it. @philipc do you have any ideas?

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 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.
###########################################################               82.4%
######################################################################## 100.0%
[00:01:14] extracting /checkout/obj/build/cache/2018-05-10/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:01:14]     Updating registry `https://github.com/rust-lang/crates.io-index`
[00:01:34]     Updating git repository `https://github.com/est31/addr2line`
[00:01:35]     Updating git repository `https://github.com/est31/gimli`
[00:01:36]     Updating git repository `https://github.com/rust-lang-nursery/rustfmt`
[00:01:39]     Updating git repository `https://github.com/gimli-rs/cpp_demangle`
[00:01:41]     Updating git repository `https://github.com/kevinaboos/stable_deref_trait`
[00:01:42]  Downloading filetime v0.1.15
[00:01:42]  Downloading time v0.1.39
[00:01:42]  Downloading petgraph v0.4.12
[00:01:42]  Downloading getopts v0.2.17
---
[00:02:52]  Downloading pretty_assertions v0.5.1
[00:02:52]  Downloading ucd-util v0.1.1
[00:02:52]  Downloading vcpkg v0.2.3
[00:02:52]  Downloading termion v1.5.1
[00:02:52]  Downloading scroll v0.9.0
[00:02:52]  Downloading uuid v0.6.5
[00:02:52]  Downloading goblin v0.0.15
[00:02:53]  Downloading error-chain v0.11.0
[00:02:53]  Downloading open v1.2.1
[00:02:53]  Downloading tempfile v3.0.2
[00:02:53]  Downloading clap v2.31.2
---
[00:03:43]    Compiling unwind v0.0.0 (file:///checkout/src/libunwind)
[00:03:43]    Compiling build_helper v0.1.0 (file:///checkout/src/build_helper)
[00:03:43]    Compiling plain v0.2.3
[00:03:45]    Compiling nodrop v0.1.12
[00:03:45]    Compiling stable_deref_trait v1.0.0 (https://github.com/kevinaboos/stable_deref_trait?rev=8aa58b57a20b0dc215084f84de81e0f7e7dea76e#8aa58b57)
[00:03:45]    Compiling fallible-iterator v0.1.4
[00:03:45]    Compiling byteorder v1.2.2
[00:03:46]    Compiling smallvec v0.4.4
[00:03:46]    Compiling lazycell v1.0.0
---
[00:03:47]    Compiling proc-macro2 v0.4.6
[00:03:47]    Compiling alloc_jemalloc v0.0.0 (file:///checkout/src/liballoc_jemalloc)
[00:03:48]    Compiling std v0.0.0 (file:///checkout/src/libstd)
[00:03:51]    Compiling arrayvec v0.4.7
[00:03:51]    Compiling cpp_demangle v0.2.9 (https://github.com/gimli-rs/cpp_demangle?rev=6d5320d2f5c119923647b6d7d2a7d563717a4ddf#6d5320d2)
[00:03:51]    Compiling intervaltree v0.2.3
[00:03:52]    Compiling panic_abort v0.0.0 (file:///checkout/src/libpanic_abort)
[00:03:52]    Compiling rustc_asan v0.0.0 (file:///checkout/src/librustc_asan)
[00:03:54]    Compiling rustc_tsan v0.0.0 (file:///checkout/src/librustc_tsan)
[00:03:55]    Compiling rustc_lsan v0.0.0 (file:///checkout/src/librustc_lsan)
[00:03:55]    Compiling rustc_lsan v0.0.0 (file:///checkout/src/librustc_lsan)
[00:03:55]    Compiling rustc_msan v0.0.0 (file:///checkout/src/librustc_msan)
[00:03:55]    Compiling gimli v0.16.0 (https://github.com/est31/gimli?rev=304caacf8b73f117813b1a0d436ce24403459bf2#304caacf)
[00:03:57]    Compiling quote v0.6.3
[00:03:58]    Compiling syn v0.14.2
[00:04:19]    Compiling scroll_derive v0.9.4
[00:04:21]    Compiling scroll v0.9.0
[00:04:21]    Compiling scroll v0.9.0
[00:04:22]    Compiling goblin v0.0.15
[00:04:37]    Compiling object v0.9.0
[00:04:39]    Compiling addr2line v0.6.0 (https://github.com/est31/addr2line?branch=no_std_prototype#19fca3a5)
[00:04:46] warning: function is never used: `get_executable_filename`
[00:04:46]    --> libstd/sys/unix/backtrace/mod.rs:101:5
[00:04:46]     |
[00:04:46] 101 |     pub fn get_executable_filename() -> io::Result<(Vec<c_char>, fs::File)> {
[00:04:46]     |
[00:04:46]     = note: #[warn(dead_code)] on by default
[00:04:46] 
[00:05:03]     Finished release [optimized] target(s) in 1m 19.80s
---
[00:21:09] Building stage0 codegen artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu, llvm)
[00:21:09]    Compiling build_helper v0.1.0 (file:///checkout/src/build_helper)
[00:21:09]    Compiling rustc_codegen_llvm v0.0.0 (file:///checkout/src/librustc_codegen_llvm)
[00:21:09]    Compiling cc v1.0.15
[00:21:09] error[E0460]: found possibly newer version of crate `arrayvec` which `std` depends on
[00:21:09]   |
[00:21:09]   = note: perhaps that crate needs to be recompiled?
[00:21:09]   = note: the following crate versions were found:
[00:21:09]           crate `arrayvec`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libarrayvec-723190bddfb7f7c4.rlib
[00:21:09]           crate `arrayvec`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libarrayvec-723190bddfb7f7c4.rlib
[00:21:09]           crate `std`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ccc26bb68f7390fd.so
[00:21:09]           crate `std`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ccc26bb68f7390fd.rlib
[00:21:09] error: aborting due to previous error
[00:21:09] 
[00:21:09] For more information about this error, try `rustc --explain E0460`.
[00:21:09] error: Could not compile `cc`.
[00:21:09] error: Could not compile `cc`.
[00:21:09] 
[00:21:09] Caused by:
[00:21:09]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name cc /cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cc-1.0.15/src/lib.rs --color always --error-format json --crate-type lib --emit=dep-info

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)

@philipc
Copy link
Contributor

philipc commented Jun 10, 2018

It probably needs to take relocation into account, such as in the addr2line tests. And related to this, we need to handle debuginfo in shared libraries too, but that shouldn't be needed for what you are testing here.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 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.
###################################                                       48.7%
######################################################################## 100.0%
[00:01:02] extracting /checkout/obj/build/cache/2018-05-10/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:01:02]     Updating registry `https://github.com/rust-lang/crates.io-index`
[00:01:24]     Updating git repository `https://github.com/est31/addr2line`
[00:01:34]     Updating git repository `https://github.com/est31/gimli`
[00:01:47]     Updating git repository `https://github.com/rust-lang-nursery/rustfmt`
[00:01:56]     Updating git repository `https://github.com/gimli-rs/cpp_demangle`
[00:01:57]     Updating git repository `https://github.com/kevinaboos/stable_deref_trait`
[00:01:58]  Downloading lazy_static v0.2.11
[00:01:58]  Downloading filetime v0.1.15
[00:01:58]  Downloading toml v0.4.6
[00:01:58]  Downloading cc v1.0.15
---
[00:03:13]  Downloading rustc-ap-serialize v149.0.0
[00:03:13]  Downloading rustc-ap-rustc_data_structures v149.0.0
[00:03:13]  Downloading bitflags v0.9.1
[00:03:13]  Downloading markup5ever v0.7.2
[00:03:13]  Downloading goblin v0.0.15
[00:03:14]  Downloading scroll v0.9.0
[00:03:14]  Downloading uuid v0.6.5
[00:03:15]  Downloading walkdir v2.1.4
[00:03:15]  Downloading crossbeam v0.3.2
[00:03:15]  Downloading same-file v1.0.2
[00:03:16]  Downloading thread_local v0.3.5
---
[00:04:10]    Compiling unwind v0.0.0 (file:///checkout/src/libunwind)
[00:04:10]    Compiling build_helper v0.1.0 (file:///checkout/src/build_helper)
[00:04:10]    Compiling plain v0.2.3
[00:04:12]    Compiling nodrop v0.1.12
[00:04:12]    Compiling stable_deref_trait v1.0.0 (https://github.com/kevinaboos/stable_deref_trait?rev=8aa58b57a20b0dc215084f84de81e0f7e7dea76e#8aa58b57)
[00:04:12]    Compiling byteorder v1.2.2
[00:04:13]    Compiling fallible-iterator v0.1.4
[00:04:13]    Compiling libc v0.0.0 (file:///checkout/src/rustc/libc_shim)
[00:04:13]    Compiling lazycell v1.0.0
---
[00:04:14]    Compiling proc-macro2 v0.4.6
[00:04:14]    Compiling alloc_jemalloc v0.0.0 (file:///checkout/src/liballoc_jemalloc)
[00:04:15]    Compiling std v0.0.0 (file:///checkout/src/libstd)
[00:04:16]    Compiling arrayvec v0.4.7
[00:04:17]    Compiling cpp_demangle v0.2.9 (https://github.com/gimli-rs/cpp_demangle?rev=6d5320d2f5c119923647b6d7d2a7d563717a4ddf#6d5320d2)
[00:04:21]    Compiling intervaltree v0.2.3
[00:04:21]    Compiling panic_abort v0.0.0 (file:///checkout/src/libpanic_abort)
[00:04:21]    Compiling panic_abort v0.0.0 (file:///checkout/src/libpanic_abort)
[00:04:21]    Compiling gimli v0.16.0 (https://github.com/est31/gimli?rev=304caacf8b73f117813b1a0d436ce24403459bf2#304caacf)
[00:04:22]    Compiling rustc_lsan v0.0.0 (file:///checkout/src/librustc_lsan)
[00:04:23]    Compiling rustc_tsan v0.0.0 (file:///checkout/src/librustc_tsan)
[00:04:23]    Compiling rustc_msan v0.0.0 (file:///checkout/src/librustc_msan)
[00:04:24]    Compiling panic_unwind v0.0.0 (file:///checkout/src/libpanic_unwind)
[00:04:24]    Compiling panic_unwind v0.0.0 (file:///checkout/src/libpanic_unwind)
[00:04:24]    Compiling quote v0.6.3
[00:04:26]    Compiling syn v0.14.2
[00:04:47]    Compiling scroll_derive v0.9.4
[00:04:49]    Compiling scroll v0.9.0
[00:04:50]    Compiling goblin v0.0.15
[00:05:05]    Compiling object v0.9.0
[00:05:07]    Compiling addr2line v0.6.0 (https://github.com/est31/addr2line?branch=no_std_prototype#19fca3a5)
[00:05:15] warning: function is never used: `get_executable_filename`
[00:05:15]    --> libstd/sys/unix/backtrace/mod.rs:101:5
[00:05:15]     |
[00:05:15] 101 |     pub fn get_executable_filename() -> io::Result<(Vec<c_char>, fs::File)> {
[00:05:15]     |
[00:05:15]     = note: #[warn(dead_code)] on by default
[00:05:15] 
[00:05:32]     Finished release [optimized] target(s) in 1m 21.76s

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)

@est31
Copy link
Member Author

est31 commented Jun 10, 2018

I've chatted today again with @Mark-Simulacrum about the build system changes that this PR needs/does. They fixed some issues that this PR caused and sent me a patch which I included in this PR. They also found further issues. It turns out that the goblin crate, which is being included by this PR into std, uses derive functionality from the scroll crate. object uses scroll as well, without needing its derive macros however. A closer look makes it seem that the usage inside goblin is very heavy, so it can't really be replaced. Right now we can't use any derive inside the compiler due to inter stage issues. Work has been done by @eddyb to fix this, in PR #49219, but that PR hasn't been merged yet. I've added it as blocker to the top of this PR.

@Mark-Simulacrum Mark-Simulacrum added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 11, 2018
@philipc
Copy link
Contributor

philipc commented Jun 11, 2018

If fixing derives is too hard then we could change the object dependency in addr2line to be optional, and use a different object loader (eg xmas-elf).

@bors
Copy link
Contributor

bors commented Jun 21, 2018

☔ The latest upstream changes (presumably #50698) made this pull request unmergeable. Please resolve the merge conflicts.

@est31
Copy link
Member Author

est31 commented Jul 3, 2018

The period of my contributions to Rust upstream has reached an end. Thus I'm unable to continue my work on this. I still think something like this is a great addition. I urge anyone interested in this change to adopt and continue it from here on. Thanks.

@est31 est31 closed this Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants