feat: make PHP module discovery cwd-aware - #1
Open
tiborvass wants to merge 1 commit into
Open
Conversation
Discover managed PHP modules from the caller workspace and cwd across both dagger-module.toml and legacy dagger.json configs. Keep workspace-root module identity separate from cwd-relative display paths, explicitly bind asSDK to the passed workspace, and anchor generation paths at the workspace root. Add end-to-end coverage for mixed config ordering, scoped discovery, explicit workspace resolution, and generation from nested directories.
tiborvass
marked this pull request as ready for review
July 27, 2026 17:15
Member
|
Let's do dagger/typescript-sdk#12 (modulesource.generateLocalDependencies changes) in a follow up PR, this one module looks pretty good already |
Member
|
Trying to run dagger generate after initializing a php module throw this error: loading module "/private/tmp/_manual_dagger_test/_test_php/.dagger/modules/bar": resolving module source "/private/tmp/_manual_dagger_test/_test_php/.dagger/modules/bar": failed to load sdk for local module source: invalid SDK: "github.com/dagger/dagger/sdk/[email protected]"The fix is to pin |
24 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
dagger.jsonscanning with cwd-aware config discovery throughdagger/polyfill.dagger-module.tomland legacydagger.json, choosing the nearest config regardless of filename ordering.currentModule.asSDK(workspace: ws).Mod.rootPathfrom the cwd-relative publicMod.path.rootPathat/when resolving module sources so generation works from a module root or another nested directory.vendortrees, update the polyfill dependency, and document the new behavior.Why
The previous implementation scanned every legacy
dagger.jsonfrom the workspace root. That ignored the caller's cwd, could not discover modern TOML modules, and could disagree with the workspace's engine-owned managed-module list.Keeping root-relative identity separate from cwd-relative display paths also prevents nested generation from interpreting a stable module root relative to the cwd and prefixing that cwd twice.
Validation
Validated against a current locally built Dagger dev engine:
dagger checkAll 3 checks pass:
e-2-e:module-lookup-checke-2-e:module-discovery-checke-2-e:generate-cwd-checkRelated implementations