Skip to content

Draft: Strongly type chroot suffix

Caleb Connolly requested to merge caleb/typed-suffix into caleb/mypy-coverage

Introduce a new module: pmb.core to contain explicitly typed pmbootstrap API. The first component being Suffix and SuffixType. This explicitly defines what suffixes are possible, future changes should aim to further constrain this API (e.g. by validating against available device codenames or architectures for buildroot suffixes).

This patch also converts the codebase to use the new Suffix type, I tested "pmbootstrap install" for the SHIFt6mq, as well as qemu-amd64, I also validated "pmbootstrap flasher boot" for the SHIFT6mq.

The general idea here is to encapsulate common patterns into type hinted code, and gradually reduce the amount of assumptions made around the codebase so that future changes are easier to implement.

Subtasks

  • convert over codebase and get things running again
  • convert over existing tests
  • validate additional codepaths
  • rebase on #2328
Edited by Caleb Connolly

Merge request reports