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 v.4.8.0 - 'BoolVariable' is not defined #1518

Open
lgxm3z opened this issue Jul 12, 2024 · 3 comments
Open

SCons v.4.8.0 - 'BoolVariable' is not defined #1518

lgxm3z opened this issue Jul 12, 2024 · 3 comments

Comments

@lgxm3z
Copy link

lgxm3z commented Jul 12, 2024

Godot version

4.2.2.stable

godot-cpp version

4.2.2.stable

System information

Windows 11, Windows 10, macOS

Issue description

$ scons --version

SCons by Steven Knight et al.:
        SCons: v4.8.0.7c688f694c644b61342670ce92977bf4a396c0d4, Sun, 07 Jul 2024 16:52:07 -0700, by bdbaddog on M1Dog2021

$ scons

scons: Reading SConscript files ...
NameError: name 'BoolVariable' is not defined:
  File "C:\Documents\project\Project\SConstruct", line 52:
    env = SConscript("include/godot-cpp/SConstruct", {"env": env, "customs": customs})
  File "C:\Users\PC\AppData\Local\Programs\Python\Python312\Lib\site-packages\SCons\Script\SConscript.py", line 684:
    return method(*args, **kw)
  File "C:\Users\PC\AppData\Local\Programs\Python\Python312\Lib\site-packages\SCons\Script\SConscript.py", line 620:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\PC\AppData\Local\Programs\Python\Python312\Lib\site-packages\SCons\Script\SConscript.py", line 280:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Documents\project\Project\include\godot-cpp\SConstruct", line 36:
    cpp_tool.options(opts, env)
  File "C:\Documents\project\Project\include\godot-cpp\tools\godotcpp.py", line 325:
    tool.options(opts)
  File "C:\Documents\project\Project\include\godot-cpp\tools\ios.py", line 24:
    opts.Add(BoolVariable("ios_simulator", "Target iOS Simulator", False))

Working with SCons v4.7.0 ✅️

pip uninstall scons && pip install scons==4.7.0
@Faless
Copy link
Contributor

Faless commented Jul 16, 2024

This is fixed by #1504 which (among many other things), did this change:

diff --git a/tools/ios.py b/tools/ios.py
index 75718684..d5767093 100644
--- a/tools/ios.py
+++ b/tools/ios.py
@@ -2,7 +2,7 @@ import os
 import sys
 import subprocess
 import common_compiler_flags
-from SCons.Variables import *
+from SCons.Variables import BoolVariable
 
 if sys.version_info < (3,):
 
diff --git a/tools/linux.py b/tools/linux.py
index 1783e060..95a5b92c 100644
--- a/tools/linux.py
+++ b/tools/linux.py
@@ -1,5 +1,5 @@
 import common_compiler_flags
-from SCons.Variables import *
+from SCons.Variables import BoolVariable
 from SCons.Tool import clang, clangxx
 
 
diff --git a/tools/windows.py b/tools/windows.py
index a263241a..d072b221 100644
--- a/tools/windows.py
+++ b/tools/windows.py
@@ -2,7 +2,7 @@ import sys
 import my_spawn
 import common_compiler_flags
 from SCons.Tool import msvc, mingw
-from SCons.Variables import *
+from SCons.Variables import BoolVariable
 
 
 def options(opts):

We might want to backport at least this change to 4.2 / 4.1 (CC @dsnopek )

Note: It's really weird that scons 4.8 broke all from SCons.Variables import * :/

@dsnopek
Copy link
Collaborator

dsnopek commented Jul 16, 2024

We might want to backport at least this change to 4.2 / 4.1

It's tagged for cherry-picking! It'll get pulled in when I do the next round

@Priton-CE
Copy link

Priton-CE commented Jul 16, 2024

It appears like SCons/scons@9b4f2eb added a __all__ list to the SCons.Variables __init__ file which is causing the issue.

From what I am gathering from the commit message this might be an intentional change.

ashtonmeuser added a commit to ashtonmeuser/godot-wasm that referenced this issue Jul 17, 2024
ashtonmeuser added a commit to ashtonmeuser/godot-wasm that referenced this issue Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants