oxidecomputer / oxidecomputer/usdt

Remove public feature flags

Open
#57 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
145
Forks
15
Avg merge
14m
Merged PRs (30d)
6

Description

The current implementation of usdt (v0.3.2) uses the public feature flag "asm" to decide what code to generate inside the probe macros. We initially did this for a few reasons. First, the Rust asm feature was required, and it's pretty common practice to gate nightly features in a crate with a public feature flag. Secondly, it was very useful for development to pick a real or no-op implementation of the probes.

The time has come to remove this feature flag, however. The asm feature has been stabilized. The asm_sym feature, required for macOS, is on the path to stabilization. More importantly, a feature flag for this doesn't make a whole lot of sense. First, the "real" version of the probes is the whole point of the crate, so turning them off seems silly. Second, feature flags are additive, which I didn't quite appreciate when I built it this way initially. This is a big problem, since it means it's possible for trouble when crate uses two other crates, both of which use usdt. If one enables the probes, it doesn't matter whether the other crate chose to enable them, the probes are there due to feature unification.

This issue tracks removing all public feature flags. The crate will choose the code to be generated in the probe macros solely on the basis of the target OS.

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 locating the crate's public feature definitions and the probe macros that currently use the asm flag. Trace how target OS selection is handled, then remove the public feature flags so generated probe code depends only on the target OS; the issue is done when no public feature flags remain.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.