Open nacl opened 2 years ago
Yes. I see the same. We could up the window to make it happen every 2 or 3 days. I made my peace with doing a bazel --clean every so often. Even over multiple years, I think that will cost me far less time than trying to solve the problem.
Hm. That's fine, all things considered. Some options:
--stamp
flag chooses to be something consistent and knowable in advance.Regardless, this is more of an annoyance than anything else. We can probably safely punt it to later on.
I don't want to use a constant, because then I loose the check that I am actually getting the build time. This kind of integration tests against the real world, rather than a fixed one, does not play well into bazel's view of reproducibility. I addressed the rest in #497
A possible way to address this would be to create a sh_test
rule that has your distributed .bzl
files as deps
then sets up a WORKSPACE
that loads them and invokes bazel build
on the output. That would make the generation and validation steps invalidate in the same way at the same time. This is effectively what rules_go
does with our integration tests which work... reasonably well.
There is also https://github.com/bazelbuild/bazel-integration-testing, which has a python launcher for achieving this. That repo is, unfortunately, long dormant and I handed over my OWNERS
on it, but I know there has been some renewed interest from the SIG that's being spun up around rules since this is a recurring problem.
That would work too. I've been trying to keep as much in unit tests as possible, but this is really an integration test that I have tried to squeeze into the unit test mindset.
We already have a few tests that create their own WORKSPACE and run bazel from within. It might be worthwhile to factor out the commonality so they are easier to set up.
On Fri, Dec 24, 2021 at 2:02 PM Andrew Z Allen @.***> wrote:
A possible way to address this would be to create a sh_test rule that has your distributed .bzl files as deps then sets up a WORKSPACE that loads them and invokes bazel build on the output. That would make the generation and validation steps invalidate in the same way at the same time. This is effectively what rules_go does with our integration tests https://github.com/bazelbuild/rules_go/tree/master/tests/integration which work... reasonably well.
There is also https://github.com/bazelbuild/bazel-integration-testing, which has a python launcher for achieving this. That repo is, unfortunately, long dormant and I handed over my OWNERS on it, but I know there has been some renewed interest from the SIG that's being spun up around rules since this is a recurring problem.
— Reply to this email directly, view it on GitHub https://github.com/bazelbuild/rules_pkg/issues/489#issuecomment-1000917383, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXHHHC3OW52PJA5AT7P6TLUSS7UVANCNFSM5KED7NKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you commented.Message ID: @.***>
I often test all of
rules_pkg
using something likebazelisk 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: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.