godot icon indicating copy to clipboard operation
godot copied to clipboard

SCons: Warn when passing unknown variables

Open Repiteo opened this issue 1 year ago • 1 comments

Lifted largely from godot-cpp's implementation^1, albeit with formatting tweaked to be more in-line with recent SConstruct adjustments.

Example output:

Executing task: scons dev_build=yes compiledb=yes optimize=debug verbose=no tests=yes warnings=extra d3d12=yes module_text_server_fb_enabled=yes cpp_standard=23 ninja=no 

scons: Reading SConscript files ...
Automatically detected platform: windows
WARNING: Unknown SCons variables were passed and will be ignored:
        cpp_standard = 23
Auto-detected 32 CPU cores available for build parallelism. Using 31 cores by default. You can override it with the -j argument.

Repiteo avatar Apr 26 '24 14:04 Repiteo

Double-checked to make sure the regressions from #56551 are no longer applicable. The mono-stuff is no longer relevant as that logic appears to have been removed entirely, or otherwise relocated to not use the argument system. The only regression I could replicate was the profile option, and that came down to it simply… Not being an option. By adding that as a proper variable, everything works as expected!

Repiteo avatar Apr 26 '24 18:04 Repiteo

Just curious with which SCons version did you check it? If you still can run it without any issues...

dustdfg avatar Nov 11 '24 09:11 dustdfg

Just curious with which SCons version did you check it? If you still can run it without any issues...

Reson why I had asked is that I tried to run your PR and it worked. With exception to the fact it also printed SCons internals :sweat_smile: something like this but with much more crap from SCons...

hh = hate_scons_twice
custom_hh = hate_scons_twice
osxcross_sdk = hate_scons
BUILDERS = {'StaticObject': <SCons.Builder.CompositeBuilder object at 0x7f786a283c50>, 'Object': <SCons.Builder.CompositeBuilder object at 0x7f786a283c50>, 'SharedObject': <SCons.Builder.CompositeBuilder object at 0x7f786a283f50>, 'StaticLibrary': <SCons.Builder.BuilderBase object at 0x7f786a283560>, 'Library': <SCons.Builder.BuilderBase object at 0x7f786a283560>, 'SharedLibrary': <SCons.Builder.BuilderBase object at 0x7f786a2835f0>, 'Program': <SCons.Builder.BuilderBase object at 0x7f786a282e40>, 'LoadableModule': <SCons.Builder.BuilderBase 

I've tried both 4.8.1 and 3.1.2 (out current minimal :sweat_smile:)

dustdfg avatar Nov 11 '24 20:11 dustdfg

Don't mind :sweat_smile:. Turned out that we polluted unknown variables by ourselves when do opts.Update(env, {**ARGUMENTS, **env.Dictionary()}) because Dictionary method returns all the variables including internals...

dustdfg avatar Nov 12 '24 08:11 dustdfg

Superseded by #99690

Repiteo avatar Nov 25 '24 19:11 Repiteo