axodotdev / cargo-dist

📦 shippable application packaging
https://axodotdev.github.io/cargo-dist/
Apache License 2.0
1.31k stars 56 forks source link

feat: shared workspaces #1145

Open Gankra opened 2 weeks ago

Gankra commented 2 weeks ago

This introduces a new axoproject WorkspaceGraph abstraction that exists to replace the old Workspaces approach. The purpose of this new abstraction is that it supports nested workspaces, while still allowing you to work with all the packages uniformly.

Most code largely remains the same, as it looks up properties of packages by id, or queries a property of all workspaces/packages, where essentially nothing is changed.

Also all logic to inherit config from workspaces to packages is just changed to inherit from the root package, as we don't want to support multiple [workspace.metadata.dist] entries.

compute_build functions have been changed to take a workspace, so that we try to compute N cargo builds for N cargo workspaces (discarding them if unecessary).

The URL code has once again been refactored to be more of a chain instead of redoing the same work over and over.

The package_info subfield of a workspace has been deprecated in favour of Asking the WorkspaceGraph, as there are different tiers of childhood now.

Gankra commented 2 weeks ago

This builds and passes tests locally, but there are several outstanding TODOs, and this isn't really tested until we change the gallery.