Skip to content

fix: auto-run Godot import cache before first launch#3

Merged
cahaseler merged 2 commits intoSpaceMolt:mainfrom
rsned:fix/makefile-auto-import
Apr 12, 2026
Merged

fix: auto-run Godot import cache before first launch#3
cahaseler merged 2 commits intoSpaceMolt:mainfrom
rsned:fix/makefile-auto-import

Conversation

@rsned
Copy link
Copy Markdown
Contributor

@rsned rsned commented Apr 11, 2026

Summary

  • On a fresh clone, make run fails with hundreds of parse errors because the .godot/ import cache doesn't exist yet. Without it, class_name types (ThemeColors, Log, etc.) aren't registered and resource imports (fonts) fail.
  • Adds an import Makefile target that runs godot --headless --import when .godot/ is missing
  • Makes the run target depend on import so the first make run just works

Context

The make run target launches Godot directly without running the import step first. Godot needs to run its import/editor scan ($GODOT --headless --import) to build the .godot/ cache, which:

  • Registers all class_name types (ThemeColors, Log, etc.)
  • Imports all resources (fonts, textures, etc.)

Without this step, every script referencing those types fails to parse. The import only runs when .godot/ is missing, so it adds no overhead on subsequent launches. A full reimport can be forced with rm -rf .godot && make import.

Test plan

  • Clone fresh (or rm -rf .godot) and run make run — should import automatically then launch cleanly
  • Run make run again — should skip import and launch immediately
  • make import works standalone

🤖 Generated with Claude Code

rsned and others added 2 commits April 11, 2026 15:07
The Makefile used := which unconditionally overwrites GODOT,
ignoring any value set via the environment. Switch to ?= so
the auto-detection only runs as a fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
On a fresh clone the .godot/ directory doesn't exist yet, so
class_name types (ThemeColors, Log, etc.) aren't registered and
resource imports (fonts) fail, producing a wall of parse errors.

Add an `import` target that runs `godot --headless --import` when
.godot/ is missing, and make `run` depend on it so the first
`make run` just works.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cahaseler cahaseler merged commit 393944f into SpaceMolt:main Apr 12, 2026
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

Successfully merging this pull request may close these issues.

2 participants