rust-lang / backtrace-rs

Backtraces in Rust
https://docs.rs/backtrace
Other
524 stars 240 forks source link

Omit copying patched std build output for checking binary size in CI #550

Closed detly closed 1 year ago

detly commented 1 year ago

The CI workflow to check binary size started failing for me a few hours ago, and in this repo too now. The error happens when the bootstrapped files are copied over to be used for building a test binary; cp says:

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

I have confirmed manually (in a Docker container) that this is because the files have the same inode ie. they are hardlinks. Using the --remove-destination flag allows the copy to proceed. Neither the -f (force) nor -u (update) flags will.

(I was not able to figure out why they are suddenly hardlinks today, but I thought I'd share the change in case it saved some time.)

philipc commented 1 year ago

It's probably because https://github.com/rust-lang/rust/pull/113341 has been merged. Maybe we don't need to do the copy here at all now.

detly commented 1 year ago

On reflection, you'd only want to do this if you want the workflow itself to work for older versions of std. I don't think you do though, because the point is to check the size change at roughly the point at which the PR is merged, right? So I could just remove the copies.

workingjubilee commented 1 year ago

Yes, we only care about current size, we can just use the fact the build system does the copying, now.

klensy commented 1 year ago

https://github.com/rust-lang/backtrace-rs/pull/542#issue-1789048235 mentions that after https://github.com/rust-lang/rust/pull/113341 merged, there can be 4 lines removed.

detly commented 1 year ago

I have removed the copies altogether.

Kobzol commented 1 year ago

The copies should be removed after https://github.com/rust-lang/rust/pull/113341, indeed.

workingjubilee commented 1 year ago

Oh nice. Thanks!