apache / apache/buildstream-plugins

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

Abierto
#44 20 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
8
Forks
16
Merge medio
36 min
PR fusionados (30 d)
2

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Empieza leyendo el plugin de cargo existente y la especificación enlazada para issue 42. Sigue los flujos de track, fetch y stage; después verifica los modos de generate_lock, el comportamiento predeterminado y el caso de error descritos aquí; el trabajo estará terminado cuando la generación de Cargo.lock y la reconstrucción de dependencias sigan las reglas indicadas.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python, rust
Área
build-system
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.