Skip to content

feat(bb): add sync-clojure-clr and author the Unity runtime-selection constraints (#120) - #124

Open
parth-io wants to merge 2 commits into
flybot-sg:developfrom
parth-io:feat/runtime-selection-tooling
Open

feat(bb): add sync-clojure-clr and author the Unity runtime-selection constraints (#120)#124
parth-io wants to merge 2 commits into
flybot-sg:developfrom
parth-io:feat/runtime-selection-tooling

Conversation

@parth-io

@parth-io parth-io commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Closes #120

  • bb sync-clojure-clr [tag] downloads the DLLs of a flybot-sg/clojure-clr release into magic-unity/Runtime/Infrastructure/Stock/ with gh, defaulting to the newest release rather than /releases/latest, which skips prereleases.
  • magic.unity/constraint-blocks holds the runtime policy — Export gets '!UNITY_EDITOR || MAGIC_RUNTIME_IN_EDITOR', Stock gets UNITY_EDITOR and '!MAGIC_RUNTIME_IN_EDITOR', so players always load MAGIC and the Editor follows the symbol — and bb/templates/plugin-meta/{Export,Stock}.meta.tmpl carry the surrounding importer YAML with {{guid}} and {{defineConstraints}} filled in per DLL.
  • write-metas! creates a plugin .meta for every shipped DLL that lacks one, with a deterministic GUID, and never overwrites: a GUID must not churn under a consumer, so a wrong-but-present meta is check-constraints!'s to report.
  • check-constraints! iterates the DLLs rather than the metas, since a missing meta is the one case a sweep over *.dll.meta cannot see, and it cross-checks the C# import-time stamper against the Export entry.
  • bb build, bb bootstrap and bb refresh-stdlib now call write-metas!, so a freshly deployed DLL cannot ship unconstrained.
  • verify-dist drops its file-existence checks and keeps the nos version smoke test, which boots the whole runtime anyway; the magic-unity DLLs are byte-diffed by check-drift.
  • Not green yet: this PR is the tooling only, so bb write-metas still fails on it — the vendored Stock/*.dll, the constraint blocks on the 39 Export/*.dll.meta (still defineConstraints: []), and magic-unity/Editor/CljPluginConstraints.cs all land in the follow-up.

@parth-io
parth-io marked this pull request as ready for review August 4, 2026 06:29
The file-existence checks were redundant with the smoke test that
followed them. nos version boots the whole runtime to print it, so a
missing launcher, runtime DLL or stdlib .clj.dll causes it to fail.

The magic-unity Export and Stock DLLs it also checked are tracked in
git, and check-drift byte-diffs them on every pull request and on pushes
already. That leaves nostrand/bin, the one path that is untracked build
output, and it is exactly what the smoke test covers.
… constraints (flybot-sg#120)

Vendoring stock ClojureCLR alongside MAGIC means every shipped DLL needs
a defineConstraints block deciding which runtime the Editor loads. Both
halves of that now live in bb: sync-clojure-clr vendors a release into
Stock, write-metas authors the metas, and check-constraints fails when a
shipped DLL is missing its block.
@parth-io
parth-io force-pushed the feat/runtime-selection-tooling branch from ebb8a4a to 56f0a6e Compare August 4, 2026 06:46
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.

There is no way to dowload stock ClojureCLR DLLs, and choose which runtime the Editor loads

1 participant