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

SCons: Warn when passing unknown variables #91213

Closed

Conversation

Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Apr 26, 2024

Lifted largely from godot-cpp's implementation1, 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.

Footnotes

  1. https://github.com/godotengine/godot-cpp/blob/e23b117ac32fdbeb0920f234e193e6d31307c0ad/SConstruct#L41-L46

@Repiteo
Copy link
Contributor Author

Repiteo commented Apr 26, 2024

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!

@dustdfg
Copy link
Contributor

dustdfg commented Nov 11, 2024

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

@dustdfg
Copy link
Contributor

dustdfg commented Nov 11, 2024

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 😅 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 😅)

@dustdfg
Copy link
Contributor

dustdfg commented Nov 12, 2024

Don't mind 😅. 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...

@Repiteo
Copy link
Contributor Author

Repiteo commented Nov 25, 2024

Superseded by #99690

@Repiteo Repiteo closed this Nov 25, 2024
@Repiteo Repiteo deleted the scons/warn-unknown-variables branch November 25, 2024 19:15
@Repiteo Repiteo removed this from the 4.4 milestone Nov 25, 2024
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.

3 participants