Open peakschris opened 2 weeks ago
I'm also seeing this in rules_multirun directly:
rules_multirun\tests>bazel run //tests:multirun_parallel
INFO: Invocation ID: e556a35b-abf7-46f2-83c7-9e666d412545
INFO: Analyzed target //tests:multirun_parallel (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //tests:multirun_parallel up-to-date:
bazel-bin/tests/multirun_parallel.bash
INFO: Elapsed time: 14.723s, Critical Path: 14.12s
INFO: 2 processes: 1 internal, 1 local.
INFO: Build completed successfully, 2 total actions
INFO: Running command line: bazel-bin/tests/multirun_parallel.bash
FATAL: ExecuteProgram(D:\udu\b\a7g3pybb\execroot\_main\bazel-out\x64_windows-fastbuild\bin\tests\multirun_parallel.bash) failed: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("D:\udu\b\a7g3pybb\execroot\_main\bazel-out\x64_windows-fastbuild\bin\tests\multirun_parallel.bash"): %1 is not a valid Win32 application.
(error: 193)
I have an env up and running; if you can share some ideas, I can try them out
I wonder if the issue is we need to be naming something with .exe
at the end here? Or is it that we need to be calling bash.exe path/to/foo.bash
?
I did some digging. Seems that ctx.runfiles don't work with bash scripts on windows. There is prior art in aspect bazel-lib, which has a tool that wraps a bash in a bat. I hacked this into an fix here: https://github.com/keith/rules_multirun/compare/main...peakschris:rules_multirun:windows
But it all seems over-complex; all you are doing is launching the initial py_binary script. I wonder if there is a more modern canonical way to launch that works on all platforms?
@alexeagle, do you have any ideas?
My fix isn't quite there yet, I'm still getting errors:
d:\workdir\rules_lint3\example>bazel run :format
INFO: Running command line: bazel-bin/tools/format/format_windows.bash.bat
**xargs: environment is too large for exec**
Formatted C++ in 0m0.206s
FAILED: A formatter tool exited with code 1
I'm seeing an error in latest rules_lint, which I believe uses multirun 0.9.0 for its format module:
This surprises me because at a glance it looks like rules_multirun invokes bash scripts with the bash executable.
Do you have any hints? Thanks!