-
Notifications
You must be signed in to change notification settings - Fork 229
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
Pub should clean up old .packages
files.
#4370
Comments
Hmm... we removed all support for .packages, including cleanup some versions ago. Maybe we should reinstate the cleanup... |
Not sure this has anything to do with workspaces. Either we clean .packages or we don't. Updating title |
.packages
files when removing package config files.packages
files.
It matters in the context of workspaces because when you migrate to them you get broken by the leftover |
No - leftover .packages anywhere in your project - workspaces or not - will confuse tools that still recognize them. I think it is rather rare that you migrate from such an old dart sdk that it creates .packages files, and at the same time add workspaces. That said, I'm not against the idea - I see no reason old .packages files should stay around. |
The canonical logic (as implemented in package:package_config) will always prefer a In my case my |
(although, fwiw I did file an issue on package:package_config to stop looking for |
Yeah, I agree! |
Feel free to voice your support on dart-lang/package_config#158 haha. |
Related to dart-lang/package_config#158
I recently ran into an issue when trying the new formatter in a workspace repo. All packages were being parsed with language version 2.7, which was highly confusing. It turns out, there were old
.packages
files in all the sub-packages, which no longer had a.dart_tool/package_config.json
file (it was now one directory up). The presence of these.packages
files alone caused a fallback behavior where every package is set to language version 2.7, and they fail to parse new syntax.I think we should both fix the issue in package_config (so it doesn't support these files at all), as well as have pub clean up any old
.packages
files it finds - at least when it goes through deleting the.dart_tool/package_config.json
files, but maybe just more generally.The text was updated successfully, but these errors were encountered: