Skip to content

update libbacktrace #97207

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

Merged
merged 1 commit into from
May 28, 2022
Merged

update libbacktrace #97207

merged 1 commit into from
May 28, 2022

Conversation

RalfJung
Copy link
Member

It seems like previously we were on a tag of the backtrace repo; not sure if there is a policy that it should always be a tag?

Cc rust-lang/backtrace-rs#462 @alexcrichton @drmeepster

@rust-highfive
Copy link
Contributor

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with r? rust-lang/libs-api @rustbot label +T-libs-api -T-libs to request review from a libs-api team reviewer. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive
Copy link
Contributor

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive
Copy link
Contributor

⚠️ Warning ⚠️

  • These commits modify submodules.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 20, 2022
@klensy
Copy link
Contributor

klensy commented May 20, 2022

Is this will work? backtrace_rs imported somehow hacky

rust/library/std/src/lib.rs

Lines 578 to 580 in cd73afa

#[path = "../../backtrace/src/lib.rs"]
#[allow(dead_code, unused_attributes)]
mod backtrace_rs;

and it's deps defined here

# Dependencies of the `backtrace` crate
addr2line = { version = "0.16.0", optional = true, default-features = false }
rustc-demangle = { version = "0.1.21", features = ['rustc-dep-of-std'] }
miniz_oxide = { version = "0.4.0", optional = true, default-features = false }
[dependencies.object]
version = "0.26.1"
optional = true
default-features = false
features = ['read_core', 'elf', 'macho', 'pe', 'unaligned', 'archive']

So with that deps it can be not working as intended.

@RalfJung
Copy link
Member Author

RalfJung commented May 20, 2022

CI is green though... 🤷 no idea how this is usually handled.
Probably the toml files should be synced? Looks like they already are a bit out of sync though (the "object" version is not the same).

@RalfJung
Copy link
Member Author

Actually bumping the version of miniz_oxide leads to build failures:

   Compiling simd-adler32 v0.3.4
error[E0463]: can't find crate for `std`

error[E0463]: can't find crate for `core`
  --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/simd-adler32-0.3.4/src/imp/avx2.rs:49:7
   |
49 |   use core::arch::x86_64::*;
   |       ^^^^ can't find crate

error[E0463]: can't find crate for `core`
  --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/simd-adler32-0.3.4/src/imp/sse2.rs:49:7
   |
49 |   use core::arch::x86_64::*;
   |       ^^^^ can't find crate

error[E0463]: can't find crate for `core`
  --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/simd-adler32-0.3.4/src/imp/ssse3.rs:49:7
   |
49 |   use core::arch::x86_64::*;
   |       ^^^^ can't find crate

[...]

error: could not compile `simd-adler32` due to 149 previous errors

@RalfJung
Copy link
Member Author

RalfJung commented May 20, 2022

This is caused by their Cargo.toml

# Internal feature, only used when building as part of libstd, not part of the
# stable interface of this crate.
rustc-dep-of-std = ['core', 'alloc', 'compiler_builtins', 'adler/rustc-dep-of-std', 'simd-adler32/std']

This enables the (off-by-default) simd-adler32 feature, and that crate does not seem to support being built in the rustc library workspace.
Cc @oyvindln

@klensy
Copy link
Contributor

klensy commented May 20, 2022

This is caused by their Cargo.toml

# Internal feature, only used when building as part of libstd, not part of the
# stable interface of this crate.
rustc-dep-of-std = ['core', 'alloc', 'compiler_builtins', 'adler/rustc-dep-of-std', 'simd-adler32/std']

Cargo's weak deps should solve this ;-) At least if not using simd-adler32 crate within std.

@RalfJung
Copy link
Member Author

RalfJung commented May 20, 2022

Yeah.^^ But we don't even need them here since it seems the rustc workspace doesn't need the simd-adler feature. So that part can just be removed from rustc-dep-of-std I think.

Adding code into the library is very tricky anyway license-wise, so best not to add the simd-adler32 crate for now -- someone else can try that later if they want. ;)

I won't have time for any of that though, I just wanted the new libbacktrace in rustc -- looks like we don't have any checks in place to ensure such an update is always seamlessly possible... except of course if the PR as-is works; it builds, after all.

@oyvindln
Copy link
Contributor

oyvindln commented May 20, 2022

This is caused by their Cargo.toml

# Internal feature, only used when building as part of libstd, not part of the
# stable interface of this crate.
rustc-dep-of-std = ['core', 'alloc', 'compiler_builtins', 'adler/rustc-dep-of-std', 'simd-adler32/std']

This enables the (off-by-default) simd-adler32 feature, and that crate does not seem to support being built in the rustc library workspace. Cc @oyvindln

Right, simd-adler32 probably shouldn't have be added to rustc-dep-of-std then, didn't really catch that when approving the PR adding the feature. Can remove it and push a new version if you want.

@est31
Copy link
Member

est31 commented May 20, 2022

backtrace_rs imported somehow hacky

BTW if anyone wonders why, this approach has been done by 06d565c so that backtrace can use the file system:

While today it's used as a crates.io dependency, this commit
switches the backtrace crate to a submodule of this repository which
will need to be updated manually. This is not done lightly, but is
thought to be the best solution. The primary reason for this is that the
backtrace crate needs to do some pretty nontrivial filesystem
interactions to locate debug information. Working without std::fs is
not an option, and while it might be possible to do some sort of
trait-based solution when prototyped it was found to be too unergonomic.
Using a submodule allows the backtrace crate to build as a submodule
of the std crate itself, enabling it to use std::fs and such.

@Mark-Simulacrum
Copy link
Member

I think for our purposes being slightly out of sync in terms of dependencies (even across, technically, major versions) is not a huge deal, though would be nice to clean up if someone wanted to do so. I don't think it should block this PR unless we encounter unexpected trouble in CI though.

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented May 28, 2022

📌 Commit b8e04d6 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 May 28, 2022
@bors
Copy link
Collaborator

bors commented May 28, 2022

⌛ Testing commit b8e04d6 with merge 1fede17...

@bors
Copy link
Collaborator

bors commented May 28, 2022

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 1fede17 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 28, 2022
@bors bors merged commit 1fede17 into rust-lang:master May 28, 2022
@rustbot rustbot added this to the 1.63.0 milestone May 28, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1fede17): comparison url.

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results
  • Primary benchmarks: 😿 relevant regression found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
3.0% 3.0% 1
Regressions 😿
(secondary)
4.8% 4.8% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 3.0% 3.0% 1

Cycles

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: no relevant changes found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-2.5% -2.5% 1
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) -2.5% -2.5% 1

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@oyvindln
Copy link
Contributor

This is caused by their Cargo.toml

# Internal feature, only used when building as part of libstd, not part of the
# stable interface of this crate.
rustc-dep-of-std = ['core', 'alloc', 'compiler_builtins', 'adler/rustc-dep-of-std', 'simd-adler32/std']

This enables the (off-by-default) simd-adler32 feature, and that crate does not seem to support being built in the rustc library workspace. Cc @oyvindln

Right, simd-adler32 probably shouldn't have be added to rustc-dep-of-std then, didn't really catch that when approving the PR adding the feature. Can remove it and push a new version if you want.

Aight, published an update with simd-adler32 removed from rust-dep-of-std in case one wants to do an update on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

9 participants