broken Rust build caching across glibc updates
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
Somehow we need to invalidate the rustc / cargo cache whenever glibc - the only library dependency - is changed, while preserving it in other cases.
This should be solved by https://github.com/bottlerocket-os/bottlerocket-sdk/pull/130
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
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.