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

[BUG] C compiler error output in another language is gibberish #4580

Open
0dminnimda opened this issue Jan 18, 2022 · 2 comments
Open

[BUG] C compiler error output in another language is gibberish #4580

0dminnimda opened this issue Jan 18, 2022 · 2 comments

Comments

@0dminnimda
Copy link
Contributor

0dminnimda commented Jan 18, 2022

Prerequisites
I spotted this problem some while ago but didn't report it, probably because I didn't want to investigate it. And now, when I thought about it I think that it's some problem in cython.

Describe the bug
So the deal is my vc build tools by default had only Russian localization installed therefore error messages were in it, but an output looks like this

error C3861: getDriverMode: �����䨪��� �� ������
error C2664: "int main(int,const char **)": ���������� �८�ࠧ����� ��㬥�� 2 �� "_Ty *"
note: � १���� �८�ࠧ������ ������� �����䨪����

when I just run the path of cl (it shows help) which cython outputs then I see no such gibberish.
Probably the problem is with the encoding of stderr that cython collects of the process, but I'm not sure.
Therefore I can't supply any other way to reproduce this than to install Russian language packages for vs build tools and set it as default (idk how, probably it's easier to just momentarily remove any other language packages )


I create this issue more as a reminder to myself because it's such a rare problem that hardly anyone would care, so if it'll be solved, then it's likely to be me ... for anyone without easy access to windows and vs build tools installed it's gonna be harder or maybe impossible to reproduce this, therefore, no simple way to know if fix worked.

Lasy fix
I removed the Russian localization package and now there's only English, finally something that I can understand as opposed to some gibberish :]

error C3861: 'getDriverMode': identifier not found
error C2664: 'int main(int,const char **)': cannot convert argument 2 from '_Ty *' to 'const char **'
note: Conversion loses qualifiers

Environment (please complete the following information):

  • OS: Windows
  • Python version 3.9.0
  • Cython version 3.0.0a8
@da-woods
Copy link
Contributor

How are you calling the C compiler? Because it's probably setuptools that's calling it and forwarding the message.

Obviously if it's coming from a Cython tool like cythonize or the ipython-magic then that may be a Cython issue.

@0dminnimda
Copy link
Contributor Author

How are you calling the C compiler?

Cython shows that

running build_ext
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
building 'test_ext' extension
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /Wnclude -IC:/C++/projects/<...> -IC:/C++/projects/<...> -IC:\Program Files\Pmunity\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrtcpp /Fobuild\temp.win-amd64-3.9\Release\cython_build/<...>/run.obj /Od /w

so I just ran "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe"
and got something like this

Оптимизирующий компилятор Microsoft (R) C/C++ версии 19.29.30137 для x64
(C) Корпорация Майкрософт (Microsoft Corporation).  Все права защищены.        

использование: cl [ параметр... ] имя_файла... [ /link параметр_компоновки... ]

just info about compiler and usage, nothing too interesting...

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

No branches or pull requests

2 participants