Skip to content

Resolve addon dependencies, record them in gdam.lock, hoist or nest each copy - #19

Merged
nicodes merged 1 commit into
mainfrom
feat/dependencies
Oct 10, 2026
Merged

nicodes merged 1 commit into
mainfrom
feat/dependencies

Conversation

@nicodes

@nicodes nicodes commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Resolution (internal/resolve): walks each release's declared dependencies from the registry, picks one tag per addon for the shelf (the project's pin, else the most requested, then the newest), and nests a copy under any consumer whose exact pin differs. Nested copies resolve their own dependencies the same way.
  • Lock (internal/lockfile, gdam.lock): the pins it answers plus every release's verified identity and install paths. gdam install uses a matching lock without the registry; --frozen-lockfile refuses to re-resolve.
  • Placement: hoisted copies at addons/<dir>, nested at <consumer>/.gdam/<dir> with regenerated Godot uids (internal/godotuid, base-34 encoding matching ResourceUID). A previous lock's paths that the new one drops are pruned.
  • deps file: .gdam/deps.gd per copy with dependencies: PATHS plus one preload constant per dependency script (GdSession_credential_adapter).
  • package in gdam.json for addon repositories: the source directory's own declaration must agree with the project's pins and gets its deps file.
  • add/update/remove route through the shared install. gdam update is an alias of add.

Pairs with aviorstudio/gdam-be#213 (registry stores and serves the declaration) and the gdam-actions publish change that attests it. A project with no declared dependencies behaves as before, plus a lock.

Test plan

  • resolve: agreeing pins share one copy; project pin wins and the consumer nests; most-requested then newest wins the shelf; nested copies nest their own; unpublished dependency names the requester; linked addon must agree
  • godotuid: encoding against known values; regeneration rewrites every reference, leaves non-Godot files alone
  • commands: hoist + deps file + lock + lock reuse without resolving; nest with fresh uids then prune on agreement; frozen lockfile; remove prunes dependencies; package directory deps file and disagreement error
  • make check (lint, build, six release archives, tests with -race)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…ach copy

An addon's release may declare the exact tags of the addons it needs;
the registry serves that declaration on resolve. gdam install now walks
it before downloading anything and installs the whole set.

One copy of an addon serves the project at addons/<dir> (hoisted). When
exact pins disagree the project's own pin takes that address and a
consumer that pinned a different tag gets its own copy nested at
<consumer>/.gdam/<dir>, with fresh script uids so the editor never sees
two files claiming one id. Each copy that declares dependencies gets a
generated .gdam/deps.gd naming where its dependencies landed, which is
the only way an addon reaches them.

gdam.lock records what the pins resolved to with each release's verified
identity and every install path. install answers from a matching lock
without the registry, re-resolves when gdam.json changed, and with
--frozen-lockfile refuses to. add, update and remove go through the same
path, so a removed addon's own dependencies are pruned with it.

"package" in an addon repository's gdam.json names the addon's source
directory; install checks its declaration against the project's pins
and writes its deps file there.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@nicodes
nicodes merged commit 2c53bc3 into main Oct 10, 2026
2 checks passed
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