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

Fail to build on windows using MSVC 14.42 due to ThorVG #95861

Closed
HKunogi opened this issue Aug 20, 2024 · 8 comments · Fixed by #96167
Closed

Fail to build on windows using MSVC 14.42 due to ThorVG #95861

HKunogi opened this issue Aug 20, 2024 · 8 comments · Fixed by #96167

Comments

@HKunogi
Copy link
Contributor

HKunogi commented Aug 20, 2024

Tested versions

  • Reproducible with commit 826de79 on windows

System information

Windows 11 - MSVC 14.42

Issue description

  • When trying to build on windows with C# support it throws the following errors due to thorvg, it builds fine on linux
D:\IDE\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.42.34226\include\mutex(37): error C3861: '_Mtx_init_in_situ': identifier not found
D:\IDE\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.42.34226\include\mutex(536): error C3861: '_Cnd_init_in_situ': identifier not found
D:\IDE\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.42.34226\include\condition_variable(56): error C3861: '_Cnd_init_in_situ': identifier not found
scons: *** [thirdparty\thorvg\src\loaders\svg\tvgSvgLoader.windows.editor.x86_64.obj] Error 2
scons: building terminated because of errors.

Steps to reproduce

  • Simply build the engine source with C# support using latest MSVC 14.42 with latest Windows 11 SDK on Windows.

Minimal reproduction project (MRP)

This is an engine build problem, thus it does not have an actual project.

@fire
Copy link
Member

fire commented Aug 20, 2024

@hermet linking you for tracking

@shadowfox87
Copy link

Hello, any update on this? We are unable to build on Windows. We already compiled v4.4 but this still hasn't been implemented.

@akien-mga
Copy link
Member

akien-mga commented Aug 25, 2024

You are using the Preview version of VS 2022, which may not be supported yet. It seems like they broke compatibility in some Windows SDK MSVC STL headers, which might require adjustments in downstream code, or may be a bug on MS' side which will be fixed eventually.

If you need a solution now, I suggest staying to the stable release of VS 2022.

@akien-mga
Copy link
Member

akien-mga commented Aug 25, 2024

I would also try to suggest cleaning all build artifacts (run your usual scons command with --clean added to it, or clean with git clean -fxd, but note this removes all untracked files).

From reading the PR that made this change in the MSVC STL, it seems like your error may come from a mismatched between code compiled with an older version, and the new version of that header.

@akien-mga
Copy link
Member

See https://github.com/microsoft/STL/wiki/Changelog#vs-2022-1710

image

Godot by default doesn't mix binaries from different compiler versions, when you compile Godot from source it should compile everything. One exception to that would be D3D12 dependencies compiled by Microsoft themselves, and ANGLE static compiled by us. Are you including either of those? Please give your full build command in the OP.

CC @bruvzg - if it's ANGLE static, we might need to provide different builds for different versions of MSVC :(

@bruvzg
Copy link
Member

bruvzg commented Aug 25, 2024

Current MSVC tools version is 14.41.34120, and it's building without issues. But the error might be related to the installation location, I think there were reports about SCons not detecting MSVC in non-standard locations (not on drive C:).

See https://github.com/microsoft/STL/wiki/Changelog#vs-2022-1710

This change is in current stable MSVC (17.11.1), so unlikely related.

Edit: seems like current SCons still using hardcoded paths to look for MSVC - https://github.com/SCons/scons/blob/master/SCons/Tool/MSCommon/vc.py#L927-L940

@hermet
Copy link

hermet commented Aug 27, 2024

Hello, just for your information, thorvg previsouly applied that option in v0.14.0 (thorvg/thorvg#2385)
and reverted in v0.14.5 (thorvg/thorvg#2611)

@akien-mga
Copy link
Member

Oh thanks for the headsup. I really thought thorvg was a red herring here, and just happened the first one to hit a STL mutex include. I hadn't seen that _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR was indeed defined in thorvg. I'll update to fix it.

vbettaque pushed a commit to vbettaque/godot that referenced this issue Aug 28, 2024
tucono pushed a commit to tucono/godot that referenced this issue Aug 31, 2024
addmix pushed a commit to addmix/godot that referenced this issue Sep 6, 2024
maidopi-usagi pushed a commit to maidopi-usagi/godot that referenced this issue Sep 11, 2024
akien-mga added a commit to akien-mga/godot that referenced this issue Sep 16, 2024
Fixes godotengine#95861.

(cherry picked from commit f16d4af)
akien-mga added a commit to akien-mga/godot that referenced this issue Sep 17, 2024
Fixes godotengine#95861.

(cherry picked from commit f16d4af)
RadiantUwU pushed a commit to RadiantUwU/godot that referenced this issue Sep 30, 2024
Fixes godotengine#95861.

(cherry picked from commit f16d4af)
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