Skip to content

Conversation

@Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Apr 1, 2025

A reimagining of the above PR. Instead of adding a dedicated method for external includes, this instead opts to add an entirely new SCons variable to append pathing to. This keeps the existing logic almost completely unchanged, with only generic renames being needed most of the time. Much like the previous PR, this removes the need for the warning wrappers around external includes, so those have been removed as necessary.

@Repiteo
Copy link
Contributor Author

Repiteo commented Apr 1, 2025

Hmm, so the different platforms handle thirdparty includes differently. That's... Annoying

@akien-mga
Copy link
Member

akien-mga commented Apr 1, 2025

That looks pretty promising! I like the idea. I had missed the previous attempt.

Hmm, so the different platforms handle thirdparty includes differently.

What do you mean exactly?

@akien-mga
Copy link
Member

The CI build with SCons 4.0.0 has a type error:
https://github.com/godotengine/godot/actions/runs/14204122051/job/39797772814?pr=104893

@Repiteo
Copy link
Contributor Author

Repiteo commented Apr 1, 2025

The CI build with SCons 4.0.0 has a type error:

Oh! That must've been what was throwing me off earlier. Hopefully it's not a platform-specific issue after all

@Repiteo Repiteo force-pushed the scons/external-includes-alt branch 2 times, most recently from 3e3ec71 to fb6e95c Compare April 1, 2025 21:02

#ifdef MODULE_MSDFGEN_ENABLED
#ifdef _MSC_VER
#pragma warning(disable : 4458)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might cause warnings to be raised by the GDExtension build option for text servers, CC @bruvzg.

We might want to add the same system to godot-cpp.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make a followup PR there once this is merged

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It likely will, but godot-cpp does not use Werror in any config, so it won't break it. But it definitely worth adding the support for the same system to godot-cpp regardless.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@akien-mga akien-mga modified the milestones: 4.x, 4.5 Apr 2, 2025
@akien-mga akien-mga removed the request for review from a team April 2, 2025 09:06
@Repiteo Repiteo force-pushed the scons/external-includes-alt branch from fb6e95c to f25fc34 Compare April 2, 2025 12:30
@Repiteo Repiteo merged commit 1f56d96 into godotengine:master Apr 2, 2025
20 checks passed
@Repiteo Repiteo deleted the scons/external-includes-alt branch April 2, 2025 12:48
akien-mga added a commit to akien-mga/godot that referenced this pull request May 14, 2025
This was lost in godotengine#104893 when removing the warning ignores no longer relevant
when including the D3D12MemAlloc _header_ as external.
But we still compile the .cpp directly and it has this warning.

Clarified why have a wrapper for this file.
akien-mga added a commit to akien-mga/godot that referenced this pull request May 14, 2025
This was lost in godotengine#104893 when removing the warning ignores no longer relevant
when including the D3D12MemAlloc _header_ as external.
But we still compile the .cpp directly and it has this warning.

Clarified why have a wrapper for this file.
DuartePonce pushed a commit to DuartePonce/godot that referenced this pull request Jun 6, 2025
This was lost in godotengine#104893 when removing the warning ignores no longer relevant
when including the D3D12MemAlloc _header_ as external.
But we still compile the .cpp directly and it has this warning.

Clarified why have a wrapper for this file.
goatchurchprime pushed a commit to goatchurchprime/godot that referenced this pull request Jun 10, 2025
This was lost in godotengine#104893 when removing the warning ignores no longer relevant
when including the D3D12MemAlloc _header_ as external.
But we still compile the .cpp directly and it has this warning.

Clarified why have a wrapper for this file.
dsmtE pushed a commit to dsmtE/godot that referenced this pull request Jun 17, 2025
This was lost in godotengine#104893 when removing the warning ignores no longer relevant
when including the D3D12MemAlloc _header_ as external.
But we still compile the .cpp directly and it has this warning.

Clarified why have a wrapper for this file.
spanzeri pushed a commit to spanzeri/godot that referenced this pull request Jun 25, 2025
This was lost in godotengine#104893 when removing the warning ignores no longer relevant
when including the D3D12MemAlloc _header_ as external.
But we still compile the .cpp directly and it has this warning.

Clarified why have a wrapper for this file.
dawdle-deer pushed a commit to dawdle-deer/godot that referenced this pull request Jul 3, 2025
This was lost in godotengine#104893 when removing the warning ignores no longer relevant
when including the D3D12MemAlloc _header_ as external.
But we still compile the .cpp directly and it has this warning.

Clarified why have a wrapper for this file.
Haydoggo pushed a commit to Haydoggo/godot that referenced this pull request Jul 7, 2025
This was lost in godotengine#104893 when removing the warning ignores no longer relevant
when including the D3D12MemAlloc _header_ as external.
But we still compile the .cpp directly and it has this warning.

Clarified why have a wrapper for this file.
@corngood
Copy link

This is causing problems on nixpkgs, where we build for linux with sowrap disabled and with builtin freetype.

scons alsa=true ccflags=-fno-strict-aliasing dbus=true debug_symbols=true fontconfig=true linkflags=-Wl,--build-id module_mono_enabled=false platform=linuxbsd precision=single production=true pulseaudio=true speechd=true target=editor touch=true udev=true use_sowrap=false wayland=true x11=true lto=none verbose=true

One of the pkgconfig dependencies (fontconfig) adds a -I for freetype. Previously, env_freetype.Prepend(CPPPATH=[thirdparty_dir + "/include"]) would ensure the local path was checked first.

This results in a link error:

godot-mono> /nix/store/c43ry7z24x3jhnjlj4gpay8a4g2p3x1h-binutils-2.44/bin/ld: /nix/store/95gvjj2dq0fn7x95zppnkpbril4djmnn-freetype-2.13.3/lib/libfreetype.so: undefined reference to symbol 'BZ2_bzDecompress'
godot-mono> /nix/store/c43ry7z24x3jhnjlj4gpay8a4g2p3x1h-binutils-2.44/bin/ld: /nix/store/x1nn5jrx1im7wmmn1xmpjvyf072s5k75-bzip2-1.0.8/lib/libbz2.so.1: error adding symbols: DSO missing from command line
godot-mono> collect2: error: ld returned 1 exit status
godot-mono> scons: *** [bin/godot.linuxbsd.editor.x86_64.mono] Error 1
godot-mono> scons: building terminated because of errors.

There are various ways this could be fixed, but I'm not sure what approach to take. #109749 seems similar, and resulted in reverting the CPPEXTPATH change.

@Repiteo
Copy link
Contributor Author

Repiteo commented Sep 18, 2025

Shoot, it seems like this setup really struggles to account for dependencies defining includes in different styles. It might warrant revisiting this system altogether, which is annoying but I don't want this to be a recurring issue

@corngood
Copy link

Shoot, it seems like this setup really struggles to account for dependencies defining includes in different styles. It might warrant revisiting this system altogether, which is annoying but I don't want this to be a recurring issue

I'm not sure the old way was any more 'right' in general. In my build environment, I have:

$ pkg-config --cflags fontconfig
-I/nix/store/vkb9z2p7mzn0b2282vfxfg6i79rwzicl-fontconfig-2.16.2-dev/include -I/nix/store/l0giy21i8c3acqsp2y678h5x4m95v7l0-freetype-2.13.3-dev/include/freetype2
$ pkg-config --libs fontconfig
-L/nix/store/kld68jc4zmliifsvhq8gwrn85zxr8vr4-fontconfig-2.16.2-lib/lib -L/nix/store/95gvjj2dq0fn7x95zppnkpbril4djmnn-freetype-2.13.3/lib -lfontconfig -lfreetype

What if the vendored freetype causes problems with fontconfig?

I think what I'd like to do in nixpkgs is just turn off as much of the builtin_ stuff as possible.

@akien-mga
Copy link
Member

@akien-mga akien-mga changed the title SCons: Add CPPEXTPATH for external includes SCons: Add CPPEXTPATH for external includes (reverted) Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants