bazelbuild / bazelbuild/rules_pkg
//tests:stamp_test inputs become stale too quickly
- Dominant language
- Starlark
- Stars
- 253
- Forks
- 221
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
I often test all of `rules_pkg` using something like `bazelisk test //...`.
When I leave my desk for the day and come back the following day, I sometimes see `//tests:stamp_test` mysteriously fail after making some changes. This is due to the timestamps no longer being valid:
```
Traceback (most recent call last):
File "/private/var/tmp/_bazel_apsaltis/67ca5e5a723760c2131afe9d288ecae5/sandbox/darwin-sandbox/9/execroot/rules_pkg/bazel-out/darwin-fastbuild/bin/tests/stamp_test.runfiles/rules_pkg/tests/stamp_test.py", line 104, in test_not_epoch_times_tar
self.assertTarFilesAreAlmostNew('stamped_tar.tar')
File "/private/var/tmp/_bazel_apsaltis/67ca5e5a723760c2131afe9d288ecae5/sandbox/darwin-sandbox/9/execroot/rules_pkg/bazel-out/darwin-fastbuild/bin/tests/stamp_test.runfiles/rules_pkg/tests/stamp_test.py", line 82, in assertTarFilesAreAlmostNew
self.check_mtime(info.mtime, file_path, info.name)
File "/private/var/tmp/_bazel_apsaltis/67ca5e5a723760c2131afe9d288ecae5/sandbox/darwin-sandbox/9/execroot/rules_pkg/bazel-out/darwin-fastbuild/bin/tests/stamp_test.runfiles/rules_pkg/tests/stamp_test.py", line 63, in check_mtime
self.fail(
AssertionError: Archive /private/var/tmp/_bazel_apsaltis/67ca5e5a723760c2131afe9d288ecae5/sandbox/darwin-sandbox/9/execroot/rules_pkg/bazel-out/darwin-fastbuild/bin/tests/stamp_test.runfiles/rules_pkg/tests/stamped_tar.tar contains file . with mtime:1639538959, expected:1639586337 +/- 10000
```
It would be nice if the relevant artifacts could be rebuilt when they have expired in the cache. I don't know how implement this, though.
This problem is never seen in CI, since it builds everything from scratch all the time.
Contributor guide
Assessment
This issue has not been assessed yet.