Closed Vertexwahn closed 14 hours ago
I've also been seeing this, windows 10, regardless of shell (cmd, bash, powershell)
Hi @Vertexwahn, Could you please provide complete steps to reproduce this issue?
For me, on windows:
git clone https://github.com/bazelbuild/bazel.git
cd bazel
git checkout release-7.2.1 #specific release unimportant
bazel mod graph
displays:
Starting local Bazel server and connecting to it...
<root> (bazel@_)
Γö£ΓöÇΓöÇΓöÇabseil-cpp@20230125.1
Γöé Γö£ΓöÇΓöÇΓöÇbazel_skylib@1.6.1 (*)
Γöé Γö£ΓöÇΓöÇΓöÇplatforms@0.0.9 (*)
Γöé ΓööΓöÇΓöÇΓöÇrules_cc@0.0.9 (*)
<snip>
What happens if you pass --charset=ascii
? Does your terminal support UTF-8?
--charset=ascii
shows the tables, albeit less nicely:
The terminal does support UTF-8:
wget https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
cat UTF-8-demo.txt
shows:
Sounds like Windows requires special API usage for printing UTF-8 to the console: https://stackoverflow.com/a/9337400/297261
If you are interested, you could try integrating WriteConsoleW
in WriteToStdOutErr
here:
https://cs.opensource.google/bazel/bazel/+/master:src/main/cpp/util/file_windows.cc;drc=7f782e3c1a1c4a21beea19c2cedb614be8316e67
Edit: Fixed the reference
I added this one line to file_windows.cc:
bazel mod graph now outputs:
I think SetConsoleOutputCP could just be called once somewhere from main(), as long as it is not reset elsewhere.
Sorry, I can't submit this as a PR due to CLA.
Chris
@bazel-io fork 7.3.0
Description of the bug:
bazel mod graph leads to the following output on my Windows system:
Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
No response
Which operating system are you running Bazel on?
Windows 11
What is the output of
bazel info release
?release 7.2.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response