-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support --noenable_runfiles on linux and windows, new runfiles bat macro, fix tests for windows #872
base: main
Are you sure you want to change the base?
Conversation
@alexeagle could I get your thoughts on this? My rules_multirun pr will depend on this. |
Alex wrote (keith/rules_multirun#43)
No worries Alex! @fmeum in the meantime, could you review windows_utils.bzl? |
It's really hard to get enough focus time from any of the folks you @-mentioned here to review something that's larger than bite-sized. I don't want to lose your improvements though! And I've been working in Windows the last couple days. Could you take a bit of time to carve out individual units from this which could land as standalone PRs? At least that way the easy ones get merged. |
This PR contains an update of the runfiles code in windows_utils.bzl to match the runfiles v3 standard (compatible with latest bzlmod). I've also taken the opportunity to fix many tests to work under windows, both with --enable_runfiles and --noenable_runfiles, which required using the new runfiles code to correctly resolve data.
I suspect that the existing tests on linux don't/can't currently validate --noenable_runfiles behaviour of the underlying rules.
Whilst under linux
bazel test
always enables runfiles (ignoring the --noenable_runfiles flag bazelbuild/bazel#22856), under windows this flag does have effect, and is the default, so getting tests clean on windows require test cases to handle runfiles manifests. Also, this would seem to be the only way that we can validate that the rules we are testing work correctly without runfiles.I have added a test runner script that runs each test case with
bazel run
, simulating windows behaviour with --noenable_runfiles. This script has some caveats, namely that it writes test outputs to source tree. See lib/tests/README.md for more.The only windows failures are now in directories with missing windows packages: lib/tests/tar,lib/tests/assert_archive_contains,lib/tests/zstd. Missing packages are unzip, bsdtar, zstd. Additionally, 3 bats tests timeout on windows, there seems to be some kind of concurrency issue. With tags=["exclusive"], they pass occasionally but most often still timeout.
@meteorcloudy @fmeum
Changes are visible to end-users: yes
Suggested release notes
Test plan
Test results: linux - before
Test results: linux - after
Note: an extra 4 are skipped as I have marked them as incompatible with noenable_runfiles
Test results: windows - before
Baseline failures (test enable runfiles):
Test results: windows - after