twoliter icon indicating copy to clipboard operation
twoliter copied to clipboard

broken Rust build caching across glibc updates

Open bcressey opened this issue 2 years ago • 4 comments

Platform I'm building on: aarch64

What I expected to happen: I checked out https://github.com/bottlerocket-os/bottlerocket/pull/3352 and tried to build aws-dev from the same checkout as https://github.com/bottlerocket-os/bottlerocket/pull/3355. I expected to be able to run the build with no issues.

What actually happened: The build succeeded but failed at runtime with a storewolf error:

[    2.901427] storewolf[989]: /usr/bin/storewolf: /aarch64-bottlerocket-linux-gnu/sys-root/usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /usr/bin/storewolf)

storewolf itself is reported as "fresh" at build time, meaning that the binary is not rebuilt despite the glibc change:

bottlerocket-os/bottlerocket#20 0.991        Fresh storewolf v0.1.0 (/home/builder/rpmbuild/BUILD/sources/api/storewolf)

How to reproduce the problem: I'd expect the same failure mode after any sequence like this:

  • build the variant with a newer glibc
  • downgrade or revert back to an older glibc
  • build the variant again
  • attempt to run it

bcressey avatar Aug 24 '23 05:08 bcressey

Somehow we need to invalidate the rustc / cargo cache whenever glibc - the only library dependency - is changed, while preserving it in other cases.

bcressey avatar Aug 24 '23 05:08 bcressey

This should be solved by https://github.com/bottlerocket-os/bottlerocket-sdk/pull/130

cbgbt avatar Aug 25 '23 19:08 cbgbt

Can we close this? We already merged https://github.com/bottlerocket-os/bottlerocket-sdk/pull/130, and https://github.com/bottlerocket-os/bottlerocket/pull/3371

arnaldo2792 avatar Sep 06 '23 23:09 arnaldo2792

I'm still seeing "fresh" crates across consecutive builds of the os package, as long as sources don't change. So I expect this is still a potential bug.

bcressey avatar Sep 09 '23 04:09 bcressey