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

Various script errors when building #185

Open
d6e opened this issue Jan 5, 2024 · 8 comments
Open

Various script errors when building #185

d6e opened this issue Jan 5, 2024 · 8 comments

Comments

@d6e
Copy link

d6e commented Jan 5, 2024

When I do a godot build, I get these script errors in my CI logs:

SCRIPT ERROR: Parse Error: Could not find type "ParameterDisplay" in the current scope.
          at: GDScript::reload (res://addons/fmod/tool/ui/EventParametersDisplay.gd:14)
ERROR: Failed to load script "res://addons/fmod/tool/ui/EventParametersDisplay.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:2775)
SCRIPT ERROR: Parse Error: Could not find type "FmodBankExplorer" in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:12)
SCRIPT ERROR: Parse Error: Identifier "FmodEditorExportPluginProxy" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:14)
SCRIPT ERROR: Parse Error: Identifier "FmodEmitterPropertyInspectorPlugin" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:15)
SCRIPT ERROR: Parse Error: Identifier "FmodBankLoaderPropertyInspectorPlugin" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:16)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:41)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:41)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:41)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:41)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:45)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:45)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:49)
@piiertho
Copy link
Member

piiertho commented Jan 7, 2024

Hello !
Can you give informations about the CI steps you're doing with where it fails ?

@d6e
Copy link
Author

d6e commented Jan 7, 2024

Right, sorry, the errors can be reproduced simply by launching the editor from the CLI: godot --editor --quit --headless

@piiertho
Copy link
Member

piiertho commented May 7, 2024

Sorry for late reply. It looks like the types has not been added to project.godot.
Did you commit changes to this file ?

@3ter
Copy link

3ter commented May 19, 2024

I've got similar errors using https://github.com/abarichello/godot-ci/blob/master/.gitlab-ci.yml to export my game to Windows.

$ godot --headless --verbose --export-release windows ../build/windows/$EXPORT_NAME.exe
Godot Engine v4.2.2.stable.official.15073afe3 - https://godotengine.org
TextServer: Added interface "Dummy"
TextServer: Added interface "ICU / HarfBuzz / Graphite (Built-in)"
Using "default" pen tablet driver...
JoypadLinux: udev enabled and loaded successfully.
 
TextServer: Primary interface set to: "ICU / HarfBuzz / Graphite (Built-in)".
CORE API HASH: 2995524600
EDITOR API HASH: 3767149329
WARNING: Custom cursor shape not supported by this display server.
     at: cursor_set_custom_image (servers/display_server.cpp:505)
EditorSettings: Load OK!
SCRIPT ERROR: Parse Error: Identifier "FmodServer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodManager.gd:8)
SCRIPT ERROR: Parse Error: Identifier "FmodServer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodManager.gd:11)
ERROR: Failed to load script "res://addons/fmod/FmodManager.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:[27](https://gitlab.com/imagine-group/knowledge-is-power/-/jobs/6885192305#L27)26)
ERROR: Failed to create an autoload, script 'res://addons/fmod/FmodManager.gd' does not inherit from 'Node'.
   at: _create_autoload (editor/editor_autoload_settings.cpp:423)

My project.godot has these entries regarding fmod (I did not modify them):

[Fmod]

General/auto_initialize=true
General/channel_count=1024
General/is_live_update_enabled=true
General/is_memory_tracking_enabled=false
"Software Format/sample_rate"=48000
"Software Format/speaker_mode"=3
"Software Format/raw_speaker_count"=0
General/default_listener_count=1
General/banks_path="res://"
General/should_load_by_name=false
DSP/dsp_buffer_size=512
DSP/dsp_buffer_count=4
"3D Settings/doppler_scale"=1.0
"3D Settings/distance_factor"=1.0
"3D Settings/rolloff_scale"=1.0

[autoload]

FmodManager="*res://addons/fmod/FmodManager.gd"

[editor_plugins]

enabled=PackedStringArray("res://addons/fmod/plugin.cfg")

@piiertho
Copy link
Member

I've got similar errors using https://github.com/abarichello/godot-ci/blob/master/.gitlab-ci.yml to export my game to Windows.

$ godot --headless --verbose --export-release windows ../build/windows/$EXPORT_NAME.exe
Godot Engine v4.2.2.stable.official.15073afe3 - https://godotengine.org
TextServer: Added interface "Dummy"
TextServer: Added interface "ICU / HarfBuzz / Graphite (Built-in)"
Using "default" pen tablet driver...
JoypadLinux: udev enabled and loaded successfully.
 
TextServer: Primary interface set to: "ICU / HarfBuzz / Graphite (Built-in)".
CORE API HASH: 2995524600
EDITOR API HASH: 3767149329
WARNING: Custom cursor shape not supported by this display server.
     at: cursor_set_custom_image (servers/display_server.cpp:505)
EditorSettings: Load OK!
SCRIPT ERROR: Parse Error: Identifier "FmodServer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodManager.gd:8)
SCRIPT ERROR: Parse Error: Identifier "FmodServer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodManager.gd:11)
ERROR: Failed to load script "res://addons/fmod/FmodManager.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:[27](https://gitlab.com/imagine-group/knowledge-is-power/-/jobs/6885192305#L27)26)
ERROR: Failed to create an autoload, script 'res://addons/fmod/FmodManager.gd' does not inherit from 'Node'.
   at: _create_autoload (editor/editor_autoload_settings.cpp:423)

My project.godot has these entries regarding fmod (I did not modify them):

[Fmod]

General/auto_initialize=true
General/channel_count=1024
General/is_live_update_enabled=true
General/is_memory_tracking_enabled=false
"Software Format/sample_rate"=48000
"Software Format/speaker_mode"=3
"Software Format/raw_speaker_count"=0
General/default_listener_count=1
General/banks_path="res://"
General/should_load_by_name=false
DSP/dsp_buffer_size=512
DSP/dsp_buffer_count=4
"3D Settings/doppler_scale"=1.0
"3D Settings/distance_factor"=1.0
"3D Settings/rolloff_scale"=1.0

[autoload]

FmodManager="*res://addons/fmod/FmodManager.gd"

[editor_plugins]

enabled=PackedStringArray("res://addons/fmod/plugin.cfg")

Can you try to run godot --headless --editor --quit before trying to create the export ?

@3ter
Copy link

3ter commented May 19, 2024

Unfortunately godot --headless --editor --quit is already part of the pipeline.

I've just added a stage to download the actual files (including the libraries which are not saved to the repository to save storage space):

download-addons:
  stage: download-addons
  script:
    - apt-get update
    - apt-get install -y curl
    - cd $EXPORT_NAME/addons
    - rm -rf fmod
    - curl -L https://github.com/utopia-rise/fmod-gdextension/releases/download/4.2.0-4.2.0/addons.zip -o addons.zip
    - unzip addons.zip -d .

And directly afterwards there is this (which I didn't change)

# Open the editor to import assets in case the cache was empty or outdated
import-assets:
  stage: import-assets
  script:
    - godot --headless --verbose --editor --quit

Unfortunately the errors persist. I can log all of them if it helps
godot_export_log.txt

I don't understand the following error in particular because the file inflated just fine from the zip:

inflating: ./fmod/libs/windows/libGodotFmod.windows.template_release.x86_64.dll

but then

ERROR: Failed to open /builds/imagine-group/knowledge-is-power/godot-project-top-down/addons/fmod/libs/windows/libGodotFmod.windows.template_release.x86_64.dll
   at: copy (core/io/dir_access.cpp:346)

💥EDIT: Now that I think about it. How could a .dll file be opened on linux anyways?
Does it have to open those for the export? Shouldn't it use the linux ones?

I just checked with ldd that all .so files can be used. Is there some additional setup needed for linux (in this case ubuntu)?

@piiertho
Copy link
Member

Unfortunately godot --headless --editor --quit is already part of the pipeline.

I've just added a stage to download the actual files (including the libraries which are not saved to the repository to save storage space):

download-addons:

  stage: download-addons

  script:

    - apt-get update

    - apt-get install -y curl

    - cd $EXPORT_NAME/addons

    - rm -rf fmod

    - curl -L https://github.com/utopia-rise/fmod-gdextension/releases/download/4.2.0-4.2.0/addons.zip -o addons.zip

    - unzip addons.zip -d .

And directly afterwards there is this (which I didn't change)

# Open the editor to import assets in case the cache was empty or outdated

import-assets:

  stage: import-assets

  script:

    - godot --headless --verbose --editor --quit

Unfortunately the errors persist. I can log all of them if it helps

godot_export_log.txt

I don't understand the following error in particular because the file inflated just fine from the zip:


inflating: ./fmod/libs/windows/libGodotFmod.windows.template_release.x86_64.dll

but then


ERROR: Failed to open /builds/imagine-group/knowledge-is-power/godot-project-top-down/addons/fmod/libs/windows/libGodotFmod.windows.template_release.x86_64.dll

   at: copy (core/io/dir_access.cpp:346)

💥EDIT: **Now that I think about it. How could a .dll file be opened on linux anyways?

Does it have to open those for the export? Shouldn't it use the linux ones?**

I just checked with ldd that all .so files can be used. Is there some additional setup needed for linux (in this case ubuntu)?

It should use Linux so files.

I think this is because of Godot cache not being present. I tried locally to remove my Godot cache and got same errors and cannot regenerate it using import command line argument.
Can you try to commit your Godot cache (I know this is not a good practice) just to see if error goes out ?

@3ter
Copy link

3ter commented May 24, 2024

Yeah, when the cache folder is included the pipeline works (although there were some errors in the logs).
image

FMOD Sound System: Successfully set DSP buffer size
[ERR] FMOD_OS_Library_Load                     : dlopen failed to open 'libpulse.so.0', dlerror = libpulse.so.0: cannot open shared object file: No such file or directory
[LOG] SystemI::init                            : Initialize version=20212 (131544), maxchannels=1024, flags=0x00030004
[ERR] FMOD_OS_Library_Load                     : dlopen failed to open 'libpulse.so.0', dlerror = libpulse.so.0: cannot open shared object file: No such file or directory
[LOG] SystemI::setOutputInternal               : Setting output to 'FMOD ALSA Output'
[LOG] OutputALSA::registerLib                  : Loaded ALSA version 1.2.6.1.
[LOG] OutputALSA::enumerate                    : Found device NAME:null IOID:(null).
[WRN] SystemI::init                            : No output sound devices found - switching output mode to FMOD_OUTPUTTYPE_NOSOUND

But in our case the project doesn't really like getting exported it seems. The .exe closes on itself (and I don't see an error message when running it from the console). This has nothing to do with FMOD though, at least in a newly created project with the addon enabled it exported fine.

EDIT: I found out what let the game crash so ungracefully. When I remove (or disable, mind the missing *) my autoload (it's the FmodBankLoader) it runs smoothly again... If you've got more intel on this, please consider answering here: #222.

[autoload]

FmodManager="*res://addons/fmod/FmodManager.gd"
AudioSingleton="res://autoloads/audio_singleton.tscn"

EDIT2: 💥 It was not (really) that, because the folder containing the banks started with an uppercase letter (like in the example in the docs: https://fmod-gdextension.readthedocs.io/en/latest/user-guide/3-nodes/) and for some reason in the FmodBankLoader that folder had a lower case letter. It would be REALLY helpful to have at least some hint at the error in contrast to no messages at all.
image
image

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

3 participants