Skip to content

Don't crash when running cargo profdata --help#165

Merged
therealprof merged 1 commit intorust-embedded:masterfrom
jyn514:cli-parsing
Sep 26, 2025
Merged

Don't crash when running cargo profdata --help#165
therealprof merged 1 commit intorust-embedded:masterfrom
jyn514:cli-parsing

Conversation

@jyn514
Copy link
Copy Markdown
Contributor

@jyn514 jyn514 commented Sep 25, 2025

Previously, the cargo wrapper tried to access CLI flags that were only defined when needs_build was true. Omit the access for commands that don't need those flags.

Before:

thread 'main' (13996246) panicked at src/lib.rs:283:37:
Mismatch between definition and access of `features`. Unknown argument
or group id.  Make sure you are using the argument id and not the short
or long flags

After:

Proxy for the `llvm-profdata` tool shipped with the Rust toolchain.

Usage: cargo-profdata [OPTIONS] [-- <args>...]
...

@jyn514 jyn514 requested a review from a team as a code owner September 25, 2025 23:36
Previously, the cargo wrapper tried to access CLI flags that were only
defined when `needs_build` was true. Omit the access for commands that
don't need those flags.

Before:
```
thread 'main' (13996246) panicked at src/lib.rs:283:37:
Mismatch between definition and access of `features`. Unknown argument
or group id.  Make sure you are using the argument id and not the short
or long flags
```

After:
```
Proxy for the `llvm-profdata` tool shipped with the Rust toolchain.

Usage: cargo-profdata [OPTIONS] [-- <args>...]
...
```
Copy link
Copy Markdown
Contributor

@therealprof therealprof left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for catching this.

@therealprof therealprof added this pull request to the merge queue Sep 26, 2025
Merged via the queue into rust-embedded:master with commit ad48aa5 Sep 26, 2025
8 checks passed
@Emilgardis
Copy link
Copy Markdown
Member

I had this as #162 but I guess it was missed in the queue! No harm done :)

@Emilgardis Emilgardis linked an issue Sep 26, 2025 that may be closed by this pull request
@therealprof
Copy link
Copy Markdown
Contributor

@Emilgardis My apologies. Indeed I only happened to notice this PR in my massive GH inbox today.

@jyn514 jyn514 deleted the cli-parsing branch September 26, 2025 18:29
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.

panic with the published v0.4.0

3 participants