Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce plugin platform #242

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Introduce plugin platform #242

merged 1 commit into from
Nov 18, 2024

Conversation

fredszaq
Copy link
Collaborator

This adds a new platform manager to dinghy, that can be used to dynamically configure devices and platforms.

This platform manager will auto-detect any executable in the PATH that starts with cargo-dinghy- and try to use them as a plugin to provide devices and platforms.

To be a valid plugin, an executable must implement the following subcommands:

  • devices: must output a TOML file conforming to the DevicePluginOutput struct
  • platforms: must output a TOML file confirming to a BTreeMap<String, PlatformConfiguration>

Here is example of output for a cargo-dinghy-foo plugin configuring a bar device and a baz platform:

$ cargo-dinghy-foo devices
[ssh_devices.bar]
hostname = "127.0.0.1"
username = "user"

$ cargo-dinghy-foo platforms
[baz]
rustc_triple = "aarch64-unknown-linux-gnu"
toolchain = "/path/to/toolchain"

This is quite useful if you have a bench of devices and platforms that can be auto-detected or are already configured in another tool.

This adds a new platform manager to dinghy, that can be used to dynamically configure devices and platforms.

This platform manager will auto-detect any executable in the PATH that starts with
`cargo-dinghy-` and try to use them as a plugin to provide devices and platforms.

To be a valid plugin, an executable must implement the following subcommands:
- `devices`: must output a TOML file conforming to the `DevicePluginOutput` struct
- `platforms`: must output a TOML file confirming to a `BTreeMap<String, PlatformConfiguration>`

Here is example of output for a `cargo-dinghy-foo` plugin configuring a `bar` device and a `baz`
platform:

```no_compile
$ cargo-dinghy-foo devices
[ssh_devices.bar]
hostname = "127.0.0.1"
username = "user"

$ cargo-dinghy-foo platforms
[baz]
rustc_triple = "aarch64-unknown-linux-gnu"
toolchain = "/path/to/toolchain"
```

This is quite useful if you have a bench of devices and platforms that can be auto-detected
or are already configured in another tool.
@kali kali merged commit d3e1ba8 into main Nov 18, 2024
6 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants