-
Notifications
You must be signed in to change notification settings - Fork 37
Use cargo-make to build the packages #55
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 cargo-make to build the packages #55
Conversation
Thanks! This is pretty cool :)
|
And can I apply the profile options listed here only to the firmware workspace members? |
- run: cargo build -p ledmatrix --release | ||
- run: cargo build -p b1display --release | ||
- run: cargo build -p c1minimal --release | ||
- run: cargo make --cwd b1display |
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.
running cargo make
and then cargo make build-release
in the top level directory will also work, it will essentially run all the tasks you have listed out here, as well as a bunch more that are part of the default dev-test-flow task, but that can be customized; to, for instance, not run any tests. I would also definitely recommend looking through the all the rest of the pre-defined tasks in the link above, it provides a bunch of sane defaults that can be tweaked as necessary to support your use case, including things like building binaries for release, or CI workflows.
In general, the default behavior when run you run cargo make
in a workspace root is to go down into each workspace member and run the task that was called.
It should be easy enough to customize the build tasks for each package to call the correct build profile by default, maybe place the non-firmware profiles behind names like
When you add a task in one of your makefiles it will only override the fields you provide overrides for by default so everything else about the Note all of this is off the cuff and untested for now, I don't have access to my dev machine at this exact moment EDIT: I also came across |
Running commands should also be fairly trivial, just add something to the effect of
in the inputmodule-control Makefile. You should then be able to run |
Signed-off-by: Daniel Schaefer <[email protected]>
Signed-off-by: Daniel Schaefer <[email protected]>
Signed-off-by: Daniel Schaefer <[email protected]>
inputmodule-control/Makefile.toml
Outdated
extend = "../Makefile.toml" | ||
|
||
[env] | ||
TARGET_TRIPLE = "x86_64-unknown-linux-gnu" |
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.
TARGET_TRIPLE = "x86_64-unknown-linux-gnu" | |
TARGET_TRIPLE = "${CARGO_MAKE_RUST_TARGET_TRIPLE}" |
Awesome, this works!
Signed-off-by: Daniel Schaefer <[email protected]>
Signed-off-by: Daniel Schaefer <[email protected]>
70f651a
to
c3e134f
Compare
Signed-off-by: Daniel Schaefer <[email protected]>
Make sure it works without cargo-make Signed-off-by: Daniel Schaefer <[email protected]>
And avoid building unnecessarily. Signed-off-by: Daniel Schaefer <[email protected]>
Signed-off-by: Daniel Schaefer <[email protected]>
Okay, I'm happy with it, thanks a lot @jscatena88! |
Cheers! I'm glad it was helpful |
As mentioned in #33, here is a first pass at
cargo make
integration, Runningcargo make
in the workspace root will build every package with the appropriate target (it will also run rustfmt by default).cargo make
can also be run in individual packages to build just that package. This only scratches the surface of what the tool can do(e.g. it can also be used to install dependencies likeflip-link
, it can be used as part of your CI, etc. )You will need to install cargo make to make use of the changes.
I also added a a more understandable compiler error if someone attempts to build
fl16-inputmodules
with mutually exclusive features enabled.