apache / apache/buildstream-plugins

cargo: Generate a Cargo.lock if one wasn't found

Ouverte
#44 20 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
8
Forks
16
Merge moyen
36 min
PR mergées (30 j)
2

Description

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
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par lire le plugin cargo existant et la spécification liée pour issue 42. Suivez les flux track, fetch et stage, puis vérifiez les modes de generate_lock, le comportement par défaut et le cas d’erreur décrits ici ; le travail est terminé lorsque la génération de Cargo.lock et la reconstruction des dépendances suivent les règles indiquées.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python, rust
Domaine
build-system
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.