diff --git a/.dagger/modules/e2e/main.dang b/.dagger/modules/e2e/main.dang index a476aeb..8e0ca53 100644 --- a/.dagger/modules/e2e/main.dang +++ b/.dagger/modules/e2e/main.dang @@ -306,11 +306,13 @@ type E2e { modules that live outside it. """ modulesCwdCheck(ws: Workspace!): Void @check { - # A stable snapshot of the workspace, re-anchorable at any cwd. Keep every - # module config (both dagger.json and dagger-module.toml, for discovery) and - # the nested .keep so lookup/app/nested survives the include filter and can - # serve as a config-less subdirectory. - let root = ws.directory("/", include: ["**/dagger.json", "**/dagger-module.toml", "**/.keep"]) + # A stable snapshot of the workspace, re-anchorable at any cwd. Keep the + # workspace config (dagger.toml, whose [modules..as-sdk] list is what + # modules() resolves the re-anchored workspace against), every module config + # (both dagger.json and dagger-module.toml, for discovery) and the nested + # .keep so lookup/app/nested survives the include filter and can serve as a + # config-less subdirectory. + let root = ws.directory("/", include: ["dagger.toml", "**/dagger.json", "**/dagger-module.toml", "**/.keep"]) # Walk-down: from fixtures/generate only generate/app is in the cone; the # sibling managed modules live outside it and must be excluded. Its diff --git a/go-sdk.dang b/go-sdk.dang index 645af4e..7ee5163 100644 --- a/go-sdk.dang +++ b/go-sdk.dang @@ -29,7 +29,7 @@ type GoSdk { beneath it — not the whole workspace. """ modules(ws: Workspace!): [Mod!]! { - let managed = currentModule.asSDK.modules.{{path}} + let managed = currentModule.asSDK(workspace: ws).modules.{{path}} let cwd = ws.cwd.trimPrefix("/").trimSuffix("/") polyfill .workspace(ws) @@ -108,12 +108,12 @@ type GoSdk { The workspace's [[modules..as-sdk.modules]] entries are the source of truth for SDK-managed modules, so membership needs no config sniffing. """ - let managedBase(path: String!): String { + let managedBase(ws: Workspace!, path: String!): String { # asSDK raises when this module is not installed as an SDK in the active # workspace, which is the normal case for a legacy dagger.json-only repo. # The `.{{path}}` selection is what executes the query, so it must sit # inside the guard. - let managed = currentModule.asSDK.modules.{{path}} rescue [] + let managed = currentModule.asSDK(workspace: ws).modules.{{path}} rescue [] managed .map { m => normalizePath(m.path) } @@ -138,7 +138,7 @@ type GoSdk { let modPath = if (findUp) { let needle = normalizePath(path) - let asSdkBase = managedBase(needle) + let asSdkBase = managedBase(ws, needle) let foundToml = ws.findUp("dagger-module.toml", path) let foundJson = ws.findUp("dagger.json", path) let tomlBase = if (foundToml == null) { null } else {