Open Xjs opened 5 years ago
When I tried manually executing C:\tmp\_bazel_jannis.schnitzer\r67erewf\execroot\ag_edg_gogs_priips_ateam_murdock_proxy\bazel-out\x64_windows-fastbuild\bin\gazelle
, I encountered another problem: https://github.com/bazelbuild/bazel-gazelle/blob/c0880f7f9d7048b45be5d36115ec2bf444e723c4/internal/gazelle.bash.in#L50 strips file://
from the path reported in the build event log, but on Windows, the path will begin with file:///
, e. g. "uri":"file:///C:/tmp/_bazel_jannis.schnitzer/r67erewf/execroot/com_github_Xjs_rules_go_module_error/bazel-out/x64_windows-fastbuild/bin/external/bazel_gazelle/cmd/gazelle/windows_amd64_stripped/gazelle.exe"
. This should be an easy fix though, once the first problem is resolved.
@Xjs could you try running through the regular cmd shell? I remember trying MinGW bash in the past, but the path rewriting causes so many problems, I can't really supported.
The second problem seems like a bigger issue though.
@jayconrod I hadn't thought of that. Works in Powershell.
I'd still be happy to make this work in MinGW bash, because many users in our organisation just use the bash that comes with Git for Windows, but I absolutely understand your point.
(For some reason, Gazelle is successfully executed when running from PowerShell, even though the contents of the build event log are the same as before.)
Ideally, this wrapper script should be rewritten in Go so we don't have a bash dependency. I think at the time this was written, we didn't support Windows, but at this point, this is almost the only thing in rules_go and Gazelle that still requires bash.
I don't know when this started, because I only recently started running gazelle via bazel run, but:
On Windows, I get the following error when trying to run Gazelle:
I tried with various Gazelle versions (as you can see, this is the lastest commit from master) and with Bazel 0.26.2 and 0.27.0. Maybe the issue has to do with MinGW bash's path mangling, because the referenced file
C:\tmp\_bazel_jannis.schnitzer\r67erewf\execroot\ag_edg_gogs_priips_ateam_murdock_proxy\bazel-out\x64_windows-fastbuild\bin\gazelle
does exist. It can, however, not be executed by entering its backslashy path into a MinGW bash, only with forward slashes it does work.So far, I failed trying to trace where exactly that exact file is actually executed. Maybe this is a bazel bug as well.