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

godot cli does not set non zero exit code on error #85062

Closed
AlexanderLangguth opened this issue Nov 18, 2023 · 1 comment
Closed

godot cli does not set non zero exit code on error #85062

AlexanderLangguth opened this issue Nov 18, 2023 · 1 comment

Comments

@AlexanderLangguth
Copy link

Godot version

Godot Engine v4.2.rc1.mono.official.ad72de508 and any other, including v3.x

System information

Windows, Linux

Issue description

I have been building godot a lot now using gitlab pipelines and regardless of which godot version, whenever any error happened during the build or export the cli always exited with exit code 0, resulting in succeeding pipelines, although the build step should have failed.

Could you please make the CLI commands (at least the build and export ones) compliant with regular build CLIs that actually set the exit code to anything != 0, so that automated build pipelines actually fail when the build was not successful?

I don't know how this was never reported. I guess Godot was not used in any major production system yet and everyone always just exported by hand.

Steps to reproduce

Have any error in your godot project that fails the build or export command.
As a simple example I just export something that is not configured, which leads to red error messages, but also exit code 0.
Example: godot . --export-debug "test" "./out" --headless

Minimal reproduction project

It's just a completely empty Godot project. In this case based on Godot version 4.2-rc1, but any version I tested so far, including 3.x had this issue.
project.zip

Windows Powershell:

PS > .\Godot_v4.2-rc1_mono_win64_console.exe . --export-debug "test" "./out" --headless
Godot Engine v4.2.rc1.mono.official.ad72de508 - https://godotengine.org
WARNING: Custom cursor shape not supported by this display server.
     at: cursor_set_custom_image (servers/display_server.cpp:505)
WARNING: Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
     at: _editor_init (modules/gltf/register_types.cpp:63)
ERROR: This project doesn't have an `export_presets.cfg` file at its root.
Create an export preset from the "Project > Export" dialog and try again.
   at: _fs_changed (editor/editor_node.cpp:994)
ERROR: Condition "!EditorSettings::get_singleton() || !EditorSettings::get_singleton()->has_setting(p_setting)" is true. Returning: Variant()
   at: _EDITOR_GET (editor/editor_settings.cpp:1140)
PS >  echo $LASTEXITCODE
0

Debian (Docker Image, like it would be in the pipeline):

root@d765c31eeaf3:/workspaces/example# godot . --export-debug "test" "./out" --headless
Godot Engine v4.2.rc1.mono.official.ad72de508 - https://godotengine.org
 
WARNING: Custom cursor shape not supported by this display server.
     at: cursor_set_custom_image (servers/display_server.cpp:505)
WARNING: Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
     at: _editor_init (modules/gltf/register_types.cpp:63)
ERROR: This project doesn't have an `export_presets.cfg` file at its root.
Create an export preset from the "Project > Export" dialog and try again.
   at: _fs_changed (editor/editor_node.cpp:994)
ERROR: Condition "!EditorSettings::get_singleton() || !EditorSettings::get_singleton()->has_setting(p_setting)" is true. Returning: Variant()
   at: _EDITOR_GET (editor/editor_settings.cpp:1140)
root@d765c31eeaf3:/workspaces/example# echo $?
0
@AThousandShips
Copy link
Member

AThousandShips commented Nov 18, 2023

Thank you for reporting, closing as a duplicate of:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants