Skip to content

GD4 branch compilation error on Ubuntu 22.04 + Fix #143

@whytry313

Description

@whytry313

Problem

GD4 compilation fails on Linux x11 (Ubuntu 22.04.1 / XFCE4)

💻 $: sudo apt-get install build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev \
    libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm
💻 $: git clone https://github.com/godotengine/godot.git
💻 $: git clone https://github.com/Geequlim/ECMAScript.git
💻 $: cd ECMAScript && git checkout gd4 && cd ..
💻 $: cp -r ./ECMAScript ./godot/modules/javascript
💻 $: cd ./godot/
💻 $: scons -j8 platform=x11 arch=x86_64
Error Log
scons: Reading SConscript files ...
Platform "x11" has been renamed to "linuxbsd" in Godot 4.0. Building for platform "linuxbsd".
Warning: fontconfig libraries not found. Disabling the system fonts support.
Warning: D-Bus development libraries not found. Disabling screensaver prevention.
Warning: Speech Dispatcher development libraries not found. Disabling Text-to-Speech support.
Building for platform "linuxbsd", architecture "x86_64", target "editor".
KeyError: 'tools':
  File "/link/to/godot/gitclone/godot/SConstruct", line 904:
    SConscript("modules/SCsub")
  File "/usr/lib/python3/dist-packages/SCons/Script/SConscript.py", line 661:
    return method(*args, **kw)
  File "/usr/lib/python3/dist-packages/SCons/Script/SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/lib/python3/dist-packages/SCons/Script/SConscript.py", line 287:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/link/to/godot/gitclone/godot/modules/SCsub", line 34:
    SConscript(base_path + "/SCsub")
  File "/usr/lib/python3/dist-packages/SCons/Script/SConscript.py", line 661:
    return method(*args, **kw)
  File "/usr/lib/python3/dist-packages/SCons/Script/SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/lib/python3/dist-packages/SCons/Script/SConscript.py", line 287:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/link/to/godot/gitclone/godot/modules/javascript/SCsub", line 44:
    if env['tools']:
  File "/usr/lib/python3/dist-packages/SCons/Environment.py", line 405:
    return self._dict[key]

Fix

After some quick digging I found out that godot/modules/javascript/SCsub:44/63 (SCsub on root of this repo) checks for env['tools'] and print(env.keys()) contains only uppercase TOOLS and no lowecase tools so I changed it

godot/modules/javascript/SCsub
44:- 	if env['tools']:
44:+ 	if env['TOOLS']:
...
63:- if env['tools']:
63:+ if env['TOOLS']:

After this quick change, 💻 $: scons -j8 platform=x11 arch=x86_64 runs fine (with some warnings but no errors)

Notes

Project GD3 to GD4 conversion doesn't work, the editor is a big laggy but so far 🔥 javascript works 🔥
So far I don't know if this error is ubuntu specific or GD4 specific, might need a bit of testing before applying any fix on the files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions