Closed GZGavinZhao closed 1 year ago
looking good! can you add windows CI to this too? https://github.com/keith/buildifier-prebuilt/blob/main/.github/workflows/ci.yml
So um I think I've messed up the batch script. On my Linux I have the shell report the exit code of all commands that exited abnormally, but the Windows terminal doesn't do that by default, so I thought the batch runner script ran fine while in fact it always errors out and explodes. I'll try to fix the batch script today and report back later.
Just want to verify the behavior of runner.bash.template
:
no_sandbox
mode, then find
the wanted files while NOT following symlink (directories) and IGNORING symlink (files).find
the wanted files while FOLLOWING symlink (directories) and still IGNORING symlink (files).Am I understanding this correct?
looks right. to understand the intent there i think the important point is just that if you're running a tool just as an executable in the root of your workspace, all the bzl files will just be standard files (and symlinks within the repo will be duplicative). But if you're running as a test bazel will mirror the entire source tree as symlinks (at least on *nix operating systems, not sure about windows?) so -type f
wouldn't discover them. as long as files are discovered in both cases I don't think you have to mirror the same behavior if it differs on windows
@keith I believe the batch error is fixed; would you mind starting the CI?
Started. Will review tomorrow
Sorry for the noise. I believe this is all done except for the tests.
The current situation for testing on Windows is:
//...
somehow gets parsed to /...
. Putting them in double quotes don't help. I could be dumb and completely missed something, so help is appreciated.runner.bat
cannot find buildifier.exe
. However, running the rules in real-world projects succeeds.I don't think 2 is something I can figure out in a short amount of time, so should we care about 1 given that tests will fail anyway?
I've fixed the CI. I found that for some reason ///
gets parsed to //
on Windows, but changing that would affect other platforms, so I just removed the //
at front, so the test commands become bazel test ...
and bazel test :all_integration_tests
. I also skipped integration tests on Windows since there's still issues with rules_bazel_integration_test
. Currently the CI is passing on my fork.
thanks!
Fixes #68.
Still need to fix tests under theDone.tests
directory, should be pretty quick though. Just want to submit it for early review. Commit message will also be formatted shortly.When running the integration tests on Windows, for now one must manually enter theexamples/
directory and build the targets there becauserules_bazel_integration_test
has a circular dependency onbuildifier_prebuilt
. Trying to invoke integration tests directly from the root WORKSPACE will emit a Buildifer toolchain not found error. Once this version is uploaded to BCR this error should go away.Currently
exclude_patterns
is not supported, since thedir.exe
doesn't support this.Additionally, integration tests on Windows will fail. The speculated reason is that Bazel-in-Bazel makes some runfiles disappear on Windows. However, running this rule against real-world project shows no issues.