rust-embedded / rust-embedded/heapless

Depending on platform-specific (arm_llsc) features from a library

Open
#516 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement question
Dominant language
Rust
Stars
2k
Forks
253
Avg merge
1d 2h
Merged PRs (30d)
1

Description

I can compile my application (thumbv7em-none-eabihf) directly against heapless and it works fine.
But in this case I have a library (e.g. device driver) that depends on heapless and it won't detect the arm_llsc platform correctly.

As a workaround I have copied build.rs into my library. This does work but feels a bit hacky.
Is there a cleaner way for a library to depend on features like heapless::pool that require a specific platform such as arm_llsc ?Maybe the arm_llsc detection can be exposed as a helper or separate crate? Or via some feature flag?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading build.rs and reproducing the dependency behavior for thumbv7em-none-eabihf, then trace how arm_llsc and heapless::pool are detected when heapless is used through another library. Compare the proposed helper, separate-crate, and feature-flag approaches; done means the supported mechanism is defined and verified for the reported target.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.