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

Modularise CI workflow and validate outputs for binary size checks. #549

Merged
merged 5 commits into from
Sep 9, 2023

Conversation

detly
Copy link
Contributor

@detly detly commented Jul 10, 2023

I was amazed at how quickly you spun up your code size check CI workflow. It prompted me to take that approach and play around with it in a private repo to dig into it more, which resulted in these changes and notes you might be interested in.

Notes:

Modularisation

Most of the workflow structure changes were just to help me understand the process. I found it useful to separate the step that does the code size check itself from all the prep work. This same separation lent itself well to eg. converting the workflow into a Docker multi-stage image so I could automate running the measurement over a lot of commits in the history.

Modularising CI workflow this way is kind of a style preference though, so feel free to decline/bikeshed that aspect of it.

Compiler flags

I changed the flags to optimise for size and strip all symbols, because that is generally the lowest hanging fruit for anyone concerned about binary size and might reflect the more "realistic" impact on such a project. OTOH, I don't think the difference in flags would actually turn a change in size into a non-change, so you might consider it spurious.

Transitive dependency breaks

One large-ish problem I found with historical analysis was that, specifically, I wanted to understand the jump in size between nightly-2023-07-01 and nightly-2023-07-03. This was a change in backtrace:

  • from 0.3.67 / 8ad84ca5ad88ade697637387e7cb4d7c3cf4bde8
  • to 0.3.68 / e1c49fbd6124a1b626cdf19871aff68c362bdf07

The problem is, running the "build with patched std" procedure on the old commit resulted in errors:

(Expand for the full output.)
error[E0308]: mismatched types
   --> library/std/src/../../backtrace/src/symbolize/gimli.rs:377:24
    |
377 |                 if let Ok(mut frames) = object_cx.dwarf.find_frames(object_addr) {
    |                        ^^^^^^^^^^^^^^   ---------------------------------------- this expression has type `LookupResult<impl LookupContinuation<Output = core::result::Result<FrameIter<'_, EndianSlice<'_, addr2line::gimli::LittleEndian>>, addr2line::gimli::Error>, Buf = EndianSlice<'_, addr2line::gimli::LittleEndian>>>`
    |                        |
    |                        expected `LookupResult<impl LookupContinuation<Output = ..., Buf = ...>>`, found `Result<_, _>`
    |
   ::: /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/addr2line-0.20.0/src/lib.rs:450:23
    |
450 | ...lt<impl LookupContinuation<Output = Result<FrameIter<'_, R>, Error>, Buf = R>>
    |       -------------------------------------------------------------------------- the expected opaque type
    |
    = note: expected enum `LookupResult<impl LookupContinuation<Output = ..., Buf = ...>>`
            the full type name has been written to '/rust/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/std-561bd21e49def8cf.long-type-9162012492364665641.txt'
               found enum `core::result::Result<_, _>`
root@3770f30d41d9:/rust# python3 x.py build library --stage 0
Building bootstrap
    Finished dev [unoptimized] target(s) in 0.04s
warning: x.py has made several changes recently you may want to look at
help: consider looking at the changes in `src/bootstrap/CHANGELOG.md`
note: to silence this warning, add `changelog-seen = 2` at the top of `config.toml`
Updating submodule src/tools/cargo
Submodule 'src/tools/cargo' (https://github.com/rust-lang/cargo.git) registered for path 'src/tools/cargo'
Cloning into '/rust/src/tools/cargo'...
remote: Enumerating objects: 1896, done.        
remote: Counting objects: 100% (1896/1896), done.        
remote: Compressing objects: 100% (1358/1358), done.        
remote: Total 1896 (delta 468), reused 1094 (delta 343), pack-reused 0        
Receiving objects: 100% (1896/1896), 2.73 MiB | 1.73 MiB/s, done.
Resolving deltas: 100% (468/468), done.
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Enumerating objects: 32, done.
remote: Counting objects: 100% (32/32), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 17 (delta 15), reused 5 (delta 3), pack-reused 0
Unpacking objects: 100% (17/17), 6.95 KiB | 790.00 KiB/s, done.
From https://github.com/rust-lang/cargo
 * branch            5b377cece0e0dd0af686cf53ce4637d5d85c2a10 -> FETCH_HEAD
Submodule path 'src/tools/cargo': checked out '5b377cece0e0dd0af686cf53ce4637d5d85c2a10'
Updating submodule library/backtrace
Updating submodule library/stdarch
Submodule 'library/stdarch' (https://github.com/rust-lang/stdarch.git) registered for path 'library/stdarch'
Cloning into '/rust/library/stdarch'...
remote: Enumerating objects: 302, done.        
remote: Counting objects: 100% (302/302), done.        
remote: Compressing objects: 100% (247/247), done.        
remote: Total 302 (delta 45), reused 155 (delta 22), pack-reused 0        
Receiving objects: 100% (302/302), 1.16 MiB | 2.60 MiB/s, done.
Resolving deltas: 100% (45/45), done.
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Enumerating objects: 87, done.
remote: Counting objects: 100% (87/87), done.
remote: Compressing objects: 100% (46/46), done.
remote: Total 50 (delta 33), reused 13 (delta 3), pack-reused 0
Unpacking objects: 100% (50/50), 104.11 KiB | 1.12 MiB/s, done.
From https://github.com/rust-lang/stdarch
 * branch            d77878b7299dd7e286799a6e8447048b65d2a861 -> FETCH_HEAD
Submodule path 'library/stdarch': checked out 'd77878b7299dd7e286799a6e8447048b65d2a861'
Updating submodule library/backtrace
downloading https://static.rust-lang.org/dist/2023-05-30/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz
######################################################################################### 100.0%
extracting /rust/build/cache/2023-05-30/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz to /rust/build/x86_64-unknown-linux-gnu/rustfmt
downloading https://static.rust-lang.org/dist/2023-05-30/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz
######################################################################################### 100.0%
extracting /rust/build/cache/2023-05-30/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz to /rust/build/x86_64-unknown-linux-gnu/rustfmt
downloading https://ci-artifacts.rust-lang.org/rustc-builds/4b6749b21e680a6280cf05ace533ae20c93d9bff/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
######################################################################################### 100.0%
extracting /rust/build/cache/llvm-4b6749b21e680a6280cf05ace533ae20c93d9bff-false/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /rust/build/x86_64-unknown-linux-gnu/ci-llvm
Building stage0 library artifacts (x86_64-unknown-linux-gnu)
    Updating crates.io index
  Downloaded addr2line v0.20.0
  Downloaded miniz_oxide v0.7.1
  Downloaded unicode-width v0.1.10
  Downloaded adler v1.0.2
  Downloaded getopts v0.2.21
  Downloaded rustc-demangle v0.1.23
  Downloaded allocator-api2 v0.2.15
  Downloaded cc v1.0.79
  Downloaded hashbrown v0.14.0
  Downloaded compiler_builtins v0.1.93
  Downloaded libc v0.2.147
  Downloaded gimli v0.27.3
  Downloaded 12 crates (1.6 MB) in 1.34s
   Compiling compiler_builtins v0.1.93
   Compiling core v0.0.0 (/rust/library/core)
   Compiling libc v0.2.147
   Compiling cc v1.0.79
   Compiling memchr v2.5.0
   Compiling std v0.0.0 (/rust/library/std)
   Compiling unwind v0.0.0 (/rust/library/unwind)
   Compiling rustc-std-workspace-core v1.99.0 (/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/rust/library/alloc)
   Compiling cfg-if v1.0.0
   Compiling adler v1.0.2
   Compiling rustc-demangle v0.1.23
   Compiling rustc-std-workspace-alloc v1.99.0 (/rust/library/rustc-std-workspace-alloc)
   Compiling panic_abort v0.0.0 (/rust/library/panic_abort)
   Compiling panic_unwind v0.0.0 (/rust/library/panic_unwind)
   Compiling gimli v0.27.3
   Compiling hashbrown v0.14.0
   Compiling miniz_oxide v0.7.1
   Compiling object v0.31.1
   Compiling std_detect v0.1.5 (/rust/library/stdarch/crates/std_detect)
   Compiling addr2line v0.20.0
error[E0308]: mismatched types
   --> library/std/src/../../backtrace/src/symbolize/gimli.rs:361:16
    |
361 |         if let Ok(mut frames) = cx.dwarf.find_frames(addr as u64) {
    |                ^^^^^^^^^^^^^^   --------------------------------- this expression has type `LookupResult<impl LookupContinuation<Output = core::result::Result<FrameIter<'_, EndianSlice<'_, addr2line::gimli::LittleEndian>>, addr2line::gimli::Error>, Buf = EndianSlice<'_, addr2line::gimli::LittleEndian>>>`
    |                |
    |                expected `LookupResult<impl LookupContinuation<Output = ..., Buf = ...>>`, found `Result<_, _>`
    |
   ::: /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/addr2line-0.20.0/src/lib.rs:450:23
    |
450 | ...lt<impl LookupContinuation<Output = Result<FrameIter<'_, R>, Error>, Buf = R>>
    |       -------------------------------------------------------------------------- the expected opaque type
    |
    = note: expected enum `LookupResult<impl LookupContinuation<Output = ..., Buf = ...>>`
            the full type name has been written to '/rust/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/std-561bd21e49def8cf.long-type-12642544034931188750.txt'
               found enum `core::result::Result<_, _>`

error[E0308]: mismatched types
   --> library/std/src/../../backtrace/src/symbolize/gimli.rs:377:24
    |
377 |                 if let Ok(mut frames) = object_cx.dwarf.find_frames(object_addr) {
    |                        ^^^^^^^^^^^^^^   ---------------------------------------- this expression has type `LookupResult<impl LookupContinuation<Output = core::result::Result<FrameIter<'_, EndianSlice<'_, addr2line::gimli::LittleEndian>>, addr2line::gimli::Error>, Buf = EndianSlice<'_, addr2line::gimli::LittleEndian>>>`
    |                        |
    |                        expected `LookupResult<impl LookupContinuation<Output = ..., Buf = ...>>`, found `Result<_, _>`
    |
   ::: /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/addr2line-0.20.0/src/lib.rs:450:23
    |
450 | ...lt<impl LookupContinuation<Output = Result<FrameIter<'_, R>, Error>, Buf = R>>
    |       -------------------------------------------------------------------------- the expected opaque type
    |
    = note: expected enum `LookupResult<impl LookupContinuation<Output = ..., Buf = ...>>`
            the full type name has been written to '/rust/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/std-561bd21e49def8cf.long-type-9162012492364665641.txt'
               found enum `core::result::Result<_, _>`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `std` (lib) due to 2 previous errors
Build completed unsuccessfully in 0:03:03

I'm not familiar enough with backtrace and std to interpret this. If it's because there's a change in interface between the two versions of backtrace, leading to incompatibilities where you can't just splice the new or old version into the same version of std — I don't know of a way around it with this approach except to do it manually with known, specific versions of std.

OTOH, if it's because of some transitive dependencies that are now mismatched between those calculated in some lockfile and those resolved during this later step, that might be something that could be dealt with in this process.

The reason I mention it is that this class of code size increase (due to changes in dependencies or ones use of them) can be amongst the biggest and most well-hidden (IME, anyway, because of the "but I didn't change any code!" factor). And so it might be the most worthy of being caught by CI, but I can't quite tell (a) if this approach misses it and, if so, (b) how to change it so it doesn't miss it.

Sudden failure of copying files

Update: fixed now.

I was going to point you to an example PR I had in my own fork so you could verify that this worked. BUT in, literally, the 20 minutes it took me to write this PR, the workflow broke. Including ones that worked an hour ago. The failure is:

cp: 'build/x86_64-unknown-linux-gnu/stage0/lib/libLLVM-16-rust-1.71.0-beta.so' and 'build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/libLLVM-16-rust-1.71.0-beta.so' are the same file
cp: 'build/x86_64-unknown-linux-gnu/stage0/lib/librustc_driver-e73eb5c47f849c7b.so' and 'build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/librustc_driver-e73eb5c47f849c7b.so' are the same file
cp: 'build/x86_64-unknown-linux-gnu/stage0/lib/libstd-9ef2a438251e3a63.so' and 'build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/libstd-9ef2a438251e3a63.so' are the same file
cp: 'build/x86_64-unknown-linux-gnu/stage0/lib/libtest-c03aaf58feba71c6.so' and 'build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/libtest-c03aaf58feba71c6.so' are the same file

I haven't debugged this yet, but it might be that something in the bootstrap process is (now) hardlinking outputs, and cp doesn't like that.

@philipc
Copy link
Contributor

philipc commented Jul 10, 2023

OTOH, if it's because of some transitive dependencies that are now mismatched

Yes it's because of this. You need to patch these too:
https://github.com/rust-lang/rust/blob/70d7283d24ed2d664fc4cefad6f240aeb62e98f2/library/std/Cargo.toml#L27-L35

and this should be done if you want to get accurate measurements of size changes, because these dependencies can cause size changes too.

@Kobzol
Copy link
Contributor

Kobzol commented Jul 17, 2023

The cp commands should now be removed, they are performed by rustc bootstrap automatically.

@Kobzol
Copy link
Contributor

Kobzol commented Jul 17, 2023

This is pretty great! One problem with this workflow is that of GH permissions regarding sending comments. We probably shouldn't use pull_request_target at all, since in theory it enables GHA cache poisoning. But without it, we can't easily send PR comments. The pull_request_target approach and building code from "foreign" PRs is not deemed to be safe though, so we should probably do something about it.

One way to solve this would be to have one workflow that calculates the size, and then another workflow that just reads the calculated outputs and posts it to the PR. I started drafting something in #548, but it's not finished. I realized that it's not even that trivial to recognize if the original workflow came from a PR (and from which one). Maybe this should better be implemented in JavaScript, in a first-class GitHub action. Or it should just be a part of bors, I don't know.

@detly
Copy link
Contributor Author

detly commented Jul 17, 2023

The cp commands should now be removed, they are performed by rustc bootstrap automatically.

I'll rebase this after #550, I just can't do it in parallel because I can only test workflows as they exist on my fork's master branch and it's already a bit of a juggle.

Re. the safety aspect - I am more familiar with Gitlab's CI than Github's, but they have the concept of "metrics" that have a similar kind of "first class" recognition to things like test and coverage reports. I say similar because they don't actually have a good way to display them in MRs, they're more for post-deployment monitoring (I think), but it's in the works. My point is that if Github have some other first class way to report basic numeric metrics that don't involve posting a comment to the PR via the API, that could be an easy win. I'm trying to find that out.

For my own understanding:

The pull_request_target approach and building code from "foreign" PRs is not deemed to be safe though

What's the potential issue? I thought that any PR triggered the workflow as written in the target.

- shell: bash
id: measure
env:
RUSTC_FLAGS: -Copt-level=s -Cstrip=symbols
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not want to use -Copt-level=s as the main check.

  1. It's iffy! It sometimes results in larger sizes than 3, or even 2!
  2. It is not representative of "default" --release builds, which are my primary concern.

Copy link
Contributor

Choose a reason for hiding this comment

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

Example of how rustc sometimes is missing basic opts that would guarantee a smaller size for -Copt-level=s: rust-lang/rust#100035

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean, one possibility is to do both -Os and -O (default release), but then we're into matrix-style CI (I think?) and I'm not sure I'm up for doing that myself.

It's not a huge deal and I'm happy to change it back though. The code size varies between -Os and -O3 less than it does between architectures (IME). It's far more important to have good and well-defined sensitivity to things that affect code size, which as you say, -Os is probably not the best for.

Copy link
Contributor

Choose a reason for hiding this comment

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

-O is not default --release, it is -Copt-level=2.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, the default for --release is -Copt-level=3, I didn't realize. Maybe we should just create a new cargo project and build it with --release to have the most "realistic" situation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@workingjubilee I am reverting the opt-level flag in my fork, but there is also the question of strip. Cargo's docs say it defaults to none, but I don't know if they mean "for the default profile of debug" or if that's true even for release. It's not listed in the release profile settings.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would just do cargo new --bin foo, then overwrite src/main.rs and run cargo +local build --release. Before that we'd just need to rustup toolchain link the build/<target>/stage0-sysroot directory. At least it will also test that it can be linked with rustup :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not clear to me what the consensus is here (except to put opt-level back to 3). Would it be better to stick with the current single-file approach and implement the cargo-project-approach in a new PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's switch to -Copt-level=3 here and do the cargo changes in a new PR, it will require more changes (as explained in my previous comment).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just rebased with the opt-level changed back to 3 but still with the additional strip option. Let me know if I should drop that one too.

@Kobzol
Copy link
Contributor

Kobzol commented Jul 17, 2023

What's the potential issue? I thought that any PR triggered the workflow as written in the target.

There are (at least) two issues currently:

  1. The part of the workflow that checks out the untrusted part currently has pull-requests: write permission, meaning that it could do whatever it wants with PRs, if the built code was somehow executed. This should be trivial to fix by splitting the current workflow into two jobs (one would measure the binary size, the other would post the comment) and giving no permissions to the first job, and PR permissions to the second job (you cannot change permissions per steps, only per jobs).
  2. The pull_request_target workflow is prone to GHA cache poisoning attacks. I haven't found any way to prevent this, and GH considers this not to be an issue apparently, so it's probably marked as wontfix. This is mostly a theoretical attack vector, because (barring some really obscure bug in rustc), backtrace shouldn't have any way of executing code during its build, and this repository does not use GHA cache in any way currently (AFAIK). But I suppose that all attack vectors first start as theoretical...

@Kobzol
Copy link
Contributor

Kobzol commented Jul 17, 2023

FWIW, fixing the first issue to make sure that no permissions are available to the job that could actually in theory run untrusted code, would be a good enough fix for now.

@detly
Copy link
Contributor Author

detly commented Jul 17, 2023

FWIW, fixing the first issue to make sure that no permissions are available to the job that could actually in theory run untrusted code, would be a good enough fix for now.

I could do that, the sizes are just numbers so they can be conveyed via env vars without even needing artifacts passed around.

@Kobzol
Copy link
Contributor

Kobzol commented Jul 17, 2023

I could do that, the sizes are just numbers so they can be conveyed via env vars without even needing artifacts passed around.

I think that ENV vars are not persisted between jobs. It could be done via job outputs though, that's quite similar.

@detly
Copy link
Contributor Author

detly commented Jul 18, 2023

It could be done via job outputs though, that's quite similar.

Yep, this was easy enough, 8d65e69 has it. Here's an example of it posting a comment.

@detly
Copy link
Contributor Author

detly commented Jul 18, 2023

I also have a solution to the problem of (some) dependency bumps resulting in mismatched symbols. Would you like me to include it in this PR, or would you prefer to limit the scope here and have it in a different PR?

@Kobzol
Copy link
Contributor

Kobzol commented Jul 18, 2023

I would keep it for a separate PR. Good job with the job split, now it should be safer.

@detly
Copy link
Contributor Author

detly commented Jul 18, 2023

One other very minor thing, but I am finding numbers like 391568B kind of hard to read. Would anyone like me to format the number with, say, Intl.NumberFormat({useGrouping: "always"}).format() to add a thousands separator (comma), and add a non-breaking space between the number and unit?

id: measure
env:
RUSTC_FLAGS: -Copt-level=s -Cstrip=symbols
RUSTC_BUILD_DIR: build/x86_64-unknown-linux-gnu
Copy link
Contributor

Choose a reason for hiding this comment

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

Only difference to allow this build on windows is that string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Github uses Bash on Windows too, right? So it would be down to the portability of my use of the non-builtin commands like stat, rm and mktemp. I am fairly sure there would be a way to programmatically detect or generate that build dir from the bootstrapping environment.

If you know the actual Docker image Github use for Windows jobs I could test it out.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I saw that, but in order to test it locally, is there a published Docker image that relates to? AFAIK Github make their own modifications to underlying images to support their CI eg. ubuntu-latest is the official ubuntu:latest Docker image plus various GH/CI related changes. But I have not been able to find out whether these images are available to pull, or how to refer to them if so.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think windows can run in docker, it's some azure stuff that runs windows images here. You can try to test it on your fork of backtrace, i think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point, especially since a lot of contribution to code size comes from platform specific code (eg. gimli and coff). But the downside to this would be that for changes that affect both, you'll get two comments per PR per update, which might be a bit spammy. (Plus, if you ever want to add a dimension to the matrix eg. compiler flags, features, you'll potentially get N×M comments per PR update.)

I had thought there would be a way to change the comment job to summarise it all, but AFAICT Github don't have a way to operate on the combined/collected output from matrices. Even using outputs or artifacts seems like it's subject to race conditions. It's designed for matrix elements to map to independent workflows that don't need the full set of results later.

Copy link
Contributor

@klensy klensy Jul 19, 2023

Choose a reason for hiding this comment

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

I guess it's ok to have 2 comments instead of 1 for now, it can be tweaked later. Looks like you can edit comments (via actions), so potentially it can stack all of them for one commit into one, but that can be done later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so potentially it can stack all of them for one commit into one

I suspect this would still be subject to a read-modify-write race condition with other matrix jobs, but maybe there's a way to avoid that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was wrong about the two comments thing. If other jobs have a needs-dependency on matrix jobs, they run only once, and get only the last output (with order being arbitrary). So accessing outputs is possible by uploading artifacts where collisions are avoided by having distinct (matrix-based) filenames. The comment step would then loop over these outputs (knowing that all are complete, because it gets fired on the last job).

I will see if this works and let you know.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not gonna lie, this is more javascript than I've written for a while. But. I wanted to make it not-horrible to add dimensions or values to the matrix in the future. Basically, the size-measuring-jobs write a file each to an artifact store, and the reporting job reads them all. If there are any changes, it posts a comment that looks like:


Code size changes for a hello-world Rust program linked with libstd with backtrace:

On platform ubuntu-latest:

  • Original binary size: 399,760 B
  • Updated binary size: 379,280 B
  • Difference: -20,480 B (-5.12%)

On platform windows-latest:

  • Original binary size: 160,256 B
  • Updated binary size: 151,552 B
  • Difference: -8,704 B (-5.43%)

@workingjubilee
Copy link
Contributor

One other very minor thing, but I am finding numbers like 391568B kind of hard to read. Would anyone like me to format the number with, say, Intl.NumberFormat({useGrouping: "always"}).format() to add a thousands separator (comma), and add a non-breaking space between the number and unit?

I'd like something that splits out KiB and B, personally.

@detly
Copy link
Contributor Author

detly commented Jul 19, 2023

I'd like something that splits out KiB and B, personally.

I have been playing around with Intl.NumberFormat() which mostly does a decent job, but unfortunately abbreviates the unit of "byte" to... "byte". This is dictated by the source spec they defer to. Here's an example.

For now I've used Intl.NumberFormat() for the numbers and just put B in the strings (example).

Edit: Currently it looks like

Original binary size: 391,568 B
Updated binary size: 371,088 B
Difference: -20,480 B (-5.23%)

@detly
Copy link
Contributor Author

detly commented Jul 21, 2023

(I'm happy to rebase and squash up commits when you're ready.)

@detly
Copy link
Contributor Author

detly commented Aug 8, 2023

This has languished a bit, and I left it alone because I was busy, but if it's still of interest let me know. I should have time now to address anything that's still outstanding.

@workingjubilee
Copy link
Contributor

Sorry!

https://www.youtube.com/watch?v=fksu6FENojY

This looks good, I can approve it as soon as you're happy with it re: commit squashing or w/e.

@detly
Copy link
Contributor Author

detly commented Aug 18, 2023

https://www.youtube.com/watch?v=fksu6FENojY

Oh I hear that. No pressure. I won't be doing anything faster than can be measured in days either. I will tidy up the history and ping you here when that's done. If others have feedback on the details too I'm happy to hear it in the meantime.

This involves writing the size measurements to separate JSON files (one
per matrix job) and retaining them as artifacts, as there's no built-in
way to collect all matrix job outputs into a subsequent job's inputs.
@detly
Copy link
Contributor Author

detly commented Aug 27, 2023

Okay I'm much happier with this. If you want to further squash the commits, I don't mind, but the history as it is now should be clear and valid taken commit by commit too.

@detly
Copy link
Contributor Author

detly commented Aug 27, 2023

Docker was already mad, right?

@workingjubilee
Copy link
Contributor

That failure is new, I think.

Copy link
Contributor

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

Weird and annoying and I'm going to ignore it and merge this.

@workingjubilee workingjubilee merged commit 7b78a4f into rust-lang:master Sep 9, 2023
68 of 70 checks passed
kodiakhq bot pushed a commit to X-oss-byte/Canary-nextjs that referenced this pull request May 1, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [backtrace](https://togithub.com/rust-lang/backtrace-rs) | dependencies | patch | `0.3` -> `0.3.71` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>rust-lang/backtrace-rs (backtrace)</summary>

### [`v0.3.71`](https://togithub.com/rust-lang/backtrace-rs/releases/tag/0.3.71)

[Compare Source](https://togithub.com/rust-lang/backtrace-rs/compare/0.3.70...0.3.71)

This is mostly CI changes, with a very mild bump to our effective cc crate version recorded, and a small modification to a previous changeset to allow backtrace to run at its current checked-in MSRV on Windows. Sorry about that! We will be getting 0.3.70 yanked shortly.

##### What's Changed

-   Make sgx functions exist with cfg(miri) by [@&#8203;saethlin](https://togithub.com/saethlin) in [rust-lang/backtrace-rs#591
-   Update version of cc crate by [@&#8203;jfgoog](https://togithub.com/jfgoog) in [rust-lang/backtrace-rs#592
-   Pull back MSRV on Windows by [@&#8203;workingjubilee](https://togithub.com/workingjubilee) in [rust-lang/backtrace-rs#598
-   Force frame pointers on all i686 tests by [@&#8203;workingjubilee](https://togithub.com/workingjubilee) in [rust-lang/backtrace-rs#601
-   Use rustc from stage0 instead of stage0-sysroot by [@&#8203;Nilstrieb](https://togithub.com/Nilstrieb) in [rust-lang/backtrace-rs#602
-   Cut backtrace 0.3.71 by [@&#8203;workingjubilee](https://togithub.com/workingjubilee) in [rust-lang/backtrace-rs#599

##### New Contributors

-   [@&#8203;jfgoog](https://togithub.com/jfgoog) made their first contribution in [rust-lang/backtrace-rs#592
-   [@&#8203;Nilstrieb](https://togithub.com/Nilstrieb) made their first contribution in [rust-lang/backtrace-rs#602

**Full Changelog**: rust-lang/backtrace-rs@0.3.70...0.3.71

### [`v0.3.70`](https://togithub.com/rust-lang/backtrace-rs/releases/tag/0.3.70)

[Compare Source](https://togithub.com/rust-lang/backtrace-rs/compare/0.3.69...0.3.70)

##### New API

-   A `BacktraceFrame` can now have `resolve(&mut self)` called on it thanks to [@&#8203;fraillt](https://togithub.com/fraillt) in [rust-lang/backtrace-rs#526

##### Platform Support

We added support for new platforms in this release!

-   Thanks to [@&#8203;bzEq](https://togithub.com/bzEq) in [rust-lang/backtrace-rs#508 we now have AIX support!
-   Thanks to [@&#8203;sthibaul](https://togithub.com/sthibaul) in [rust-lang/backtrace-rs#567 we now have GNU/Hurd support!
-   Thanks to [@&#8203;dpaoliello](https://togithub.com/dpaoliello) in [rust-lang/backtrace-rs#587 we now support "emulation-compatible" AArch64 Windows (aka arm64ec)

##### Windows

-   Rewrite msvc backtrace support to be much faster on 64-bit platforms by [@&#8203;wesleywiser](https://togithub.com/wesleywiser) in [rust-lang/backtrace-rs#569
-   Fix i686-pc-windows-gnu missing dbghelp module by [@&#8203;wesleywiser](https://togithub.com/wesleywiser) in [rust-lang/backtrace-rs#571
-   Fix build errors on `thumbv7a-*-windows-msvc` targets by [@&#8203;kleisauke](https://togithub.com/kleisauke) in [rust-lang/backtrace-rs#573
-   Fix panic in backtrace symbolication on win7 by [@&#8203;roblabla](https://togithub.com/roblabla) in [rust-lang/backtrace-rs#578
-   remove few unused windows ffi fn by [@&#8203;klensy](https://togithub.com/klensy) in [rust-lang/backtrace-rs#576
-   Make dbghelp look for PDBs next to their exe/dll. by [@&#8203;michaelwoerister](https://togithub.com/michaelwoerister) in [rust-lang/backtrace-rs#584
-   Revert 32-bit dbghelp to a version WINE (presumably) likes by [@&#8203;ChrisDenton](https://togithub.com/ChrisDenton) in [rust-lang/backtrace-rs#588
-   Update for Win10+ by [@&#8203;ChrisDenton](https://togithub.com/ChrisDenton) in [rust-lang/backtrace-rs#589

##### SGX

Thanks to

-   Adjust frame IP in SGX relative to image base by [@&#8203;mzohreva](https://togithub.com/mzohreva) in [rust-lang/backtrace-rs#566

##### Internals

We did a bunch more work on our CI and internal cleanups

-   Modularise CI workflow and validate outputs for binary size checks. by [@&#8203;detly](https://togithub.com/detly) in [rust-lang/backtrace-rs#549
-   Commit Cargo.lock by [@&#8203;bjorn3](https://togithub.com/bjorn3) in [rust-lang/backtrace-rs#562
-   Enable calling build.rs externally v2 by [@&#8203;pitaj](https://togithub.com/pitaj) in [rust-lang/backtrace-rs#568
-   Upgrade to 2021 ed and inline panics by [@&#8203;nyurik](https://togithub.com/nyurik) in [rust-lang/backtrace-rs#538
-   Fix deny(unused) of an unused import with SGX + Miri by [@&#8203;saethlin](https://togithub.com/saethlin) in [rust-lang/backtrace-rs#581
-   Fix unused_imports warning on latest nightly by [@&#8203;ChrisDenton](https://togithub.com/ChrisDenton) in [rust-lang/backtrace-rs#575
-   Fix CI by [@&#8203;saethlin](https://togithub.com/saethlin) in [rust-lang/backtrace-rs#582
-   Use `addr_of!` by [@&#8203;GrigorenkoPV](https://togithub.com/GrigorenkoPV) in [rust-lang/backtrace-rs#585
-   Write down MSRV policy by [@&#8203;workingjubilee](https://togithub.com/workingjubilee) in [rust-lang/backtrace-rs#561
-   Apply clippy::uninlined_format_args fixes by [@&#8203;nyurik](https://togithub.com/nyurik) in [rust-lang/backtrace-rs#486
-   ignore clippy lints in `symbolize/gimli/stash.rs` by [@&#8203;onur-ozkan](https://togithub.com/onur-ozkan) in [rust-lang/backtrace-rs#586

##### New Contributors

-   [@&#8203;nyurik](https://togithub.com/nyurik) made their first contribution in [rust-lang/backtrace-rs#538
-   [@&#8203;bzEq](https://togithub.com/bzEq) made their first contribution in [rust-lang/backtrace-rs#508
-   [@&#8203;bjorn3](https://togithub.com/bjorn3) made their first contribution in [rust-lang/backtrace-rs#562
-   [@&#8203;sthibaul](https://togithub.com/sthibaul) made their first contribution in [rust-lang/backtrace-rs#567
-   [@&#8203;mzohreva](https://togithub.com/mzohreva) made their first contribution in [rust-lang/backtrace-rs#566
-   [@&#8203;wesleywiser](https://togithub.com/wesleywiser) made their first contribution in [rust-lang/backtrace-rs#569
-   [@&#8203;kleisauke](https://togithub.com/kleisauke) made their first contribution in [rust-lang/backtrace-rs#573
-   [@&#8203;roblabla](https://togithub.com/roblabla) made their first contribution in [rust-lang/backtrace-rs#578
-   [@&#8203;michaelwoerister](https://togithub.com/michaelwoerister) made their first contribution in [rust-lang/backtrace-rs#584
-   [@&#8203;dpaoliello](https://togithub.com/dpaoliello) made their first contribution in [rust-lang/backtrace-rs#587
-   [@&#8203;GrigorenkoPV](https://togithub.com/GrigorenkoPV) made their first contribution in [rust-lang/backtrace-rs#585
-   [@&#8203;fraillt](https://togithub.com/fraillt) made their first contribution in [rust-lang/backtrace-rs#526
-   [@&#8203;onur-ozkan](https://togithub.com/onur-ozkan) made their first contribution in [rust-lang/backtrace-rs#586

**Full Changelog**: rust-lang/backtrace-rs@0.3.69...0.3.70

### [`v0.3.69`](https://togithub.com/rust-lang/backtrace-rs/releases/tag/0.3.69)

[Compare Source](https://togithub.com/rust-lang/backtrace-rs/compare/0.3.68...0.3.69)

Thank you everyone for contributing to a very nice release!

##### Tracking Binary Size

As backtrace-rs is compiled into every single Rust program, we have begun tracking its binary size in order to find ways to reduce its impact on programs that only minimally use backtraces over time. This change is mostly relevant to this crate's CI, and has been implemented by [@&#8203;Kobzol](https://togithub.com/Kobzol) and [@&#8203;detly](https://togithub.com/detly) over PRs [#&#8203;542](https://togithub.com/rust-lang/backtrace-rs/issues/542), [#&#8203;544](https://togithub.com/rust-lang/backtrace-rs/issues/544), [#&#8203;546](https://togithub.com/rust-lang/backtrace-rs/issues/546), and [#&#8203;550](https://togithub.com/rust-lang/backtrace-rs/issues/550)!

##### Platform-Specific Fixes

As usual, the majority of PRs for this release only affect 1 or 2 platforms. Technically, even the binary-size tracking is only implemented to track binary size on `x86_64-unknown-linux-gnu`.

##### fuchsia

Backtraces for Fuchsia will now uses extended symbolization thanks to [@&#8203;liudangyi](https://togithub.com/liudangyi) in [rust-lang/backtrace-rs#559

##### unix (with `procfs`)

Many Unix-y platforms support `/proc`, including Linux and FreeBSD, but not OpenBSD. For those which do, backtrace uses `/proc/self/maps` to assist in recovering the trace. We did not parse the output of `/proc/self/maps` in a way that accounted for the fact that it may have spaces in path names, but this was fixed thanks to [@&#8203;MasonRemaley](https://togithub.com/MasonRemaley) in [rust-lang/backtrace-rs#553

##### windows-msvc

Some changes that should help binary size specifically on Windows MSVC targets, or at least compile times, have already been implemented, thanks to [@&#8203;klensy](https://togithub.com/klensy) in [rust-lang/backtrace-rs#543 omitting compiling-in ELF backtrace capabilities. We don't have full binary size tracking for all major supported operating systems yet, so we believe this is worth 30KiB but that's more of an estimate than hard stats.

##### Dependency Management

-   Update addr2line and object dependencies by [@&#8203;philipc](https://togithub.com/philipc) in [rust-lang/backtrace-rs#557
-   Exclude ci directory from packaged crate by [@&#8203;mulkieran](https://togithub.com/mulkieran) in [rust-lang/backtrace-rs#555
-   Enable calling build.rs directly from std/build.rs by [@&#8203;pitaj](https://togithub.com/pitaj) in [rust-lang/backtrace-rs#556

##### New Contributors

-   [@&#8203;Kobzol](https://togithub.com/Kobzol) made their first contribution in [rust-lang/backtrace-rs#542
-   [@&#8203;detly](https://togithub.com/detly) made their first contribution in [rust-lang/backtrace-rs#550
-   [@&#8203;liudangyi](https://togithub.com/liudangyi) made their first contribution in [rust-lang/backtrace-rs#559
-   [@&#8203;MasonRemaley](https://togithub.com/MasonRemaley) made their first contribution in [rust-lang/backtrace-rs#553
-   [@&#8203;mulkieran](https://togithub.com/mulkieran) made their first contribution in [rust-lang/backtrace-rs#555
-   [@&#8203;pitaj](https://togithub.com/pitaj) made their first contribution in [rust-lang/backtrace-rs#556
-   [@&#8203;klensy](https://togithub.com/klensy) made their first contribution in [rust-lang/backtrace-rs#543

**Full Changelog**: rust-lang/backtrace-rs@0.3.68...0.3.69

### [`v0.3.68`](https://togithub.com/rust-lang/backtrace-rs/releases/tag/0.3.68)

[Compare Source](https://togithub.com/rust-lang/backtrace-rs/compare/0.3.67...0.3.68)

A bunch of behind-the-scenes work on upgrading CI has finally got things to a place where we can do confident releases again, so hopefully the next backtrace version will not take 6 months! Thanks to everyone who contributed to that! Most of the user-facing changes are about dependency updates and consequent improved platform compatibility, including with split DWARF. A few new functions on BacktraceFmt should also make it easier to inject additional text into backtrace's output.

-   Adapt to new Fuchsia target name by [@&#8203;flba-eb](https://togithub.com/flba-eb) in [rust-lang/backtrace-rs#509
-   armv7 PSVita OS support by [@&#8203;nikarh](https://togithub.com/nikarh) in [rust-lang/backtrace-rs#523
-   Upgrade addr2line and properly handle split DWARF on Linux by [@&#8203;khuey](https://togithub.com/khuey) in [rust-lang/backtrace-rs#513
-   deps: update miniz_oxide to 0.7 by [@&#8203;poliorcetics](https://togithub.com/poliorcetics) in [rust-lang/backtrace-rs#521
-   Add print in BacktraceFmt by [@&#8203;chenyukang](https://togithub.com/chenyukang) in [rust-lang/backtrace-rs#527
-   Bump object to 0.31 by [@&#8203;lnicola](https://togithub.com/lnicola) in [rust-lang/backtrace-rs#522
-   Add an exception for QNX Neutrino 7.0 as a 'no-op' platform by [@&#8203;samkearney](https://togithub.com/samkearney) in [rust-lang/backtrace-rs#529
-   Use mmap64 on Linux. by [@&#8203;mikebenfield](https://togithub.com/mikebenfield) in [rust-lang/backtrace-rs#501
-   dbghlp: Make mutex name unique to the process by [@&#8203;ChrisDenton](https://togithub.com/ChrisDenton) in [rust-lang/backtrace-rs#518
-   gimli add netbsd to handle dl_iterate_phdr as well. by [@&#8203;devnexen](https://togithub.com/devnexen) in [rust-lang/backtrace-rs#512
-   Add other apple targets to libunwind workaround by [@&#8203;thomcc](https://togithub.com/thomcc) in [rust-lang/backtrace-rs#516
-   Add fmt method for BacktraceFmt by [@&#8203;chenyukang](https://togithub.com/chenyukang) in [rust-lang/backtrace-rs#532

##### New Contributors

-   [@&#8203;bwmf2](https://togithub.com/bwmf2) made their first contribution in [rust-lang/backtrace-rs#515
-   [@&#8203;flba-eb](https://togithub.com/flba-eb) made their first contribution in [rust-lang/backtrace-rs#509
-   [@&#8203;nikarh](https://togithub.com/nikarh) made their first contribution in [rust-lang/backtrace-rs#523
-   [@&#8203;poliorcetics](https://togithub.com/poliorcetics) made their first contribution in [rust-lang/backtrace-rs#521
-   [@&#8203;GuillaumeGomez](https://togithub.com/GuillaumeGomez) made their first contribution in [rust-lang/backtrace-rs#524
-   [@&#8203;chenyukang](https://togithub.com/chenyukang) made their first contribution in [rust-lang/backtrace-rs#527
-   [@&#8203;lnicola](https://togithub.com/lnicola) made their first contribution in [rust-lang/backtrace-rs#522
-   [@&#8203;samkearney](https://togithub.com/samkearney) made their first contribution in [rust-lang/backtrace-rs#529
-   [@&#8203;mikebenfield](https://togithub.com/mikebenfield) made their first contribution in [rust-lang/backtrace-rs#501
-   [@&#8203;devnexen](https://togithub.com/devnexen) made their first contribution in [rust-lang/backtrace-rs#512
-   [@&#8203;thomcc](https://togithub.com/thomcc) made their first contribution in [rust-lang/backtrace-rs#516
-   [@&#8203;workingjubilee](https://togithub.com/workingjubilee) made their first contribution in [rust-lang/backtrace-rs#533
-   [@&#8203;chriswailes](https://togithub.com/chriswailes) made their first contribution in [rust-lang/backtrace-rs#534

**Full Changelog**: rust-lang/backtrace-rs@0.3.67...0.3.68

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Canary-nextjs).
kodiakhq bot pushed a commit to X-oss-byte/Nextjs that referenced this pull request May 1, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [backtrace](https://togithub.com/rust-lang/backtrace-rs) | dependencies | patch | `0.3` -> `0.3.71` |

---

### Release Notes

<details>
<summary>rust-lang/backtrace-rs (backtrace)</summary>

### [`v0.3.71`](https://togithub.com/rust-lang/backtrace-rs/releases/tag/0.3.71)

[Compare Source](https://togithub.com/rust-lang/backtrace-rs/compare/0.3.70...0.3.71)

This is mostly CI changes, with a very mild bump to our effective cc crate version recorded, and a small modification to a previous changeset to allow backtrace to run at its current checked-in MSRV on Windows. Sorry about that! We will be getting 0.3.70 yanked shortly.

##### What's Changed

-   Make sgx functions exist with cfg(miri) by [@&#8203;saethlin](https://togithub.com/saethlin) in [rust-lang/backtrace-rs#591
-   Update version of cc crate by [@&#8203;jfgoog](https://togithub.com/jfgoog) in [rust-lang/backtrace-rs#592
-   Pull back MSRV on Windows by [@&#8203;workingjubilee](https://togithub.com/workingjubilee) in [rust-lang/backtrace-rs#598
-   Force frame pointers on all i686 tests by [@&#8203;workingjubilee](https://togithub.com/workingjubilee) in [rust-lang/backtrace-rs#601
-   Use rustc from stage0 instead of stage0-sysroot by [@&#8203;Nilstrieb](https://togithub.com/Nilstrieb) in [rust-lang/backtrace-rs#602
-   Cut backtrace 0.3.71 by [@&#8203;workingjubilee](https://togithub.com/workingjubilee) in [rust-lang/backtrace-rs#599

##### New Contributors

-   [@&#8203;jfgoog](https://togithub.com/jfgoog) made their first contribution in [rust-lang/backtrace-rs#592
-   [@&#8203;Nilstrieb](https://togithub.com/Nilstrieb) made their first contribution in [rust-lang/backtrace-rs#602

**Full Changelog**: rust-lang/backtrace-rs@0.3.70...0.3.71

### [`v0.3.70`](https://togithub.com/rust-lang/backtrace-rs/releases/tag/0.3.70)

[Compare Source](https://togithub.com/rust-lang/backtrace-rs/compare/0.3.69...0.3.70)

##### New API

-   A `BacktraceFrame` can now have `resolve(&mut self)` called on it thanks to [@&#8203;fraillt](https://togithub.com/fraillt) in [rust-lang/backtrace-rs#526

##### Platform Support

We added support for new platforms in this release!

-   Thanks to [@&#8203;bzEq](https://togithub.com/bzEq) in [rust-lang/backtrace-rs#508 we now have AIX support!
-   Thanks to [@&#8203;sthibaul](https://togithub.com/sthibaul) in [rust-lang/backtrace-rs#567 we now have GNU/Hurd support!
-   Thanks to [@&#8203;dpaoliello](https://togithub.com/dpaoliello) in [rust-lang/backtrace-rs#587 we now support "emulation-compatible" AArch64 Windows (aka arm64ec)

##### Windows

-   Rewrite msvc backtrace support to be much faster on 64-bit platforms by [@&#8203;wesleywiser](https://togithub.com/wesleywiser) in [rust-lang/backtrace-rs#569
-   Fix i686-pc-windows-gnu missing dbghelp module by [@&#8203;wesleywiser](https://togithub.com/wesleywiser) in [rust-lang/backtrace-rs#571
-   Fix build errors on `thumbv7a-*-windows-msvc` targets by [@&#8203;kleisauke](https://togithub.com/kleisauke) in [rust-lang/backtrace-rs#573
-   Fix panic in backtrace symbolication on win7 by [@&#8203;roblabla](https://togithub.com/roblabla) in [rust-lang/backtrace-rs#578
-   remove few unused windows ffi fn by [@&#8203;klensy](https://togithub.com/klensy) in [rust-lang/backtrace-rs#576
-   Make dbghelp look for PDBs next to their exe/dll. by [@&#8203;michaelwoerister](https://togithub.com/michaelwoerister) in [rust-lang/backtrace-rs#584
-   Revert 32-bit dbghelp to a version WINE (presumably) likes by [@&#8203;ChrisDenton](https://togithub.com/ChrisDenton) in [rust-lang/backtrace-rs#588
-   Update for Win10+ by [@&#8203;ChrisDenton](https://togithub.com/ChrisDenton) in [rust-lang/backtrace-rs#589

##### SGX

Thanks to

-   Adjust frame IP in SGX relative to image base by [@&#8203;mzohreva](https://togithub.com/mzohreva) in [rust-lang/backtrace-rs#566

##### Internals

We did a bunch more work on our CI and internal cleanups

-   Modularise CI workflow and validate outputs for binary size checks. by [@&#8203;detly](https://togithub.com/detly) in [rust-lang/backtrace-rs#549
-   Commit Cargo.lock by [@&#8203;bjorn3](https://togithub.com/bjorn3) in [rust-lang/backtrace-rs#562
-   Enable calling build.rs externally v2 by [@&#8203;pitaj](https://togithub.com/pitaj) in [rust-lang/backtrace-rs#568
-   Upgrade to 2021 ed and inline panics by [@&#8203;nyurik](https://togithub.com/nyurik) in [rust-lang/backtrace-rs#538
-   Fix deny(unused) of an unused import with SGX + Miri by [@&#8203;saethlin](https://togithub.com/saethlin) in [rust-lang/backtrace-rs#581
-   Fix unused_imports warning on latest nightly by [@&#8203;ChrisDenton](https://togithub.com/ChrisDenton) in [rust-lang/backtrace-rs#575
-   Fix CI by [@&#8203;saethlin](https://togithub.com/saethlin) in [rust-lang/backtrace-rs#582
-   Use `addr_of!` by [@&#8203;GrigorenkoPV](https://togithub.com/GrigorenkoPV) in [rust-lang/backtrace-rs#585
-   Write down MSRV policy by [@&#8203;workingjubilee](https://togithub.com/workingjubilee) in [rust-lang/backtrace-rs#561
-   Apply clippy::uninlined_format_args fixes by [@&#8203;nyurik](https://togithub.com/nyurik) in [rust-lang/backtrace-rs#486
-   ignore clippy lints in `symbolize/gimli/stash.rs` by [@&#8203;onur-ozkan](https://togithub.com/onur-ozkan) in [rust-lang/backtrace-rs#586

##### New Contributors

-   [@&#8203;nyurik](https://togithub.com/nyurik) made their first contribution in [rust-lang/backtrace-rs#538
-   [@&#8203;bzEq](https://togithub.com/bzEq) made their first contribution in [rust-lang/backtrace-rs#508
-   [@&#8203;bjorn3](https://togithub.com/bjorn3) made their first contribution in [rust-lang/backtrace-rs#562
-   [@&#8203;sthibaul](https://togithub.com/sthibaul) made their first contribution in [rust-lang/backtrace-rs#567
-   [@&#8203;mzohreva](https://togithub.com/mzohreva) made their first contribution in [rust-lang/backtrace-rs#566
-   [@&#8203;wesleywiser](https://togithub.com/wesleywiser) made their first contribution in [rust-lang/backtrace-rs#569
-   [@&#8203;kleisauke](https://togithub.com/kleisauke) made their first contribution in [rust-lang/backtrace-rs#573
-   [@&#8203;roblabla](https://togithub.com/roblabla) made their first contribution in [rust-lang/backtrace-rs#578
-   [@&#8203;michaelwoerister](https://togithub.com/michaelwoerister) made their first contribution in [rust-lang/backtrace-rs#584
-   [@&#8203;dpaoliello](https://togithub.com/dpaoliello) made their first contribution in [rust-lang/backtrace-rs#587
-   [@&#8203;GrigorenkoPV](https://togithub.com/GrigorenkoPV) made their first contribution in [rust-lang/backtrace-rs#585
-   [@&#8203;fraillt](https://togithub.com/fraillt) made their first contribution in [rust-lang/backtrace-rs#526
-   [@&#8203;onur-ozkan](https://togithub.com/onur-ozkan) made their first contribution in [rust-lang/backtrace-rs#586

**Full Changelog**: rust-lang/backtrace-rs@0.3.69...0.3.70

### [`v0.3.69`](https://togithub.com/rust-lang/backtrace-rs/releases/tag/0.3.69)

[Compare Source](https://togithub.com/rust-lang/backtrace-rs/compare/0.3.68...0.3.69)

Thank you everyone for contributing to a very nice release!

##### Tracking Binary Size

As backtrace-rs is compiled into every single Rust program, we have begun tracking its binary size in order to find ways to reduce its impact on programs that only minimally use backtraces over time. This change is mostly relevant to this crate's CI, and has been implemented by [@&#8203;Kobzol](https://togithub.com/Kobzol) and [@&#8203;detly](https://togithub.com/detly) over PRs [#&#8203;542](https://togithub.com/rust-lang/backtrace-rs/issues/542), [#&#8203;544](https://togithub.com/rust-lang/backtrace-rs/issues/544), [#&#8203;546](https://togithub.com/rust-lang/backtrace-rs/issues/546), and [#&#8203;550](https://togithub.com/rust-lang/backtrace-rs/issues/550)!

##### Platform-Specific Fixes

As usual, the majority of PRs for this release only affect 1 or 2 platforms. Technically, even the binary-size tracking is only implemented to track binary size on `x86_64-unknown-linux-gnu`.

##### fuchsia

Backtraces for Fuchsia will now uses extended symbolization thanks to [@&#8203;liudangyi](https://togithub.com/liudangyi) in [rust-lang/backtrace-rs#559

##### unix (with `procfs`)

Many Unix-y platforms support `/proc`, including Linux and FreeBSD, but not OpenBSD. For those which do, backtrace uses `/proc/self/maps` to assist in recovering the trace. We did not parse the output of `/proc/self/maps` in a way that accounted for the fact that it may have spaces in path names, but this was fixed thanks to [@&#8203;MasonRemaley](https://togithub.com/MasonRemaley) in [rust-lang/backtrace-rs#553

##### windows-msvc

Some changes that should help binary size specifically on Windows MSVC targets, or at least compile times, have already been implemented, thanks to [@&#8203;klensy](https://togithub.com/klensy) in [rust-lang/backtrace-rs#543 omitting compiling-in ELF backtrace capabilities. We don't have full binary size tracking for all major supported operating systems yet, so we believe this is worth 30KiB but that's more of an estimate than hard stats.

##### Dependency Management

-   Update addr2line and object dependencies by [@&#8203;philipc](https://togithub.com/philipc) in [rust-lang/backtrace-rs#557
-   Exclude ci directory from packaged crate by [@&#8203;mulkieran](https://togithub.com/mulkieran) in [rust-lang/backtrace-rs#555
-   Enable calling build.rs directly from std/build.rs by [@&#8203;pitaj](https://togithub.com/pitaj) in [rust-lang/backtrace-rs#556

##### New Contributors

-   [@&#8203;Kobzol](https://togithub.com/Kobzol) made their first contribution in [rust-lang/backtrace-rs#542
-   [@&#8203;detly](https://togithub.com/detly) made their first contribution in [rust-lang/backtrace-rs#550
-   [@&#8203;liudangyi](https://togithub.com/liudangyi) made their first contribution in [rust-lang/backtrace-rs#559
-   [@&#8203;MasonRemaley](https://togithub.com/MasonRemaley) made their first contribution in [rust-lang/backtrace-rs#553
-   [@&#8203;mulkieran](https://togithub.com/mulkieran) made their first contribution in [rust-lang/backtrace-rs#555
-   [@&#8203;pitaj](https://togithub.com/pitaj) made their first contribution in [rust-lang/backtrace-rs#556
-   [@&#8203;klensy](https://togithub.com/klensy) made their first contribution in [rust-lang/backtrace-rs#543

**Full Changelog**: rust-lang/backtrace-rs@0.3.68...0.3.69

### [`v0.3.68`](https://togithub.com/rust-lang/backtrace-rs/releases/tag/0.3.68)

[Compare Source](https://togithub.com/rust-lang/backtrace-rs/compare/0.3.67...0.3.68)

A bunch of behind-the-scenes work on upgrading CI has finally got things to a place where we can do confident releases again, so hopefully the next backtrace version will not take 6 months! Thanks to everyone who contributed to that! Most of the user-facing changes are about dependency updates and consequent improved platform compatibility, including with split DWARF. A few new functions on BacktraceFmt should also make it easier to inject additional text into backtrace's output.

-   Adapt to new Fuchsia target name by [@&#8203;flba-eb](https://togithub.com/flba-eb) in [rust-lang/backtrace-rs#509
-   armv7 PSVita OS support by [@&#8203;nikarh](https://togithub.com/nikarh) in [rust-lang/backtrace-rs#523
-   Upgrade addr2line and properly handle split DWARF on Linux by [@&#8203;khuey](https://togithub.com/khuey) in [rust-lang/backtrace-rs#513
-   deps: update miniz_oxide to 0.7 by [@&#8203;poliorcetics](https://togithub.com/poliorcetics) in [rust-lang/backtrace-rs#521
-   Add print in BacktraceFmt by [@&#8203;chenyukang](https://togithub.com/chenyukang) in [rust-lang/backtrace-rs#527
-   Bump object to 0.31 by [@&#8203;lnicola](https://togithub.com/lnicola) in [rust-lang/backtrace-rs#522
-   Add an exception for QNX Neutrino 7.0 as a 'no-op' platform by [@&#8203;samkearney](https://togithub.com/samkearney) in [rust-lang/backtrace-rs#529
-   Use mmap64 on Linux. by [@&#8203;mikebenfield](https://togithub.com/mikebenfield) in [rust-lang/backtrace-rs#501
-   dbghlp: Make mutex name unique to the process by [@&#8203;ChrisDenton](https://togithub.com/ChrisDenton) in [rust-lang/backtrace-rs#518
-   gimli add netbsd to handle dl_iterate_phdr as well. by [@&#8203;devnexen](https://togithub.com/devnexen) in [rust-lang/backtrace-rs#512
-   Add other apple targets to libunwind workaround by [@&#8203;thomcc](https://togithub.com/thomcc) in [rust-lang/backtrace-rs#516
-   Add fmt method for BacktraceFmt by [@&#8203;chenyukang](https://togithub.com/chenyukang) in [rust-lang/backtrace-rs#532

##### New Contributors

-   [@&#8203;bwmf2](https://togithub.com/bwmf2) made their first contribution in [rust-lang/backtrace-rs#515
-   [@&#8203;flba-eb](https://togithub.com/flba-eb) made their first contribution in [rust-lang/backtrace-rs#509
-   [@&#8203;nikarh](https://togithub.com/nikarh) made their first contribution in [rust-lang/backtrace-rs#523
-   [@&#8203;poliorcetics](https://togithub.com/poliorcetics) made their first contribution in [rust-lang/backtrace-rs#521
-   [@&#8203;GuillaumeGomez](https://togithub.com/GuillaumeGomez) made their first contribution in [rust-lang/backtrace-rs#524
-   [@&#8203;chenyukang](https://togithub.com/chenyukang) made their first contribution in [rust-lang/backtrace-rs#527
-   [@&#8203;lnicola](https://togithub.com/lnicola) made their first contribution in [rust-lang/backtrace-rs#522
-   [@&#8203;samkearney](https://togithub.com/samkearney) made their first contribution in [rust-lang/backtrace-rs#529
-   [@&#8203;mikebenfield](https://togithub.com/mikebenfield) made their first contribution in [rust-lang/backtrace-rs#501
-   [@&#8203;devnexen](https://togithub.com/devnexen) made their first contribution in [rust-lang/backtrace-rs#512
-   [@&#8203;thomcc](https://togithub.com/thomcc) made their first contribution in [rust-lang/backtrace-rs#516
-   [@&#8203;workingjubilee](https://togithub.com/workingjubilee) made their first contribution in [rust-lang/backtrace-rs#533
-   [@&#8203;chriswailes](https://togithub.com/chriswailes) made their first contribution in [rust-lang/backtrace-rs#534

**Full Changelog**: rust-lang/backtrace-rs@0.3.67...0.3.68

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Nextjs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants