Skip to content

Switched probe-rs to be resolved as a bazel host side executable and not a part of target resolution#8

Open
ngraf3255 wants to merge 3 commits intohexdae:mainfrom
ngraf3255:resolve-probe-rs-as-host-executable
Open

Switched probe-rs to be resolved as a bazel host side executable and not a part of target resolution#8
ngraf3255 wants to merge 3 commits intohexdae:mainfrom
ngraf3255:resolve-probe-rs-as-host-executable

Conversation

@ngraf3255
Copy link
Copy Markdown

@ngraf3255 ngraf3255 commented Mar 25, 2026

Fixes issue where flash rules are not compatible with @platforms//os:none due to requiring a host to run probe-rs. Reason for this change is as follows:

I have networking library dependency used in an embedded firmware release. This library builds for both POSIX platforms and for smoltcp based embedded networking. To do so, it uses the @platforms//os platform to configure the build. Due to the probe-rs ruleset being a native_binary it requires a host to run on.

Realisically the ELF should be built for the embedded target (and be selectable with the --platforms key), while probe-rs should be selected for the host. The following steps were done to acomplish this:

  • Adds a new executable rule in probe_rs/private/run.bzl
  • Resolves probe-rs as something for bazel to execute and not produce
  • Wraps the probe-rs executable in a small script for platform compatibility
  • This should keep the existing probe_rs.run(name, elf, chip, args=...) API the same in probe_rs/defs.bzl

@ngraf3255 ngraf3255 closed this Mar 25, 2026
@ngraf3255 ngraf3255 reopened this Mar 25, 2026
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.

1 participant