mcu: fix extraCargoBuildArgs skipped on Stabilizer variants, & simplify optional args #61

Merged
sb10q merged 2 commits from harry/nix-scripts:fix-mcu into master 2021-07-20 18:50:58 +08:00

This PR fixes a bug where the extraCargoBuildArgs specified by the Stabilizer variants is not passed to the function call of buildStm32Firmware. This is done using the UPDATE (//) operator.

The second part of this PR also simplifies the optional arguments, binaryName and extraCargoBuildArgs, of buildStm32Firmware. As a result, variadic arguments are no longer used by the function, which also means errors will now be raised from unexpected arguments. Key changes:

  • binaryName now defaults to the package name, and must be used as the Cargo binary name when running cargo build. Before the introduction of multiple binaries for the same Cargo package, the package name is used by Cargo to name the output binary file anyway.
  • extraCargoBuildArgs defaults to simply the empty string.
This PR fixes a bug where the `extraCargoBuildArgs` specified by the Stabilizer variants is not passed to the function call of `buildStm32Firmware`. This is done using the `UPDATE` (`//`) operator. The second part of this PR also simplifies the optional arguments, `binaryName` and `extraCargoBuildArgs`, of `buildStm32Firmware`. As a result, variadic arguments are no longer used by the function, which also means errors will now be raised from unexpected arguments. Key changes: * `binaryName` now defaults to the package name, and must be used as the Cargo binary name when running `cargo build`. Before the introduction of multiple binaries for the same Cargo package, the package name is used by Cargo to name the output binary file anyway. * `extraCargoBuildArgs` defaults to simply the empty string.
harry added 2 commits 2021-07-20 16:59:15 +08:00
64bc97bf2a mcu: simplify buildStm32Firmware
* binaryName and extraCargoBuildArgs are no longer variadic.
* `cargo build` simply always uses binaryName (defaults to the package name) as `--bin` argument.
sb10q merged commit 988d411946 into master 2021-07-20 18:50:58 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nix-scripts#61
There is no content yet.