Skip to content

docs: clarify dash replacement rule in target name#13887

Merged
bors merged 2 commits into
rust-lang:masterfrom
weihanglo:message
May 8, 2024
Merged

docs: clarify dash replacement rule in target name#13887
bors merged 2 commits into
rust-lang:masterfrom
weihanglo:message

Conversation

@weihanglo

Copy link
Copy Markdown
Member

What does this PR try to resolve?

A follow-up of #13867 and #13882.

This clarifies that dashes will be replaced in every JSON messages documentation we have.
Also fixes a documentation bug that Cargo in fact doesn't replace dashes for the default binary (src/main.rs).

How should we test and review this PR?

Read the doc and suggest changes.

Additional information

@rustbot

rustbot commented May 8, 2024

Copy link
Copy Markdown
Collaborator

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-cli-help Area: built-in command-line help A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 8, 2024

@Muscraft Muscraft left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@Muscraft

Muscraft commented May 8, 2024

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented May 8, 2024

Copy link
Copy Markdown
Contributor

📌 Commit 4b3123e has been approved by Muscraft

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 8, 2024
@bors

bors commented May 8, 2024

Copy link
Copy Markdown
Contributor

⌛ Testing commit 4b3123e with merge 91a6b8f...

@bors

bors commented May 8, 2024

Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-actions
Approved by: Muscraft
Pushing 91a6b8f to master...

@bors bors merged commit 91a6b8f into rust-lang:master May 8, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 11, 2024
Update cargo

7 commits in 0ca60e940821c311c9b25a6423b59ccdbcea218f..4de0094ac78743d2c8ff682489e35c8a7cafe8e4
2024-05-08 01:54:25 +0000 to 2024-05-09 16:09:22 +0000
- Fix docs for unstable script feature (rust-lang/cargo#13893)
- Refactor cargo lint tests (rust-lang/cargo#13880)
- test(rustfix): run some tests only on nightly (rust-lang/cargo#13890)
- Old syntax suggestion (rust-lang/cargo#13874)
- docs: clarify dash replacement rule in target name (rust-lang/cargo#13887)
- Add local-only build scripts example in check-cfg docs (rust-lang/cargo#13884)
- docs(changelog): also mention `--message-format=json` (rust-lang/cargo#13882)

r? ghost
@rustbot rustbot added this to the 1.80.0 milestone May 11, 2024
@Turbo87

Turbo87 commented Jun 19, 2024

Copy link
Copy Markdown
Member

Also fixes a documentation bug that Cargo in fact doesn't replace dashes for the default binary (src/main.rs).

lol, I was just about to open a PR for fixing that in the docs and then I discovered it's already fixed on master 😆

@weihanglo weihanglo deleted the message branch June 19, 2024 11:45
n-ramacciotti added a commit to n-ramacciotti/svsm that referenced this pull request Jul 7, 2026
When specifying `--message-format=json-render-diagnostics`, Cargo produces
an output where potential '-' in target.name are converted in '_' for lib
crates. [1]

This seems to be the expected behavior. [2]

Update `find_test_executable` to account for that.

[1] rust-lang/cargo#13867
[2] rust-lang/cargo#13887

Signed-off-by: Nicola Ramacciotti <niko.ramak@gmail.com>
n-ramacciotti added a commit to n-ramacciotti/svsm that referenced this pull request Jul 8, 2026
When specifying `--message-format=json-render-diagnostics`, Cargo produces
an output where potential '-' in target.name are converted in '_' for lib
crates. [1]

This seems to be the expected behavior. [2]

Update `find_test_executable` to account for that.

Although not strictly necessary, as `bin` won't be produced during test in
svsm since they have `test=false`, introduce an `ArtifactKind` for all the
possible targets reported in the compiler message and update the guard to
check for the presence of the `lib` target, to improve robustness.

[1] rust-lang/cargo#13867
[2] rust-lang/cargo#13887

Suggested-by: Carlos López <clopez@suse.de>
Signed-off-by: Nicola Ramacciotti <niko.ramak@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli-help Area: built-in command-line help A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants