Expand description
PM.6: the source resolver — a declared source becomes something the build service can consume.
Design: plugin-manager.md
§4. Three source kinds, and one of them deliberately does not end in
a build:
PluginSource::Local— the directory is the source tree. Built in place; the tree is never copied.PluginSource::Git— cloned/fetched into a source cache and checked out atrev, then built likeLocal.PluginSource::Prebuilt— a ready.wasmdownloaded straight into the user root. No build, no toolchain (§7), which is the whole point of the kind: it is how a user on a machine with no Rust installs a plugin at all.
So resolve returns Resolved, not a path: “where is the
source” and “here is the artifact, skip the build” are different
answers and collapsing them would force Prebuilt to invent a
source tree it does not have.
§Why git is a subprocess
gix is already in the workspace, but only with read-only features
— lattice-vcs inspects repositories, it does not clone them.
Turning on blocking-network-client would pull TLS and a network
stack into a crate that has neither, to replace a binary every
developer running a Git plugin source already has. It is also the
same bargain the build service already strikes with cargo: you
have the toolchain for the source kind you asked for.
Everything here blocks. Callers run it on spawn_blocking.
Structs§
- Http
Fetcher - The real fetcher.
- System
Git - The real runner.
Enums§
- Plugin
Source - Where a plugin comes from (mirrors the
plugin-sourceWIT variant PM.7 exposes toinit.rs). - Refresh
Policy - Whether a source that is already in the cache may be advanced from the network.
- Resolved
- What a source resolved to.
Traits§
- Fetcher
- Downloads a URL to a file.
- GitRunner
- Runs git. Behind a trait so the resolver’s cache/checkout logic is testable against a fake, and against a real local repository, with no network.
Functions§
- git_
cache_ dir - The source-cache directory for
name’s git checkout. - resolve
- Resolve
sourcefor the plugin calledname.