Skip to content

dang: support v1 and v2, routed by module engineVersion - #13388

Merged
vito merged 5 commits into
dagger:mainfrom
vito:bump-dang-2026-06-09
Jun 10, 2026
Merged

vito merged 5 commits into
dagger:mainfrom
vito:bump-dang-2026-06-09

Conversation

@vito

@vito vito commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

This started as a routine vito/dang bump, but the bump includes a breaking syntax change (#101): .{ } changed from object selection to dot-block application (piping), with selection moving to .{{ }}. Both forms parse under either version with different meanings, so existing Dang modules would silently change behavior — there is no parse error to catch it.

Instead of breaking old modules, this PR introduces a multi-version Dang runtime: the engine now imports both github.com/vito/dang (v1, old semantics) and github.com/vito/dang/v2 (new semantics) and routes each module by its engineVersion:

Module engineVersion Dang major Semantics
< v0.21.5 v1 .{ } is selection
>= v0.21.5 v2 .{ } is dot-block application, .{{ }} is selection

How it works

  • core/sdk/dang_sdk.go is now a thin dispatcher: dangSDK keeps all version-agnostic core.SDK behavior and picks a per-major implementation via a new engine.MinimumDangV2ModuleVersion = "v0.21.5" gate (same CheckVersionCompatibility pattern as the function-caching gate).
  • core/sdk/dang/v2/ is the living implementation (all feature work lands here), core/sdk/dang/v1/ is a frozen snapshot — byte-identical except package clause, dang import paths, and doc comments. core/sdk/dang/shared/ holds the dang-free plumbing (nested-client proxy server, client metadata, error conversion) so the per-major packages stay pure copies.
  • This pattern is designed to repeat cheaply: new Dagger features always require a new engineVersion, which always routes to the newest major — so frozen majors never need feature work, only compiler-forced updates when engine internals change. When dang v3 ships, supporting it is: copy the living package, rewrite imports, add one constant, add one case to the dispatch ladder. The full recipe lives in core/sdk/dang/README.md.

cgo gotcha

Linking both majors into one cgo-enabled binary collided on the tree-sitter C symbols (tree_sitter_dang + external scanner functions) — C symbols share a global namespace, so Go's module-major isolation doesn't help. Fixed upstream in dang v1.0.1 by renaming the frozen line's symbols with a _v1 suffix via #defines in the cgo preamble; the canonical names stay with v2 so editor integrations are unaffected. The engine binary itself was never affected (it builds with CGO_ENABLED=0; dang falls back to pure-Go paths) — only host-side test binaries hit it.

Tests

  • All dang testdata fixtures now pin engineVersion: v0.21.5 so the main suite exercises the living v2 path (~40 of them previously had no engineVersion and would have silently routed to v1).
  • New TestDang/TestVersionedSyntax proves the routing end-to-end: a legacy-selection module pinned to v0.20.6 using .{ } selection (v1), and a dot-block module at v0.21.5 using .{ _ * 2 } piping and .{{ }} selection (v2).
  • Suites run against a dev engine: TestDang (32), TestModule/TestBuiltinDang* (9), TestWorkspace/TestContextualWorkspace (332), TestUp dang cases (5) — all green.

Note

The in-repo Dang modules (toolchains/*, cmd/codegen, modules/markdownlint) are pinned to v0.21.4 and will route to v1 until v0.21.5 ships (the released CLI rejects newer configs). They use no .{ } syntax, so behavior is identical; they should be bumped after the release.

Upstream changes in this bump

From 0175bae (2026-06-03) to v1.0.1 / v2.0.0 (2026-06-09).

Language

  • #92 — pub keyword is now optional; bindings default to public
  • #100 — postfix ! non-null assertion operator
  • #101 — dot-block application .{ }, object selection .{{ }}, and implicit _ block parameter (v2 only; reverted on the v1 line)
  • #98 — Map collection type
  • #104 — List.find
  • #95 — regexp Match is now a plain object with named captures
  • #99 — reject operations on generic type params (fix)

GraphQL / Dagger

  • #87 — support plain GraphQL introspection
  • #97 — support the new Dagger module config
  • #89 — send arguments on nested selection fields (fix)
  • #90 — point GraphQL errors at the failing field (fix)

Docs

  • #93 — auto-generate the stdlib reference
  • #94 — runnable example REPL per stdlib entry
  • #88 — interactive Dang WASM REPL component
  • #84 — runnable client-side Dang playground on the front page
  • #86 — GitHub GraphQL playground page
  • #96 — theme code blocks via CSS for light mode
  • #91 — repair broken Ctrl+K search (fix)
  • #85 — restore blockquote paragraph spacing (fix)
  • #82 — only show feedback button on prose (fix)
  • #83 — trim low-value bullets from the overview

🤖 Generated with Claude Code

@vito vito added this to the v0.21.5 milestone Jun 9, 2026
vito added 5 commits June 9, 2026 22:01
Routine bump of vito/dang, pulling in dot-block application and `.{{ }}`
selection, an optional `pub` keyword, a postfix `!` non-null assertion, a
Map collection type, List.find, plain GraphQL introspection, and support
for the new Dagger module config, along with assorted docs and fixes.

Signed-off-by: Alex Suraci <[email protected]>
Dang v2 changed the meaning of `.{ }` from GraphQL selection to
dot-block application, with selection moving to `.{{ }}`. Both forms
parse under either version, so modules written against v1 would
silently change behavior if evaluated with v2.

Import both github.com/vito/dang majors and route each module to the
version matching its engineVersion: modules pinned before v0.21.5 keep
v1 semantics, v0.21.5+ gets v2. dangSDK becomes a thin dispatcher over
a per-major implementation package: core/sdk/dang/v2 is the living
copy, core/sdk/dang/v1 a frozen snapshot (identical except import
paths and doc comments), and core/sdk/dang/shared holds the dang-free
plumbing so a future major is a pure copy plus import rewrite. See
core/sdk/dang/README.md for the maintenance recipe.

Signed-off-by: Alex Suraci <[email protected]>
Dang modules now route to the Dang v1 runtime when their engineVersion
is below v0.21.5. Most dang fixtures had no engineVersion at all (which
normalizes below the gate) or pinned v0.20.x, so the whole suite would
silently exercise the frozen v1 package. Pin them all to v0.21.5 so the
main suite tests the living v2 implementation; the fixtures use no
`.{ }` syntax, so their behavior is identical under either major.

Signed-off-by: Alex Suraci <[email protected]>
Add a legacy-selection module pinned to v0.20.6 that uses `.{ }` as
selection (Dang v1) and a dot-block module at v0.21.5 that uses `.{ }`
application and `.{{ }}` selection (Dang v2), with a
TestVersionedSyntax suite asserting both run end-to-end with the
semantics they were written against.

Signed-off-by: Alex Suraci <[email protected]>
Linking both dang majors into one cgo-enabled binary (e.g. the
core/schema test binary in CI) failed with multiple definitions of
tree_sitter_dang and its external scanner functions, since both majors
compiled the same tree-sitter C sources and C symbols share one global
namespace. dang v1.0.1 renames the frozen line's symbols with a _v1
suffix; the canonical names stay with v2 so editor integrations keep
working. The engine binary itself was unaffected because it builds
with CGO_ENABLED=0 and dang falls back to its pure-Go paths. Document
the symbol-rename step in the next-major recipe.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the bump-dang-2026-06-09 branch from 40f88cb to dbc0e03 Compare June 10, 2026 02:01
@vito vito changed the title go.mod: bump vito/dang to 7b7d885fb711 dang: support v1 and v2, routed by module engineVersion Jun 10, 2026
@vito
vito merged commit cae8c93 into dagger:main Jun 10, 2026
79 checks passed
marcosnils pushed a commit that referenced this pull request Jun 10, 2026
* go.mod: bump vito/dang to 7b7d885fb711

Routine bump of vito/dang, pulling in dot-block application and `.{{ }}`
selection, an optional `pub` keyword, a postfix `!` non-null assertion, a
Map collection type, List.find, plain GraphQL introspection, and support
for the new Dagger module config, along with assorted docs and fixes.

Signed-off-by: Alex Suraci <[email protected]>

* core/sdk: pick dang major by module engineVersion

Dang v2 changed the meaning of `.{ }` from GraphQL selection to
dot-block application, with selection moving to `.{{ }}`. Both forms
parse under either version, so modules written against v1 would
silently change behavior if evaluated with v2.

Import both github.com/vito/dang majors and route each module to the
version matching its engineVersion: modules pinned before v0.21.5 keep
v1 semantics, v0.21.5+ gets v2. dangSDK becomes a thin dispatcher over
a per-major implementation package: core/sdk/dang/v2 is the living
copy, core/sdk/dang/v1 a frozen snapshot (identical except import
paths and doc comments), and core/sdk/dang/shared holds the dang-free
plumbing so a future major is a pure copy plus import rewrite. See
core/sdk/dang/README.md for the maintenance recipe.

Signed-off-by: Alex Suraci <[email protected]>

* core/integration: pin dang testdata to v0.21.5

Dang modules now route to the Dang v1 runtime when their engineVersion
is below v0.21.5. Most dang fixtures had no engineVersion at all (which
normalizes below the gate) or pinned v0.20.x, so the whole suite would
silently exercise the frozen v1 package. Pin them all to v0.21.5 so the
main suite tests the living v2 implementation; the fixtures use no
`.{ }` syntax, so their behavior is identical under either major.

Signed-off-by: Alex Suraci <[email protected]>

* core/integration: cover dang v1/v2 syntax routing

Add a legacy-selection module pinned to v0.20.6 that uses `.{ }` as
selection (Dang v1) and a dot-block module at v0.21.5 that uses `.{ }`
application and `.{{ }}` selection (Dang v2), with a
TestVersionedSyntax suite asserting both run end-to-end with the
semantics they were written against.

Signed-off-by: Alex Suraci <[email protected]>

* go.mod: bump vito/dang to v1.0.1 for cgo symbol fix

Linking both dang majors into one cgo-enabled binary (e.g. the
core/schema test binary in CI) failed with multiple definitions of
tree_sitter_dang and its external scanner functions, since both majors
compiled the same tree-sitter C sources and C symbols share one global
namespace. dang v1.0.1 renames the frozen line's symbols with a _v1
suffix; the canonical names stay with v2 so editor integrations keep
working. The engine binary itself was unaffected because it builds
with CGO_ENABLED=0 and dang falls back to its pure-Go paths. Document
the symbol-rename step in the next-major recipe.

Signed-off-by: Alex Suraci <[email protected]>

---------

Signed-off-by: Alex Suraci <[email protected]>
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
dagger 0.21.5

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## v0.21.5 - 2026-06-10

### Added

- Added expand option to container.exists by @alexcb in dagger/dagger#13310
- Support both Dang v1 and v2, routed by module engineVersion by @vito in dagger/dagger#13388

### Changed

- Prune local cache during disk pressure by @sipsma in dagger/dagger#13375
- Persist trivial core objects by @sipsma in dagger/dagger#13387

### Fixed

- Correct namespaced type-name mangling and cross-dependency interface dispatch in Dang by @vito in dagger/dagger#13377
- Surface exec errors correctly on the Bun runtime in the TypeScript SDK by @marcosnils in dagger/dagger#13395
- Ignore host xattrs for local filesync import identity by @sipsma in dagger/dagger#13389
- Don't shallow-clone the user's repo for git telemetry labels by @marcosnils in dagger/dagger#13363
- Preserve pending lazy container parents by @sipsma in dagger/dagger#13365
- Preserve withChanges parent layers by @dagger-codex[bot] + @shykes in dagger/dagger#13342
- Treat incomplete image metadata as cache miss by @sipsma in dagger/dagger#13346
- Cache registry image metadata by @dagger-codex[bot] + @shykes in dagger/dagger#13341
- Don't require id field for interface conformance in Dang by @vito in dagger/dagger#13318
- Use module-local check names for scale-out by @dagger-codex[bot] + @tiborvass in dagger/dagger#13329
- Fix snapshot owner lease attach/remove race by @sipsma in dagger/dagger#13321
- Follow source symlinks when copying directory contents in layercopy by @marcosnils in dagger/dagger#13326

### What to do next?

- Read the [documentation](https://docs.dagger.io)
- Join our [Discord server](https://discord.gg/dagger-io)
- Follow us on [Twitter](https://twitter.com/dagger_io)

</pre>
  <p>View the full release notes at <a href="https://github.com/dagger/dagger/releases/tag/v0.21.5">https://github.com/dagger/dagger/releases/tag/v0.21.5</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!11205
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