Skip to content

Do some validation of packages in the system cache #5939

@munificent

Description

@munificent

Previously, there was an issue where pub could end up with an empty directory in the system cache. That would lead it to think the package had been successfully cached but was empty, which caused those "doesn't have a pubspec.yaml" errors people were/are seeing.

The root cause of that bug has been fixed, but:

  1. Some people may still have existing broken system caches from before this fix.
  2. There may be other unknown ways that a package could broken in your cache.

Given that, it might be good to do some validation of packages in the cache at pub install/update time. If the package isn't valid, we'll blow it away and install it again. Trivial validation would be if the directory is empty, it's bad, but we could possibly do more than that.

I still think prevention is better than a cure, and we should be in better shape for that now that pub downloads packages to a temp directory, but this is worth keeping in mind if we see other issues here.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions