-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
godot4 --headless --export-release should output a non-zero exit_code on errors #83042
Comments
Is this documented as a feature that's guaranteed? |
This is a OS standard behavior for applications. All applications should comply. It's pretty basic. I think of this being a bug and not a feature. All applications return an error number. But godot is not returning a non-zero error number for failure. Failure in Godot currently is silent. Which breaks anything that relies on the exit signal. Such as CI, build scripts, shell pipelines etc. |
There are plenty of ways to respond to a particular event, that's what needs to be discussed and how to approach it To confirm, the exporting here completely fails yes? No results are exported? |
Sorry if I'm being repetitive. Communication is hard.
Actually there is only one way to do process signalling because it's standardized behavior for all processes. Processes should signal a non-zero error when execution of application has failed. As Godot logs have errors, it should signal a non-zero error. This is standard behavior for process communication.
The issue is not the output of export but the process signalling of export when there are errors. On Godot implementation side. Would be valid to assume that anytime any error has been logged, Godot process should return a non-zero number. Then, there is the question of which one to output. [I'm trying to clarify the number atm, but regardless of the specific number, they key aspect is to output non-zero.] @AThousandShips I'd prefer having this issue labeled as bug and not |
I'll let others make the judgement on that, I don't consider this a bug but a missing feature, but that's just my view, and changing the return value does change the behavior so that means that the distinction between |
This can likely be implemented by using
Godot regularly prints errors due to internal issues (such as engine bugs or user scripts doing something invalid), so I don't think this makes sense. Non-zero exit code should only be returned if the main process failed in some way (such as exporting the project in your case).
I'd just exit with |
+1 for this one. Call it a bug or a feature, whatever is ok. it is badly needed by projects depending on CI workflows. There is no way to find errors that prevent building currently. If other people need current exit code behaviour and changing may break them, please at least provide something like --return-non-zero-on-any-errors. Thanks |
This is clearly a bug, as it prevents CI systems from operating reliably. Seems exit code is very random, I got error code -1073741819 when I export with a workaround to this error #77478, where I add global_script_class_cache.cfg to non ignored files. Make export work if we ignored this weird error coe. On second run however no code error anymore ^^'. It's really painfull we can't rely on exit code. |
To export a Godot project in CI, the workaround I have been using to check for errors is:
I happen to use Nix to do the build.
The idea is straightforward. Just adapt it. |
#89234 should fix this, turns out it was (likely) a misleading assumption that a function named |
Fixes godotengine#83042. (cherry picked from commit 51bfda9)
Fixes godotengine#83042. (cherry picked from commit 51bfda9)
Godot version
4.1.2
System information
Godot v4.1.2.stable (399c9dc) - NixOS 23.11 (Tapir) - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3090 (nvidia; 535.113.01) - AMD Ryzen 9 5950X 16-Core Processor (32 Threads)
Issue description
On
--export-release
failing for any reason, godot4 application should output a non-zero exit_code.It causes CI to not block pipelines.
Desired behavior: In the presence of errors in logs, Godot process should return a non-zero exit signal.
Steps to reproduce
Start any new project. Just run:
Error output:
Then, check for signal error:
0
Minimal reproduction project
This error replicates with any new empty project. (So it is not necessary to provide a zip!)
I'm including a repo and a zip. But it is pointless. You can start a new project and works the same.
https://github.com/superherointj/godot-error-signal
empty-project.zip
The text was updated successfully, but these errors were encountered: