Skip to content

superdevkit stops when it was installed from other sources than its kit - #103

Merged
skerkewitz-agent[bot] merged 1 commit into
developfrom
kit-version-check
Nov 30, 2026
Merged

skerkewitz-agent[bot] merged 1 commit into
developfrom
kit-version-check

Conversation

@skerkewitz-agent

Copy link
Copy Markdown
Contributor

What

The installed superdevkit now notices when it's older than the repository it builds with, and stops with a clear message:

error: this superdevkit (<repo>/build/install/superdevkit) was installed from other sources than the kit it builds with (<repo>): run ./gradlew installDist in <repo>

Before, an outdated installation compiled today's library and examples with an old dampf. It failed on whatever was new, with errors pointing at the game's code: 'music_bank' is not declared for examples/music, an internal compiler error for gruft, an unknown key for modes.

How

  • ./gradlew installDist writes sources.stamp into the installation. It's the SHA-256 of the sources that go into the jars: cli/src/main, compiler/src/main and the four Gradle files, each file as its path and bytes, in path order. SourceStamp, a new class, computes it; a sourceStamp Gradle task runs it.
  • Kit.of compares that stamp with the kit folder's sources when all three hold:
    • the command runs from an installation;
    • the kit folder is a repository;
    • the installation has a stamp.
  • Not checked: release homes, installations from before this change, and the tests (which run in Gradle, not from an installation).
  • lib/ isn't part of the stamp: the build reads it from the kit folder as it is, so editing the library needs no reinstall.
  • Hashing the 183 files (2.5 MB) takes a few milliseconds per command.

A check on the version alone would have caught your 0.7.4 installation, but not a week-old installation of develop. That one carries the same version as today's.

Verified

  • ./gradlew build: 1297 tests, 0 failed. New: SourceStampTest, 4 tests:
    • a fresh installation builds;
    • a changed lib/ file doesn't count;
    • a changed compiler source stops the build, and so does an installation of another repository;
    • releases, stamp-less installations and runs without an installation aren't checked;
    • the stamp doesn't depend on where the repository lies.
  • By hand: build/install/superdevkit/bin/superdevkit build snes examples/hello builds. After one line added to dampf/Main.java it stops with the message above; after reverting the change it builds again.

What follows

  • Generated code: unchanged. This only touches the command and the installation.
  • Documents: a paragraph in README.md on the stamp.
  • Your installation: after this is merged and you run ./gradlew installDist once, the check covers it. Your current installation has no stamp, so it isn't checked until then.
  • Book pages stale at the release: reference/superdevkit (the command's sources changed), if the page mentions the check; nothing else.

🤖 Generated with Claude Code

installDist writes sources.stamp, the SHA-256 of the sources that go
into the jars (dampf's, the command's, the Gradle files). When the
installed superdevkit builds a project whose kit is a repository, it
compares the stamp with the repository's sources and stops with "run
./gradlew installDist in <kit>" when they differ, instead of compiling
today's library and examples with an older dampf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@skerkewitz-agent
skerkewitz-agent Bot merged commit ed14624 into develop Nov 30, 2026
4 checks passed
@skerkewitz-agent
skerkewitz-agent Bot deleted the kit-version-check branch November 30, 2026 19:29
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