Skip to content

fix(init): Use detected project kind in status message#16791

Open
cuiweixie wants to merge 2 commits intorust-lang:masterfrom
cuiweixie:fix/init-status-detected-kind
Open

fix(init): Use detected project kind in status message#16791
cuiweixie wants to merge 2 commits intorust-lang:masterfrom
cuiweixie:fix/init-status-detected-kind

Conversation

@cuiweixie
Copy link
Copy Markdown

What

When cargo init auto-detects the project kind, the shell status line previously printed the kind from CLI options (opts.kind) instead of the resolved kind after detection.

Change

Use the computed kind in the Creating … package status so the message matches the package type actually being created.

Testing

  • cargo init in a directory where kind is auto-detected shows the correct kind in the status message.

When `cargo init` auto-detects the project kind, the shell status
previously showed the user-selected kind from options instead of the
resolved kind. Print the computed kind so the message matches the
actual package type being created.
@rustbot rustbot added Command-new S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 26, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 26, 2026

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage, weihanglo

@epage
Copy link
Copy Markdown
Contributor

epage commented Mar 26, 2026

Thanks!

If this didn't change an existing test, we'd expect a new test to be written. We've found it helpful to add the tests in a commit before the fix, reproducing the problem. We have notes on this in our contrib guide but I'm experimenting with a longer description at https://epage.github.io/dev/pr-style/#c-test

@arlosi
Copy link
Copy Markdown
Contributor

arlosi commented Mar 27, 2026

@cuiweixie it looks like this did impact existing tests. Could you run SNAPSHOTS=overwrite cargo test and update the commit to include the test changes?

[DOWNLOADING] crates ...
[DOWNLOADED] foo v0.0.1 (registry `dummy-registry`)
[INSTALLING] foo v0.0.1
[WARNING] default toolchain implicitly overridden with `1.94.0-[HOST_TARGET]` by rustup directory override
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.

You should not have directory override when running snapshots, run SNAPSHOTS=overwrite rustup run +1.94.0 cargo test --test testsuite and try again

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.

These toolchain warning snapshot shouldn't have been updated.

@rustbot rustbot added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 2, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 2, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Command-new S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants