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

Can't build godot with Visual Studio 2022 due to encoding issue #93305

Closed
ChristopheClaustre opened this issue Jun 18, 2024 · 4 comments · Fixed by #93342
Closed

Can't build godot with Visual Studio 2022 due to encoding issue #93305

ChristopheClaustre opened this issue Jun 18, 2024 · 4 comments · Fixed by #93342

Comments

@ChristopheClaustre
Copy link
Contributor

ChristopheClaustre commented Jun 18, 2024

Tested versions

Reproducible in 4.3.dev [71699e0]

System information

Windows 10 - Visual Studio Community 2022 (64 bits) 17.10.1 - Python 3.11.8 - SCons 4.7.0

Issue description

When building godot I get this error:

1>------ Début de la génération : Projet : godot, Configuration : editor x64 ------
1>Starting SCons
1>**********************************************************************
1>** Visual Studio 2022 Developer Command Prompt v17.10.1
1>** Copyright (c) 2022 Microsoft Corporation
1>**********************************************************************
1>[vcvarsall.bat] Environment initialized for: 'x86_x64'
1>scons: Reading SConscript files ...
1>Auto-detected 4 CPU cores available for build parallelism. Using 4 cores by default. You can override it with the -j argument.
1>Using VCVARS-determined MSVC, arch x86_64
1>Building for platform "windows", architecture "x86_64", target "editor".
1>Checking for C header file mntent.h... (cached) no
1>scons: done reading SConscript files.
1>scons: Building targets ...
[...]
1>progress_finish(["progress_finish"], [])
1>scons: *** [bin\godot.windows.editor.x86_64.exe] UnicodeEncodeError : 'charmap' codec can't encode character '\u251c' in position 5: character maps to <undefined>
1>Traceback (most recent call last):
1>  File "C:\Python311\Lib\site-packages\SCons\Taskmaster\__init__.py", line 246, in execute
1>    self.targets[0].build()
1>  File "C:\Python311\Lib\site-packages\SCons\Node\__init__.py", line 757, in build
1>    self.get_executor()(self, **kw)
1>  File "C:\Python311\Lib\site-packages\SCons\Executor.py", line 386, in __call__
1>    return _do_execute_map[self._do_execute](self, target, kw)
1>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1>  File "C:\Python311\Lib\site-packages\SCons\Executor.py", line 119, in execute_action_list
1>    status = act(*args, **kw)
1>             ^^^^^^^^^^^^^^^^
1>  File "C:\Python311\Lib\site-packages\SCons\Action.py", line 1349, in __call__
1>    return c.__call__(self, target, source, env, *args, **kw)
1>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1>  File "C:\Python311\Lib\site-packages\SCons\Action.py", line 1280, in __call__
1>    return act(
1>           ^^^^
1>  File "C:\Python311\Lib\site-packages\SCons\Action.py", line 1521, in __call__
1>    stat = act(target, source, env, exitstatfunc, presub,
1>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1>  File "C:\Python311\Lib\site-packages\SCons\Action.py", line 724, in __call__
1>    stat = self.execute(target, source, env, executor=executor)
1>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1>  File "C:\Python311\Lib\site-packages\SCons\Action.py", line 1102, in execute
1>    result = spawn(shell, escape, cmd_line[0], cmd_line, ENV)
1>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1>  File "C:\Repos_SSD\_godot_\./platform/windows\detect.py", line 440, in spawn_capture
1>    log.write(line + "\n")
1>  File "C:\Python311\Lib\encodings\cp1252.py", line 19, in encode
1>    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
1>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1>UnicodeEncodeError: 'charmap' codec can't encode character '\u251c' in position 5: character maps to <undefined>
1>scons: building terminated because of errors.
1>[Time elapsed: 00:02:48.65]
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(45,5): error MSB3073: La commande "echo Starting SCons && cmd /V /C set "plat=x64" ^& (if "x64"=="x64" (set "plat=x86_amd64")) ^& call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" !plat! ^& scons --directory="C:\Repos_SSD\_godot_" progress=no platform=windows target=editor arch=x86_64 p=windows debug_symbols=yes" s'est arrêtée avec le code 2.
1>Génération du projet "godot.vcxproj" terminée -- ÉCHEC.
========== Build : 0 réussite(s), 1 échec(s), 0 à jour, 0 ignorée(s) ==========
========== Build s’est terminée à 13:53 et a duré 02:56,579 minutes ==========

I can solve the error by replacing "oem" by "utf-8" in platform/windows/detect.py, but I am not totally sure that it will work on each platform.
Maybe related to #89858.

I am not sure it is related to VS 2022, but in case here is my config : .vsconfig.txt

Steps to reproduce

  • Go to sources of godot
  • Call scons p=windows vsproj=yes debug_symbols=yes in godot sources root folder
  • Open the solution created by previous step with visual studio 2022
  • Launch a build
  • BUG: When it is finished, one may get an error about encoding

Minimal reproduction project (MRP)

N/A

@kus04e4ek
Copy link
Contributor

What's your SCons version? Encoding probably changed between different versions

@ChristopheClaustre
Copy link
Contributor Author

SCons 4.7.0.
I updated the OP too.

@Calinou Calinou changed the title [BuildSystem] Can't build godot with Visual Studio 2022 due to encoding issue. Can't build godot with Visual Studio 2022 due to encoding issue Jun 19, 2024
@matheusmdx
Copy link
Contributor

Im using python 3.12, scons 4.7.0 and MSVC 17.9.6 and no problems to compile

@JekSun97
Copy link

I confirm the error.
SCons 4.5.2, Python 3.10.6, Visual Studio 2022.
Updating SCons to the latest version 4.7.0 did not solve the problem

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

Successfully merging a pull request may close this issue.

6 participants