Godot Version
4.5
Question
When running Godot from the command line errors are clearly printed.
However I haven’t found a way to also get the compiler warnings out without a language server or the Godot Editor.
Ideally, I’d like to pass in a flag that would make the godot binary print compilation warnings (with filename + line number) to stdout/stderr like this one below:
(UNSAFE_METHOD_ACCESS): The method "is_empty()" is not present on the inferred type "Variant" (but may be present on a subtype)."
For me the use case would be audit/presubmit scripts that would prevent new warnings to be introduced in certain part of the codebase.
(E.g. certain submodule can’t have a certain kind of warning. Or this type of warning is only okay in test code)
Does OS.add_logger() do what you want?
mrcdk
October 7, 2025, 8:08am
3
You can use --script <script> to only run that script and --check-only to only check for errors. If you need warnings too then add --debug
So it would be:
$ ./godot --script my_script.gd --check-only --debug
More command line parameters:
1 Like
Thank you, this is very close to what I needed and it does give the compiler warnings on the command line for some of my scripts.
I’ll need to figure out how to run it in bulk efficiently on all the scripts in a directory, but before that I’m running into an issue.
If the script I’m loading uses an Addon (in my case it’s the Log addon) the script won’t compile and also the Godot binary crashes afterwards.
Here’s the output I’m getting:
godot --script test/tools/damage_matrix_calculator.gd --check-only --debug --headless
Godot Engine v4.5.stable.official.876b29033 - https://godotengine.org
Requested V-Sync mode: Enabled - FPS will likely be capped to the monitor refresh rate.
SCRIPT ERROR: Compile Error: Identifier not found: Log
at: GDScript::reload (res://model/hex/coords_util.gd:180)
Debugger Break, Reason: 'Parser Error: Identifier not found: Log'
*Frame 0 - res://model/hex/coords_util.gd:180 in function ''
Enter "help" for assistance.
debug> q
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.5.stable.official (876b290332ec6f2e6d173d08162a02aa7e6ca46d)
Dumping the backtrace. Please include this when reporting the bug on: https://github.com/godotengine/godot/issues
[1] 1 libsystem_platform.dylib 0x0000000181dd56a4 _sigtramp + 56
[2] icudt_godot77_dat (in Godot) + 4128508
[3] icudt_godot77_dat (in Godot) + 4181192
[4] TextEdit::set_selection_origin_column(int, int) (in Godot) + 156
[5] ScrollContainer::_bind_methods() (in Godot) + 7688
[6] TextEdit::_update_scrollbars() (in Godot) + 924
[7] TextEdit::get_caret_line(int) const (in Godot) + 72
[8] _editor_translation_el_compressed (in Godot) + 7100
[9] ScrollContainer::_bind_methods() (in Godot) + 6824
[10] TextEdit::_update_scrollbars() (in Godot) + 924
[11] TextEdit::get_caret_line(int) const (in Godot) + 72
[12] _editor_translation_el_compressed (in Godot) + 7100
[13] ScrollContainer::_bind_methods() (in Godot) + 6824
[14] TextEdit::_update_scrollbars() (in Godot) + 924
[15] SpinBox::set_suffix(String const&) (in Godot) + 108
[16] icudt_godot77_dat (in Godot) + 3858432
[17] icudt_godot77_dat (in Godot) + 3862240
[18] icudt_godot77_dat (in Godot) + 3870204
[19] icudt_godot77_dat (in Godot) + 3871948
[20] Main::start()
^C[21]
[22] EditorVCSInterface::_bind_methods() (in Godot) + 7940
[23] 23 dyld 0x00000001819fab98 start + 6076
-- END OF C++ BACKTRACE --
================================================================
Abort trap: 6
This is on Mac OS (Godot 4.5).
Any advice on how to proceed or get around this?
Update: it might actually be related to a threading issue in the addon I’m using…
Can you post the guts of model/hex/coords_util.gd? That error look like you’re referencing Log on line 180 of that file without it being defined…
Unfortunately it is neither my code, nor the addon I’m using.
It seems this is a general bug: --check-only seems to break if you call singletons added by plugins.
I filed a bug here:
opened 02:40PM - 11 Oct 25 UTC
### Tested versions
- Reproduced on Godot v4.5.stable
### System information
… Godot v4.5.stable - macOS Sequoia (15.6.1) - Multi-window, 2 monitors - OpenGL 3 (Compatibility) - Apple M1 - Apple M1 (8 threads) - 16.00 GiB memory
### Issue description
When referencing code added via an addon singleton the following command line will result in a compile error:
```
$ godot --script addon_using_script.gd --check-only
SCRIPT ERROR: Compile Error: Identifier not found: DummySingleton
at: GDScript::reload (res://addon_using_script.gd:4)
ERROR: Failed to load script "res://addon_using_script.gd" with error "Compilation failed".
at: load (modules/gdscript/gdscript.cpp:3041)
```
Adding the `--debug` flag will crash debugger in the `godot` binary.
```
$ godot --script addon_using_script.gd --check-only --debug
Godot Engine v4.5.stable.official.876b29033 - https://godotengine.org
OpenGL API 4.1 Metal - 89.4 - Compatibility - Using Device: Apple - Apple M1
SCRIPT ERROR: Compile Error: Identifier not found: DummySingleton
at: GDScript::reload (res://addon_using_script.gd:4)
Debugger Break, Reason: 'Parser Error: Identifier not found: DummySingleton'
*Frame 0 - res://addon_using_script.gd:4 in function ''
Enter "help" for assistance.
debug> q
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.5.stable.official (876b290332ec6f2e6d173d08162a02aa7e6ca46d)
Dumping the backtrace. Please include this when reporting the bug on: https://github.com/godotengine/godot/issues
[1] 1 libsystem_platform.dylib 0x0000000181dd56a4 _sigtramp + 56
[2] typeinfo for Button (in Godot) + 100
[3] typeinfo for FileDialog (in Godot) + 4688
[4] GDScriptLanguage::debug_break_parse(String const&, int, String const&)
[5] GDScript::reload(bool)
[6] GDScriptCache::get_full_script(String const&, Error&, String const&, bool)
[7] ResourceFormatLoaderGDScript::load(String const&, String const&, Error*, bool, float*, ResourceFormatLoader::CacheMode)
[8] vtable for Node3DEditor (in Godot) + 200
[9] vtable for Node3DEditor::PreviewSunEnvPopup (in Godot) + 344
[10] vtable for Path3DEditorPlugin (in Godot) + 228
[11] vtable for Polygon3DEditor (in Godot) + 44
[12] Main::start()
[13] OS_MacOS_NSApp::start_main()
[14] 14 CoreFoundation 0x0000000181e7b46c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
[15] 15 CoreFoundation 0x0000000181f0ab28 ___CFXRegistrationPost_block_invoke + 92
[16] 16 CoreFoundation 0x0000000181f0aa6c _CFXRegistrationPost + 436
[17] 17 CoreFoundation 0x0000000181e4a8b8 _CFXNotificationPost + 740
[18] 18 Foundation 0x0000000183404680 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
[19] 19 AppKit 0x0000000185db21bc -[NSApplication _postDidFinishNotification] + 284
[20] 20 AppKit 0x0000000185db1f6c -[NSApplication _sendFinishLaunchingNotification] + 172
[21] 21 AppKit 0x0000000185db0568 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 488
[22] 22 AppKit 0x0000000185db017c -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 488
[23] 23 Foundation 0x000000018342ce40 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 316
[24] 24 Foundation 0x000000018342cc38 _NSAppleEventManagerGenericHandler + 80
[25] 25 AE 0x000000018987f13c _AppleEventsCheckInAppWithBlock + 13864
[26] 26 AE 0x000000018987ea7c _AppleEventsCheckInAppWithBlock + 12136
[27] 27 AE 0x0000000189878044 aeProcessAppleEvent + 484
[28] 28 HIToolbox 0x000000018d87a828 AEProcessAppleEvent + 68
[29] 29 AppKit 0x0000000185da9d38 _DPSNextEvent + 1456
[30] 30 AppKit 0x0000000186748940 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688
[31] 31 AppKit 0x0000000185d9cbe4 -[NSApplication run] + 480
[32] 32 Godot 0x000000010533e7b0 main + 816
[33] 33 dyld 0x00000001819fab98 start + 6076
-- END OF C++ BACKTRACE --
================================================================
Abort trap: 6
```
### Steps to reproduce
See the attached project but in general:
Have a minimalistic plugin that exposes some code via a singleton.
E.g.
```gdscript
@tool
extends EditorPlugin
const SINGLETON_NAME := "DummySingleton"
const SINGLETON_PATH := "res://addons/dummy_editor_plugin/dummy_singleton.gd"
func _enable_plugin():
add_autoload_singleton(SINGLETON_NAME, SINGLETON_PATH)
func _disable_plugin():
remove_autoload_singleton(SINGLETON_NAME)
```
Singleton code:
```
extends Node
func ping() -> void:
print("DummySingleton.ping() called")
```
After it's added and registered as an addon, it can be invoked from user code with `DummySingleton.ping()`.
However when checking such code via `godot --script ... --check-only` compilation will fail.
---
In the reproduction project you can confirm that the addon works with:
`godot --quit` and observe that it prints:
`DummySingleton.ping() called`
You can repro the compilation failure and the debugger crash with:
`godot --script main_scene.gd --check-only --debug`
(press 'q' in the debugger prompt to trigger the crash)
### Minimal reproduction project (MRP)
[addon_check_only_test_mrp.zip](https://github.com/user-attachments/files/22864769/addon_check_only_test_mrp.zip)
system
Closed
November 10, 2025, 2:45pm
7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.