Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler): Clarify Finished message #13422

Merged
merged 3 commits into from
Feb 9, 2024
Merged

Conversation

epage
Copy link
Contributor

@epage epage commented Feb 8, 2024

What does this PR try to resolve?

As highlighted on zulip, many users think "Rust is slow" because of the dev profile.

While a perfect solution is still being worked out, this attempts what will hopefully be smaller, incremental step that hopefully maintains balance of the different needs.

We are changing the message from:

Finished dev [unoptimized + debuginfo] target(s) in [..]s

to

Finished `dev` profile [unoptimized + debuginfo] target(s) in [..]s

where dev profile is a link to the Cargo book.

The intent is

  • Clarify what dev even means
    • Add profile to give it context
    • Quote it to highlight this is something mutable
  • Make the profile content stand out on hover by being a link
  • Help people learn more by following the link

For now, this leaves the profile description alone.

Part of #9446

How should we test and review this PR?

Additional information

@rustbot
Copy link
Collaborator

rustbot commented Feb 8, 2024

r? @ehuss

rustbot has assigned @ehuss.
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

@epage epage marked this pull request as draft February 8, 2024 20:14
@rustbot rustbot added A-build-execution Area: anything dealing with executing the compiler S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 8, 2024
let message = format!(
"{} [{}] target(s) in {}",
profile_name, opt_type, time_elapsed
"{}`{profile_name}` profile{} [{opt_type}] target(s) in {time_elapsed}",
Copy link
Member

Choose a reason for hiding this comment

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

Not on topic, but we might way to make Hyperlink fancier like anstyle for open/close.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had considered that but didn't want to include it in this PR

@epage epage marked this pull request as ready for review February 9, 2024 02:40
Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

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

I am good with this change. Not sure if we want a quick poll.

src/cargo/core/compiler/job_queue/mod.rs Outdated Show resolved Hide resolved
@epage epage force-pushed the profile branch 2 times, most recently from c0f2ee0 to 69f38a0 Compare February 9, 2024 03:30
@epage
Copy link
Contributor Author

epage commented Feb 9, 2024

I also changed the link to point directly to the built-in profile definitions so they can see what dev means and then browse further for what those fields mean.

@weihanglo
Copy link
Member

I also changed the link to point directly to the built-in profile definitions so they can see what dev means and then browse further for what those fields mean.

Sounds like we can make it smarter by linking to each profile?

@weihanglo
Copy link
Member

Anyway, this is a two-way door. Going to merge this.

@bors r+

@bors
Copy link
Collaborator

bors commented Feb 9, 2024

📌 Commit 69f38a0 has been approved by weihanglo

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 Feb 9, 2024
@bors
Copy link
Collaborator

bors commented Feb 9, 2024

⌛ Testing commit 69f38a0 with merge 6283793...

@bors
Copy link
Collaborator

bors commented Feb 9, 2024

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing 6283793 to master...

@bors bors merged commit 6283793 into rust-lang:master Feb 9, 2024
21 checks passed
@epage epage deleted the profile branch February 9, 2024 15:31
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2024
Update cargo

8 commits in ccc84ccec4b7340eb916aefda1cb3e2fe17d8e7b..fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3
2024-02-07 15:37:49 +0000 to 2024-02-09 15:54:29 +0000
- docs(changelog): Clarify lints in virtual workspace error (rust-lang/cargo#13425)
- fix(compiler): Clarify Finished message (rust-lang/cargo#13422)
- fix(test-support): remove special case for `$message_type` (rust-lang/cargo#13424)
- chore(deps): update msrv (1 version) to v1.76.0 (rust-lang/cargo#13420)
- chore(bump-check): include rustfix and cargo-util-schemas (rust-lang/cargo#13421)
- chore: update to `jobserver` 0.1.28 (rust-lang/cargo#13419)
- feat: Add hint for adding members to workspace (rust-lang/cargo#13411)
- fix: Don't duplicate comments when editing TOML (rust-lang/cargo#13402)

r? weihanglo
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2024
Update cargo

8 commits in ccc84ccec4b7340eb916aefda1cb3e2fe17d8e7b..fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3
2024-02-07 15:37:49 +0000 to 2024-02-09 15:54:29 +0000
- docs(changelog): Clarify lints in virtual workspace error (rust-lang/cargo#13425)
- fix(compiler): Clarify Finished message (rust-lang/cargo#13422)
- fix(test-support): remove special case for `$message_type` (rust-lang/cargo#13424)
- chore(deps): update msrv (1 version) to v1.76.0 (rust-lang/cargo#13420)
- chore(bump-check): include rustfix and cargo-util-schemas (rust-lang/cargo#13421)
- chore: update to `jobserver` 0.1.28 (rust-lang/cargo#13419)
- feat: Add hint for adding members to workspace (rust-lang/cargo#13411)
- fix: Don't duplicate comments when editing TOML (rust-lang/cargo#13402)

r? weihanglo
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2024
Update cargo

8 commits in ccc84ccec4b7340eb916aefda1cb3e2fe17d8e7b..fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3
2024-02-07 15:37:49 +0000 to 2024-02-09 15:54:29 +0000
- docs(changelog): Clarify lints in virtual workspace error (rust-lang/cargo#13425)
- fix(compiler): Clarify Finished message (rust-lang/cargo#13422)
- fix(test-support): remove special case for `$message_type` (rust-lang/cargo#13424)
- chore(deps): update msrv (1 version) to v1.76.0 (rust-lang/cargo#13420)
- chore(bump-check): include rustfix and cargo-util-schemas (rust-lang/cargo#13421)
- chore: update to `jobserver` 0.1.28 (rust-lang/cargo#13419)
- feat: Add hint for adding members to workspace (rust-lang/cargo#13411)
- fix: Don't duplicate comments when editing TOML (rust-lang/cargo#13402)

r? weihanglo
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 13, 2024
Update cargo

8 commits in ccc84ccec4b7340eb916aefda1cb3e2fe17d8e7b..fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3
2024-02-07 15:37:49 +0000 to 2024-02-09 15:54:29 +0000
- docs(changelog): Clarify lints in virtual workspace error (rust-lang/cargo#13425)
- fix(compiler): Clarify Finished message (rust-lang/cargo#13422)
- fix(test-support): remove special case for `$message_type` (rust-lang/cargo#13424)
- chore(deps): update msrv (1 version) to v1.76.0 (rust-lang/cargo#13420)
- chore(bump-check): include rustfix and cargo-util-schemas (rust-lang/cargo#13421)
- chore: update to `jobserver` 0.1.28 (rust-lang/cargo#13419)
- feat: Add hint for adding members to workspace (rust-lang/cargo#13411)
- fix: Don't duplicate comments when editing TOML (rust-lang/cargo#13402)

r? weihanglo
@rustbot rustbot added this to the 1.78.0 milestone Feb 13, 2024
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Feb 14, 2024
Update cargo

8 commits in ccc84ccec4b7340eb916aefda1cb3e2fe17d8e7b..fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3
2024-02-07 15:37:49 +0000 to 2024-02-09 15:54:29 +0000
- docs(changelog): Clarify lints in virtual workspace error (rust-lang/cargo#13425)
- fix(compiler): Clarify Finished message (rust-lang/cargo#13422)
- fix(test-support): remove special case for `$message_type` (rust-lang/cargo#13424)
- chore(deps): update msrv (1 version) to v1.76.0 (rust-lang/cargo#13420)
- chore(bump-check): include rustfix and cargo-util-schemas (rust-lang/cargo#13421)
- chore: update to `jobserver` 0.1.28 (rust-lang/cargo#13419)
- feat: Add hint for adding members to workspace (rust-lang/cargo#13411)
- fix: Don't duplicate comments when editing TOML (rust-lang/cargo#13402)

r? weihanglo
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Apr 7, 2024
Update cargo

8 commits in ccc84ccec4b7340eb916aefda1cb3e2fe17d8e7b..fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3
2024-02-07 15:37:49 +0000 to 2024-02-09 15:54:29 +0000
- docs(changelog): Clarify lints in virtual workspace error (rust-lang/cargo#13425)
- fix(compiler): Clarify Finished message (rust-lang/cargo#13422)
- fix(test-support): remove special case for `$message_type` (rust-lang/cargo#13424)
- chore(deps): update msrv (1 version) to v1.76.0 (rust-lang/cargo#13420)
- chore(bump-check): include rustfix and cargo-util-schemas (rust-lang/cargo#13421)
- chore: update to `jobserver` 0.1.28 (rust-lang/cargo#13419)
- feat: Add hint for adding members to workspace (rust-lang/cargo#13411)
- fix: Don't duplicate comments when editing TOML (rust-lang/cargo#13402)

r? weihanglo
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
Update cargo

8 commits in ccc84ccec4b7340eb916aefda1cb3e2fe17d8e7b..fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3
2024-02-07 15:37:49 +0000 to 2024-02-09 15:54:29 +0000
- docs(changelog): Clarify lints in virtual workspace error (rust-lang/cargo#13425)
- fix(compiler): Clarify Finished message (rust-lang/cargo#13422)
- fix(test-support): remove special case for `$message_type` (rust-lang/cargo#13424)
- chore(deps): update msrv (1 version) to v1.76.0 (rust-lang/cargo#13420)
- chore(bump-check): include rustfix and cargo-util-schemas (rust-lang/cargo#13421)
- chore: update to `jobserver` 0.1.28 (rust-lang/cargo#13419)
- feat: Add hint for adding members to workspace (rust-lang/cargo#13411)
- fix: Don't duplicate comments when editing TOML (rust-lang/cargo#13402)

r? weihanglo
@bend-n
Copy link

bend-n commented May 7, 2024

I dont like this change-- its rather annoying, and not very useful.
Im pretty sure a total of two people have clicked on the link intentionally (not to mention low terminal support for non XTerm feature), and the people who click on it intentionally are simply annoyed, as theres no need for this guide. Also, the pr description says that ​dev profile is a link, but the entirety of dev profile [unoptimized + debuginfo] is a link.

bend-n added a commit to bend-n/cargo that referenced this pull request May 7, 2024
bend-n added a commit to bend-n/cargo that referenced this pull request May 7, 2024
bend-n added a commit to bend-n/cargo that referenced this pull request May 7, 2024
bend-n added a commit to bend-n/cargo that referenced this pull request May 7, 2024
bend-n added a commit to bend-n/cargo that referenced this pull request May 7, 2024
bend-n added a commit to bend-n/cargo that referenced this pull request May 7, 2024
@bend-n bend-n mentioned this pull request May 7, 2024
@epage
Copy link
Contributor Author

epage commented May 7, 2024

@bend-n could you clarify why you find this change to be annoying? We expect to be adding a lot more links to Cargo and Rustc's outputto better connect the commands to their documentation.

as theres no need for this guide

This runs a bit counter to our experience talking to users as we found they didn't know what dev meant. Granted, also clarified it is a "profile" which also helps.

@bend-n
Copy link

bend-n commented May 7, 2024

its disruptive, as you can accidentally click on it, and in certain terminals has pop ups that are annoying. however, i have since solved my problems:

set -x FORCE_HYPERLINK 0

@epage
Copy link
Contributor Author

epage commented May 7, 2024

Note that FORCE_HYPERLINK is not officially support and is a side effect of the implementation.

You should probably be using CARGO_TERM_HYPERLINKS=false

@bend-n
Copy link

bend-n commented May 7, 2024

oh, thats cool. thanks!

though, oddly, setting it in ~/.config/cargo.toml doesnt work? huh.

@epage
Copy link
Contributor Author

epage commented May 7, 2024

You set

[term]
hyperlinks = false

and it didn't work?

@workingjubilee
Copy link

Would this be improved by shrinking the range of the hyperlink?

@epage
Copy link
Contributor Author

epage commented May 7, 2024

The point of the range of the hyperlink was to cover everything profile related. The most likely alternative (what I wish I had done but hadn't felt motivated enough to implement after the PR) was to link directly to the documentation for the referenced fields, instead of one monolithic link.

Again, as I said, this also isn't expected to be isolated. Both Cargo and Rustc are looking to take advantage of more links in the output to help bridge the tool / documentation divide. Shrinking in a one off case will have little impact if we have a lot more links. Its more of needing to decide if the general vision for links needs to be adjusted and, if so, to what.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-execution Area: anything dealing with executing the compiler 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.

None yet

7 participants