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

bazel mod graph whitespaces broken on Windows #22858

Open
Vertexwahn opened this issue Jun 22, 2024 · 8 comments
Open

bazel mod graph whitespaces broken on Windows #22858

Vertexwahn opened this issue Jun 22, 2024 · 8 comments
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests area-Windows Windows-specific issues and feature requests more data needed team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug untriaged

Comments

@Vertexwahn
Copy link
Contributor

Description of the bug:

bazel mod graph leads to the following output on my Windows system:

e) PS G:\dev\project1> bazel mod graph
Starting local Bazel server and connecting to it...
<root> ([email protected])
Ôö£ÔöÇÔöÇÔöÇabseil-cpp@_ 
Ôöé   Ôö£ÔöÇÔöÇÔöÇbazel_skylib@_ (*) 
Ôöé   Ôö£ÔöÇÔöÇÔöÇ[email protected] (*) 
Ôöé   ÔööÔöÇÔöÇÔöÇ[email protected] (*) 
Ôö£ÔöÇÔöÇÔöÇ[email protected] 
Ôöé   Ôö£ÔöÇÔöÇÔöÇbazel_skylib@_ (*) 
Ôöé   ÔööÔöÇÔöÇÔöÇ[email protected] (*) 
Ôö£ÔöÇÔöÇÔöÇautodiff@_ 
Ôöé   ÔööÔöÇÔöÇÔöÇ[email protected] (*) 
Ôö£ÔöÇÔöÇÔöÇbazel_skylib@_ 
Ôöé   Ôö£ÔöÇÔöÇÔöÇ[email protected] (*) 
Ôöé   ÔööÔöÇÔöÇÔöÇ[email protected] (*) 
Ôö£ÔöÇÔöÇÔöÇ[email protected] 
Ôöé   Ôö£ÔöÇÔöÇÔöÇ[email protected] (*) 
Ôöé   Ôö£ÔöÇÔöÇÔöÇ[email protected] 
Ôöé   Ôöé   Ôö£ÔöÇÔöÇÔöÇ[email protected] (*) 

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 returns development 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

@peakschris
Copy link

I've also been seeing this, windows 10, regardless of shell (cmd, bash, powershell)

@sgowroji sgowroji added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. area-Bzlmod Bzlmod-specific PRs, issues, and feature requests labels Jun 24, 2024
@sgowroji sgowroji added area-Windows Windows-specific issues and feature requests more data needed labels Jun 24, 2024
@sgowroji
Copy link
Member

Hi @Vertexwahn, Could you please provide complete steps to reproduce this issue?

@peakschris
Copy link

peakschris commented Jun 24, 2024

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@_)
Γö£ΓöÇΓöÇΓöÇ[email protected]
Γöé   Γö£ΓöÇΓöÇΓöÇ[email protected] (*)
Γöé   Γö£ΓöÇΓöÇΓöÇ[email protected] (*)
Γöé   ΓööΓöÇΓöÇΓöÇ[email protected] (*)
<snip>

@fmeum
Copy link
Collaborator

fmeum commented Jun 24, 2024

What happens if you pass --charset=ascii? Does your terminal support UTF-8?

@peakschris
Copy link

--charset=ascii shows the tables, albeit less nicely:
image

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:
image

@fmeum
Copy link
Collaborator

fmeum commented Jun 24, 2024

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

@peakschris
Copy link

I added this one line to file_windows.cc:

image

bazel mod graph now outputs:
image

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

@fmeum
Copy link
Collaborator

fmeum commented Jun 24, 2024

@bazel-io fork 7.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests area-Windows Windows-specific issues and feature requests more data needed team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug untriaged
Projects
None yet
Development

No branches or pull requests

6 participants