Skip to content

feat!: Add partial support for armv7-unknown-linux-gnueabihf - #253

Merged
apljungquist merged 4 commits into
mainfrom
cargo-targets
Aug 10, 2026
Merged

feat!: Add partial support for armv7-unknown-linux-gnueabihf#253
apljungquist merged 4 commits into
mainfrom
cargo-targets

Conversation

@apljungquist

Copy link
Copy Markdown
Collaborator

That the build tools force the user to compile for thumbv7neon when armv7 would also work has bothered me for a while, but it has not been a problem before #251 where building for armv7 would probably have been a quick workaround. This commit makes it possible to build for armv7 using cargo-acap-build.

Details

crates/acap-build/src/lib.rs:

  • Allowed targets are still modelled as a closed set because to make sure all inputs map to a package architecture correctly and that the CLI documents and fails early where such a mapping is not implemented.
  • The default target remains thumbv7neon because it is not incorrect and whatever the reasons for choosing that as our preferred target were I don't think they have meaningfully changed.

crates/cargo-acap-build/src/main.rs:

  • Continue accepting the architecture nicknames as arguments because they are easier to remember and type than the full cargo target triple.
  • Use the --target option for the target triple to make the interface familiar to rust programmers; --arch does to my knowledge not collide with any upstream options.

crates/cargo-acap-sdk/src/main.rs:

  • Rename --target to --arch to align with cargo and cargo-acap-build.
  • From<ArchAbi> for Target is not implemented because it would implie a one-to-one mapping which does not exist.

crates/cargo-acap-build/src/main.rs,
crates/cargo-acap-sdk/src/main.rs:

  • Use the shortened "arch" instead of "architecture" because the latter is a lot to type.

That the build tools force the user to compile for `thumbv7neon` when `armv7` would also work has bothered me for a while, but it has not been a problem before #251 where building for `armv7` would probably have been a quick workaround. This commit makes it possible to build for `armv7` using `cargo-acap-build`.

Details
=======

`crates/acap-build/src/lib.rs`:
- Allowed targets are still modelled as a closed set because to make sure all inputs map to a package architecture correctly and that the CLI documents and fails early where such a mapping is not implemented.
- The default target remains `thumbv7neon` because it is not incorrect and whatever the reasons for choosing that as our preferred target were I don't think they have meaningfully changed.

`crates/cargo-acap-build/src/main.rs`:
- Continue accepting the architecture nicknames as arguments because they are easier to remember and type than the full cargo target triple.
- Use the `--target` option for the target triple to make the interface familiar to rust programmers; `--arch` does to my knowledge not collide with any upstream options.

`crates/cargo-acap-sdk/src/main.rs`:
- Rename `--target` to `--arch` to align with `cargo` and `cargo-acap-build`.
- `From<ArchAbi> for Target` is not implemented because it would implie a one-to-one mapping which does not exist.

`crates/cargo-acap-build/src/main.rs`,
`crates/cargo-acap-sdk/src/main.rs`:
- Use the shortened "arch" instead of "architecture" because the latter is a lot to type.
@apljungquist
apljungquist requested a review from guoxe August 7, 2026 06:00

@guoxe guoxe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I think this is a good idea, can't hurt to allow armv7 as well.
IIRC the original reason for picking thumb as a default is because the instructions are smaller which should result in smaller binaries.

Comment thread .devcontainer/Dockerfile
Comment thread crates/cargo-acap-build/src/cargo_acap.rs Outdated
Comment thread crates/cargo-acap-build/src/lib.rs Outdated
Comment thread Makefile
@apljungquist
apljungquist marked this pull request as ready for review August 8, 2026 06:16
@apljungquist
apljungquist requested a review from a team as a code owner August 8, 2026 06:16
Comment thread Makefile
@apljungquist
apljungquist merged commit b2981a5 into main Aug 10, 2026
5 checks passed
@apljungquist
apljungquist deleted the cargo-targets branch August 10, 2026 09:16
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