Skip to content

Scripts hash themselves, Build on Run is never or always - #1039

Merged
CedNaru merged 3 commits into
masterfrom
improvement/scripts-changed-warning
Nov 13, 2026
Merged

CedNaru merged 3 commits into
masterfrom
improvement/scripts-changed-warning

Conversation

@CedNaru

@CedNaru CedNaru commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #1032.

Configuration cache fix

compileRegistrarsKotlin failed to store the configuration cache: the registrar source directory came from Provider.map over a task output, which Gradle refuses to evaluate before the task runs. It now uses DirectoryProperty.dir, a location-only provider that still carries the task dependency. The harness turns the configuration cache off, so CI could not catch it; the 3D demo did.

Source hashes without a source manager

  • hashSources hashes every Kotlin, Java and Scala source of the debug build inside the Godot project, and source-hashes.json becomes a flat res:// path → MD5 map. The task no longer reads .gdignore files it did not declare as inputs, which left its output stale and gave it a wrong build cache key.
  • Each JvmScript records the MD5 of its file when the editor loads or saves it; JvmScriptManager holds the build hashes and compares. JvmSourceManager, the source roots and the "source directories added, restart the editor" prompt are gone: a script hashes itself wherever it comes from.
  • A script counts as modified, for the warning of its nodes, only when the build has a hash for its path and it differs.

Build on Run

  • Two options only, never and always, plus Ctrl+click (Cmd+click) to build anyway. The "when scripts changed" option and Shift+click are removed. A saved "when scripts changed" setting reads as always.
  • The toggle keeps the hammer and wrench icon, dimmed for never and in the accent color for always.
  • Run Gradle uses the editor theme's tab styles (tab_selected, tab_hovered).

Spec C.2.2 is reworded accordingly (maintainer decision).

Tests

  • Editor probes build_on_run (reworked around the two options and the node warning; outside edits now give the editor the focus back, as a user returning from an IDE does, which Godot's script editor needs to pick up the change), build_model, reload and rename pass. After the toolbar warning was dropped, build_on_run passes again.
  • 3D demo with the configuration cache, build cache and parallel builds on: edit and revert outside the editor, Build on Run always, never, and Ctrl+click; the node warning, the reload and the JVM status light follow; a saved "when scripts changed" reads as always.
  • Editor, template_debug and template_release build.

@CedNaru
CedNaru force-pushed the improvement/scripts-changed-warning branch 4 times, most recently from 8aab00a to ba9a717 Compare November 13, 2026 01:17
@CedNaru CedNaru changed the title Scripts hash themselves, Build on Run is never or always with a changed-scripts warning Scripts hash themselves, Build on Run is never or always Nov 13, 2026
…n Run probe, as a user returning from an IDE does, and edit in the script editor after outside edits
@CedNaru
CedNaru force-pushed the improvement/scripts-changed-warning branch from ba9a717 to 43abce9 Compare November 13, 2026 01:55
@CedNaru
CedNaru merged commit b51cf85 into master Nov 13, 2026
43 checks passed
@CedNaru
CedNaru deleted the improvement/scripts-changed-warning branch November 13, 2026 03:54
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.

1 participant