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

Delete stray .dart_tool/package_config.json files between root and package dirs. #4445

Open
sigurdm opened this issue Nov 26, 2024 · 1 comment · May be fixed by #4446
Open

Delete stray .dart_tool/package_config.json files between root and package dirs. #4445

sigurdm opened this issue Nov 26, 2024 · 1 comment · May be fixed by #4446

Comments

@sigurdm
Copy link
Contributor

sigurdm commented Nov 26, 2024

In flutter/devtools#8211 the situation was something like this

  /
   packages/
     pubspec.yaml
     .dart_tool/package_config.json
     package_a/
        pubspec.yaml
        .dart_tool/package_config.json

And after migration to workspaces with a pubspec.yaml at the root it looks like this:

  /
    pubspec.yaml
   .dart_tool/package_config.json
   packages/
     .dart_tool/package_config.json # <---- stray file
     package_a/
        pubspec.yaml

The stray file causes imports in package_a to not resolve correctly.
It is hard to discover because it is in a hidden directory, and typically gitignored.

We are already deleting .dart_tool/package_config.json in the folders of the workspace packages

We should also delete any .dart_tool/package_config.json files in folders from the workspace package up to the root.

@sigurdm
Copy link
Contributor Author

sigurdm commented Nov 26, 2024

This is not breaking behavior - as these stray .package_config.json files would shadow the package-resolution, making things not work.

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 a pull request may close this issue.

1 participant