Open zx2c4 opened 3 years ago
I am happy to get rid of powershell dependency, if possible.
From what I remember we mainly use powershell to be able to read non-ASCII output of Windows commands on non-English versions of Windows.
Including @mattn because he uses non-English Windows.
Alex
One another way to avoid the issue is call chcp 65001
before any commands. it output english. Or call API GetConsoleCP and SetConsoleOutputCP.
cp := windows.GetConsoleCP()
defer windows.SetConsoleOutputCP(cp)
windows.SetConsoleOutputCP(windows.CP_UTF8)
// do something
(But currently internal/syscall/windows does not have the APIs)
Change https://golang.org/cl/273673 mentions this issue: net: set and restore console codepage in runCmd
windows.SetConsoleOutputCP(windows.CP_UTF8)
I wonder if Go should call that in the runtime init anyway...
No.
Good to know. Thanks for the info.
Windows 10 for ARM64 will run ARM32 executables just fine, which is why we're using it for Go builders.
There's currently a bug in which invoking powershell from an arm32 process will fail:
I've worked around that by grabbing a zip of powershell 7.1, adding the unzipped directory to the builder's PATH, and then copying pwsh.exe to powershell.exe. I'm waiting for some builds to finish, but I think that should work alright.
The reason this matters for Go is that some of the tests use powershell just to invoke a simple command:
I'm pretty sure we can come up with something better than
powershell -Command
for the tests, which would make this problem go away. Or sooner or later Microsoft will probably fix it. Or my workaround will suffice.Either way, I thought I should at least document this.
CC @alexbrainman @jstarks @cagedmantis