Use workspace root when constructing Entrypoint in getExecutableForCommand and ensureUpToDate - #4863
Open
sigurdm wants to merge 1 commit into
Open
Use workspace root when constructing Entrypoint in getExecutableForCommand and ensureUpToDate#4863sigurdm wants to merge 1 commit into
sigurdm wants to merge 1 commit into
Conversation
sigurdm
force-pushed
the
fix-61950
branch
7 times, most recently
from
August 17, 2026 12:35
f8729c3 to
bd826da
Compare
|
Gemini thinks this fixes half the linked issue but not the other half: PR #4863 #4863 fixes running executables from sub-directories (cd lib && dart run ...), but does not address workspace resolution invalidation. In build_command_define_test.dart:140-178:
|
Contributor
Author
|
Thanks @davidmorgan! Good catch —
Both checks have been added along with a unit test ( |
jonasfj
reviewed
Aug 18, 2026
…mmand and ensureUpToDate Fixes sub-directory executable resolution when resolution is out of date or executable snapshot compilation is needed. Relates to dart-lang/sdk#61950.
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.
Fixes sub-directory executable resolution and workspace member invalidation when resolution is out of date.
In commit a87b84d (Allow invoking
getExecutableForCommandeverywhere in workspace #4257, Dart 3.5.0),getExecutableForCommandwas updated to allow running commands from package subdirectories (cd lib && dart run ...). However, when invoked from a sub-directory without apubspec.yamlwhile resolution was out of date or snapshot compilation was required,Entrypointwas constructed withworkingDirpointing to the sub-directory. This caused relative path resolution against.dart_tool/package_config.jsonto be computed relative to the sub-directory, failing withCould not find a file named "pubspec.yaml" in ".../lib"._rootPackageDirhelper in bothisResolutionUpToDateandEntrypoint.ensureUpToDate.workspaceRootDirwhen constructingEntrypointingetExecutableForCommand.When new packages were added to a workspace without running
pub get:isLockFileUpToDateonly checkedroot.immediateDependencies, missing the immediate dependencies of other workspace packages (workspaceRoot.transitiveWorkspace).isPackagePathsMappingUpToDateWithLockfileonly verified that no extra mappings existed, missing when workspace packages were missing from.dart_tool/package_config.json.workspaceRoot.transitiveWorkspaceinisLockFileUpToDate, and ensures all packages inworkspaceRoot.transitiveWorkspaceexist inpackagePathsMapping.Fixes dart-lang/sdk#61950