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

Build failure in templated function convert_array_std140 with GCC 7.5 #79352

Closed
cunyx opened this issue Jul 11, 2023 · 2 comments · Fixed by #91833
Closed

Build failure in templated function convert_array_std140 with GCC 7.5 #79352

cunyx opened this issue Jul 11, 2023 · 2 comments · Fixed by #91833

Comments

@cunyx
Copy link

cunyx commented Jul 11, 2023

Godot version

4.1 stable

System information

openSUSE Leap 15.4 and 15.5

Issue description

Building godot 4.1 for openSUSE in
https://build.opensuse.org/package/show/home:cunix:godot/godot
fails for Leap with

g++ -o drivers/gles3/storage/material_storage.linuxbsd.editor.x86_64.o -c -std=gnu++17 -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -pipe -pthread -O2 -Wall -Wshadow -Wno-misleading-indentation -Wno-strict-overflow -Wno-type-limits -isystem thirdparty/glad -DTOOLS_ENABLED -DDEBUG_ENABLED -DNDEBUG -DNO_EDITOR_SPLASH -DTOUCH_ENABLED -DFONTCONFIG_ENABLED -DALSA_ENABLED -DALSAMIDI_ENABLED -D_REENTRANT -DPULSEAUDIO_ENABLED -DDBUS_ENABLED -DSPEECHD_ENABLED -DXKB_ENABLED -DJOYDEV_ENABLED -DUDEV_ENABLED -DLINUXBSD_ENABLED -DUNIX_ENABLED -D_FILE_OFFSET_BITS=64 -DX11_ENABLED -DVULKAN_ENABLED -DGLES3_ENABLED -DMINIZIP_ENABLED -DBROTLI_ENABLED -DZSTD_STATIC_LINKING_ONLY -DUSE_VOLK -DVK_USE_PLATFORM_XLIB_KHR -DGLAD_ENABLED -DGLES_OVER_GL -DGLAD_GLX_NO_X11 -DHAVE_MNTENT -Ithirdparty/freetype/include -Ithirdparty/libpng -Ithirdparty/volk -Ithirdparty/vulkan -Ithirdparty/vulkan/include -Ithirdparty/zstd -Ithirdparty/zlib -Ithirdparty/brotli/include -Iplatform/linuxbsd -I/usr/include/miniupnpc -I. -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/speech-dispatcher -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libxkbcommon drivers/gles3/storage/material_storage.cpp

[...]

 In file included from drivers/gles3/storage/material_storage.cpp:42:0:
 ./servers/rendering/storage/variant_converters.h: In function 'Vector<P> convert_array_std140(const Variant&, bool)':
 ./servers/rendering/storage/variant_converters.h:281:45: error: 'const class Variant' has no member named 'operator T'; did you mean 'operator Vector<Color>'?
      convert_item_std140<T, P>(item.operator T(), offset, true);
                                              ^
                                              operator 104
[...]

 scons: *** [drivers/gles3/storage/material_storage.linuxbsd.editor.x86_64.o] Error 1
 scons: building terminated because of errors.

build log is currently here:
https://build.opensuse.org/public/build/home:cunix:godot/15.4/x86_64/godot/_log

Building previous stable godot version 4.0.3 succeeds:
https://build.opensuse.org/public/build/games/15.4/x86_64/godot/_log

Build of 4.1 for Tumbleweed works:
https://build.opensuse.org/public/build/home:cunix:godot/openSUSE_Tumbleweed/x86_64/godot/_log

I'm not sure what is happening,
This might be introduced by
#74937
and only visible with older build tools.

For example Tumbleweed uses gcc-c++ 13, while Leap has version 7.5.

Perhaps this is too old nowadays and unsupported?

Steps to reproduce

branch
https://build.opensuse.org/package/show/games/godot
on obs, update and build godot 4.1

Minimal reproduction project

pre project selection

@akien-mga akien-mga changed the title build failure in function convert_array_std140 Build failure in templated function convert_array_std140 with GCC 7.5 Jul 11, 2023
@akien-mga akien-mga added this to the 4.2 milestone Jul 11, 2023
@bitsawer
Copy link
Member

Looks like a compiler bug, GCC 7.5 has been out of support for years now. The code was indeed added in #74937. If we want to, I could maybe add a small workaround for this, should be pretty easy to do (probably just removing the explicit conversion call). Of course, I can't really test this and the compiler might just find something else to fail on next, these template errors have a bad habit of cascading into whack-a-moles.

@cunyx
Copy link
Author

cunyx commented Jul 14, 2023

Thank you very much for the comment!

I tried to select other available compilers:
While the default gcc 7.5 fails as described,
version 8.2.1 was rejected by godot as unsupported,
9.3.1, 10.4.0, 11.3.0 and 12.3.0 can build without failure.

Conclusion:
Using gcc > 8 does not show this error during build.
Instead of fixing the issue, a work around is possible, where a newer gcc version is available.

If others experience a similar issue with gcc 7 and this is somehow inevitable, godot might perhaps consider to raise system requirements regarding gcc?

Thanks!

@YuriSizov YuriSizov modified the milestones: 4.2, 4.x Nov 15, 2023
@akien-mga akien-mga modified the milestones: 4.x, 4.3 May 11, 2024
akien-mga added a commit to akien-mga/godot that referenced this issue May 11, 2024
- GCC 7 supports C++17 but seems to have breaking regressions, see godotengine#79352.
- GCC 8 broke C++17 guaranteed copy elision support, fixed in 8.4, but...
- GCC 9 is old enough (2022) to use as a baseline and stop dealing with
  unmaintained and less efficient compiler versions.
dimitry- pushed a commit to AndroidWasm/godot that referenced this issue May 16, 2024
- GCC 7 supports C++17 but seems to have breaking regressions, see godotengine#79352.
- GCC 8 broke C++17 guaranteed copy elision support, fixed in 8.4, but...
- GCC 9 is old enough (2022) to use as a baseline and stop dealing with
  unmaintained and less efficient compiler versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants