Skip to content
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

Gazelle command not found on Windows #1309

Closed
adam-kov opened this issue Jul 27, 2022 · 2 comments · Fixed by #1604
Closed

Gazelle command not found on Windows #1309

adam-kov opened this issue Jul 27, 2022 · 2 comments · Fixed by #1604

Comments

@adam-kov
Copy link

adam-kov commented Jul 27, 2022

Versions

Name Version
Gazelle 0.26.0
rules_go 0.34.0
Bazel 5.2.0

Does this issue reproduce with the latest releases of all the above?

All of the above is the latest of releases at the time of writing this. (2022.07.27)

What operating system and processor architecture are you using?

Windows 10, 64-bit x86

What did you do?

I followed the Gazelle README setup for Bazel, then I ran the command bazel run //:gazelle in the root of a repo where I tried to set up Go and Node.js - although I got stuck with Go.

My GitHub repo can be found here

What did you expect to see?

I expected Gazelle to create a BUILD.bazel file in the go/services/core.

What did you see instead?

This was the command output:

INFO: Analyzed target //:gazelle (84 packages loaded, 8741 targets configured).
INFO: Found 1 target...
Target //:gazelle up-to-date:
  bazel-bin/gazelle-runner.bash
  bazel-bin/gazelle
  bazel-bin/gazelle.exe
INFO: Elapsed time: 17.216s, Critical Path: 16.16s
INFO: 57 processes: 15 internal, 42 local.
INFO: Build completed successfully, 57 total actions
INFO: Build completed successfully, 57 total actions
/bin/bash: C:\Users\xxxxx\xxxxxxxxxxx\zu4tg5ct\execroot\com_github_n00pper_bazel_go_node_test\bazel-out\x64_windows-fastbuild\bin\gazelle: command not found

The bazel-* folders are generated and there are these files in the bazel-out\x64_windows-fastbuild\bin folder:

  • gazelle
  • gazelle-runner.bash
  • gazelle.exe
  • gazelle.exe.runfiles_manifest

At the moment I'm not even sure I'm using Gazelle correctly, so any clarification is appreciated.

@gjycn
Copy link

gjycn commented May 4, 2023

I encountered the same problem, the same Gin Hello World project, under Windows 11, but it was normal under WSL. Based on the prompt information, I guessed that it was a file extension issue.

grep: C:\\Users\\xxxx\\_bazel_xxxx\\jik7kwyi\\execroot\\__main__\\bazel-out\\x64_windows-fastbuild\\bin\\gazelle.runfiles_manifest: No such file or directory

C:\\Users\\xxxx\\_bazel_xxxx\\jik7kwyi\\execroot\\__main__\\bazel-out\\x64_windows-fastbuild\\bin\\gazelle: warning: could not locate GOROOT used by rules_go

grep: C:\\Users\\xxxx\\_bazel_xxxx\\jik7kwyi\\execroot\\__main__\\bazel-out\\x64_windows-fastbuild\\bin\\gazelle.runfiles_manifest: No such file or directory

error: could not locate gazelle binary

There is only the "gazelle. exe. runfiles_manifest" file in this folder, and there is no "gazelle. runfiles_manifest" file.

I suggest using this tool on Linux until it improves support for Windows.

Name Version
Gazelle 0.27.0
rules_go 0.39.0
Bazel 6.0.0

@bshashank
Copy link

The issue seems to be with the custom find_runfiles function implemented in gazelle.bash.in

I was able to work around the problem via: bshashank@3dc2f47

(but this is still un-tested on other platforms)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants