dlang / dub

Package and build management system for D
MIT License
678 stars 227 forks source link

Use a central build cache for all build artifacts #2542

Closed Geod24 closed 1 year ago

Geod24 commented 1 year ago
Currently the central build cache is not configurable, but as most build artifacts end up in `~/.dub/packages/` anyway, this will be a positive change for users.

This is essentially https://github.com/dlang/dub/pull/1650 without configurability, because there's a few things needed before we can make it configurable "nicely".

Fix https://github.com/dlang/dub/issues/1473 and would make adding a GC much easier (e.g. https://github.com/dlang/dub/issues/1256 and https://github.com/dlang/dub/issues/631).

Geod24 commented 1 year ago

This passes now. The scheme is a bit more complex to avoid name collision. subpackages are really a PITA.

Geod24 commented 1 year ago

Any opinion on the new format ?

Possible problem with this: two packages with the same name will end up in the same folder. That's something that we will have to solve, eventually.

We have $ROOT_PACKAGE_NAME/$PACKAGE_VERSION/$SUB_PACKAGE_NAME and not $ROOT_PACKAGE_NAME/$SUB_PACKAGE_NAME/$PACKAGE_VERSION because, while the latter is easier, the very definition of a subpackage is that it's a collection of independent packages tied to the same version.

Also, I used + before $SUB_PACKAGE_NAME to ensure that no one can introduce a subpackage name that conflicts with a version. Even if the name would be invalid (because . is currently allowed in package name), it would probably not be recognized.

Now I need to look into the metadata_cache and the code/ cache.

Geod24 commented 1 year ago

Metadata cache and code/ handled, we're G2G

Geod24 commented 1 year ago

Going to merge when it's green.