-
Notifications
You must be signed in to change notification settings - Fork 201
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
Use package metadata #509
base: feature/ci-cd-dev
Are you sure you want to change the base?
Use package metadata #509
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
### Adding a new BSP/PAC | ||
|
||
The build and release workflows will automatically recognize any new crate added to the repo, | ||
but you will need to add some metadata to the crates's `Cargo.toml`. | ||
|
||
|
||
```toml | ||
# example of metadata for a BSP | ||
[package.metadata.atsamd] | ||
# also_build (optional): indicate if any additional crates (HAL | PAC | BSP's) should be built | ||
# to properly test this crate | ||
# also_build = ["crate", "crate2"] | ||
|
||
[package.metadata.atsamd.bsp] | ||
|
||
# tier (required) | ||
# see: https://github.com/atsamd-rs/atsamd#how-to-use-a-bsp-ie-getting-started-writing-your-own-code | ||
# for determining what tier your BSP is | ||
tier = 2 | ||
|
||
# build_command (required) | ||
# used to invoke the appropriate build command for the bsp | ||
build_command = "cargo build --examples --features=unproven" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering what you think about this defaulting to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking of that also as I wrote these up. |
||
|
||
[package.metadata.atsamd.pac] | ||
# target (required): the build target, used to configure the runner properly | ||
target = "thumbv6m-none-eabi" | ||
# features to build the pac with | ||
features = ["samd21g", "unproven", "usb"] | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cargo tree
can figure out dependencies, I wonder if we can hook into that functionality to automatically figure out what else to build...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but we don't want to build all dependencies, The whole point of all this is to decouple dependencies and use semver to indicate compatibility so that if you're using a BSP, you'll get a compatible version of PAC/HAL.
This should really be used sparingly. Right now, it's an escape hatch for anything that has to fail release if a dependent package fails to build.
I should probably add documentation to that effect actually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah adding docs along those lines would help explain what this is doing. also this would be mostly applicable to
tier 2
BSPs then, right? Mentioning that generality might be good tooThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure generally this would apply mostly to tier 2. I think I'm missing the implication about tier 1. Are you thinking that a tier 1 BSP would automatically build other crates?
The build matrix in my head ATM is this: if the change is to a...
the
also_build
would be added to the outcome of that.