Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the ensureUptodate procedure to handle workspaces #4239

Closed
Tracked by #4127
sigurdm opened this issue Apr 25, 2024 · 2 comments · Fixed by #4257
Closed
Tracked by #4127

Update the ensureUptodate procedure to handle workspaces #4239

sigurdm opened this issue Apr 25, 2024 · 2 comments · Fixed by #4257
Labels
type-enhancement A request for a change that isn't a bug

Comments

@sigurdm
Copy link
Contributor

sigurdm commented Apr 25, 2024

We want:

  • Should be invokable in any directory. The relevant enclosing directory with a package config should be found.
  • a fast-path for dart run that does not have to parse yaml.
  • Only .dart_tool/package_config.json should be parsed, and relevant timestamps compared.
  • If .dart_tool/package_config.json could not be found, or time-stamps mismatch we do a full resolution.
  • A stray package config above the workspaceroot pubspec.yaml should not be used.

The procedure for the fast path would be like:

We then for each parent directory p of current directory (including it):

  • If p is the file system root: use an empty package config.
  • look for $p/.dart_tool/package_config.json. If that exists check if it is up-to-date. (this allows a stand-alone package config).
  • look for $p/pubspec.yaml:
    • If that exists: look for $p/.dart_tool/pub/workspace_ref.json.
      • If that exists: check if the .dart_tool/package_config.json relative to its "workspaceRoot" is up-to-date.
      • Otherwise: do full resolution
    • Otherwise continue to next parent directory.
@sigurdm
Copy link
Contributor Author

sigurdm commented Apr 25, 2024

First steps were taken in #4153

@sigurdm
Copy link
Contributor Author

sigurdm commented Apr 25, 2024

Related to dart-lang/sdk#55548

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant