apache / apache/buildstream-plugins
cargo: Generate a Cargo.lock if one wasn't found
- Lingua principale
- Python
- Stelle
- 8
- Fork
- 16
- Merge medio
- 36m
- PR unite (30g)
- 2
Descrizione
Spec from https://gitlab.com/BuildStream/bst-plugins-experimental/-/issues/42
Will behave like this:
- `track`: Cargo.lock will be generated by the host's `cargo` IF `(generate_lock is true)` OR `(generate_lock is 'if-missing' and Cargo.lock doesn't exist)`. If generate_lock is false and Cargo.lock doesn't exist, raise an error. Then the existing logic for tracking cargo sources will happen. The ref will now encode everything necessary to reconstruct the vendored libraries, so the generated Cargo.lock is discarded
- `fetch`: The sources are fetched according to the ref, as they are now
- `stage`: The sources are staged according to the ref, as they are now
- Buildstream will default to `generate_lock: false`, and projects can (if they wish) globally override that default to `generate_lock: if-missing` to make the `cargo` plugin work in all scenarios. Then `generate_lock: true` can be used if Cargo.lock needs to be overwritten/ignored for whatever reason (i.e. a hypothetical repo that hasn't been updated in a while and Cargo.lock specifies dependencies w/ known security issues, so you want to force it to use newer libraries)
- If a project doesn't want to grow a dependency on `cargo` from the host to `track`, it can keep `generate_lock: false` as the default, and then maintain its own Cargo.lock files & stage them before the `cargo` source:
```yaml
sources:
- kind: git_tag
url: whatever:foobar.git
- kind: local
path: files/cargo/foobar/Cargo.lock
- kind: cargo
generate_lock: false # <-- from project defaults
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia leggendo il plugin cargo esistente e la specifica collegata per issue 42. Segui i flussi track, fetch e stage, quindi verifica le modalità generate_lock, il comportamento predefinito e il caso di errore descritti qui; il lavoro è completato quando la generazione di Cargo.lock e la ricostruzione delle dipendenze seguono le regole indicate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python, rust
- Ambito
- build-system
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100