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.py FileNotFoundError [WinError 2] The system cannot find the file specified #63

Closed
pimhakkert opened this issue Jul 13, 2024 · 3 comments

Comments

@pimhakkert
Copy link
Collaborator

Hi, I'm battling this error and I cannot for the life of me understand what I'm doing wrong.

C:\Users\PTHak\Documents\ui-test-5\addons\gdcef>python build.py
←[32m[INFO] Checking cmake version ...←[00m
Microsoft (R) C/C++ Optimizing Compiler Version 19.40.33812 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

win.cc
Microsoft (R) Incremental Linker Version 14.40.33812.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:win.exe
win.obj
[INFO] MS C++ Compiler OK
[INFO] Clone cpp wrapper for Godot 4.2 into C:\Users\PTHak\Documents\ui-test-5\addons\gdcef\thirdparty\godot-4.2\cpp
Traceback (most recent call last):
  File "C:\Users\PTHak\Documents\ui-test-5\addons\gdcef\build.py", line 521, in <module>
    download_godot_cpp()
  File "C:\Users\PTHak\Documents\ui-test-5\addons\gdcef\build.py", line 367, in download_godot_cpp
    run(["git", "clone", "--recursive", "-b", GODOT_VERSION,
  File "C:\Users\PTHak\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PTHak\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\PTHak\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

So far I have tried to:

  • Reinstall my VS installation and ensured the proper C++ extensions are added
  • Run x64 Native Tools Command Prompt for VS 2022 in Administrator mode
  • Reinstall my python installation
  • Ensure path vars are correct for CMake, Scons, and Python
  • Ensure all required python packages are installed

I am at my wits end. All I try to do is set up a new Godot project, install gdcef via the internal asset library, start the native tools command prompt in admin mode, and execute build.py in the addon/gdcef directory.

Please let me know if there's anything else I can add for debugging sake. Thank you.

@pimhakkert
Copy link
Collaborator Author

Had a look at the error again after a good night's sleep and I noticed I didn't install git on my windows.

Unfortunately after doing a fresh redownload of the extension I'm still bogged down:

C:\Users\PTHak\Documents\ui-test-7\addons\gdcef>python build.py
←[32m[INFO] Checking cmake version ...←[00m
Microsoft (R) C/C++ Optimizing Compiler Version 19.40.33812 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

win.cc
Microsoft (R) Incremental Linker Version 14.40.33812.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:win.exe
win.obj
[INFO] MS C++ Compiler OK
[INFO] Clone cpp wrapper for Godot 4.2 into C:\Users\PTHak\Documents\ui-test-7\addons\gdcef\thirdparty\godot-4.2\cpp
Cloning into 'C:\Users\PTHak\Documents\ui-test-7\addons\gdcef\thirdparty\godot-4.2\cpp'...
remote: Enumerating objects: 10755, done.
remote: Counting objects: 100% (2429/2429), done.
remote: Compressing objects: 100% (517/517), done.
remote: Total 10755 (delta 2074), reused 2067 (delta 1873), pack-reused 8326
Receiving objects: 100% (10755/10755), 13.57 MiB | 23.40 MiB/s, done.
Resolving deltas: 100% (6879/6879), done.
[INFO] Compiling Godot C++ API (inside C:\Users\PTHak\Documents\ui-test-7\addons\gdcef\thirdparty\godot-4.2\cpp) ...
scons: Reading SConscript files ...
NameError: name 'BoolVariable' is not defined:
  File "C:\Users\PTHak\Documents\ui-test-7\addons\gdcef\thirdparty\godot-4.2\cpp\SConstruct", line 36:
    cpp_tool.options(opts, env)
  File "C:\Users\PTHak\Documents\ui-test-7\addons\gdcef\thirdparty\godot-4.2\cpp\tools\godotcpp.py", line 325:
    tool.options(opts)
  File "C:\Users\PTHak\Documents\ui-test-7\addons\gdcef\thirdparty\godot-4.2\cpp\tools\ios.py", line 24:
    opts.Add(BoolVariable("ios_simulator", "Target iOS Simulator", False))
Traceback (most recent call last):
  File "C:\Users\PTHak\Documents\ui-test-7\addons\gdcef\build.py", line 522, in <module>
    compile_godot_cpp()
  File "C:\Users\PTHak\Documents\ui-test-7\addons\gdcef\build.py", line 389, in compile_godot_cpp
    run(SCONS + ["platform=windows", "target=" + GODOT_CPP_TARGET, "use_static_cpp=no",
  File "C:\Users\PTHak\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['scons', 'platform=windows', 'target=template_release', 'use_static_cpp=no', '--jobs=12']' returned non-zero exit status 2.

@pimhakkert
Copy link
Collaborator Author

Managed to fix this as well. @Lecrapouille Please weigh in on what needs to be done for a permanent fix. I don't think it's anything you can fix, but wanted to double check with you.

The fix

Once the build.py script finishes pulling godot-4.2 I exit the script and open the following files under thirdparty/godot-4.2/cpp/tools:

  • windows.py
  • ios.py
  • linux.py

I add from SCons.Variables import BoolVariable to the imports of these files. For some reason importing * does not work and you need to specifically import BoolVariable. I then re-run build.py and it successfully compiles.

@Lecrapouille
Copy link
Owner

@pimhakkert thanks for your report ! I know I could add more pre-checks to verify if some tools for the building phase are present on the system (scons ...).

One guy reported an issue with Scons I guess pyhron's scons vs installed Scons see
#9. You can try change this line.

https://github.com/Lecrapouille/gdcef/blob/godot-4.x/addons/gdcef/build.py#L49-L52

and maybe update your scons version

And hack to know: removing the gdcef/addons/gdcef/thirdparty/ folders force, the buid to be redone from all steps and can fix issues if something odd happened during the initial failed step.

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

2 participants