Skip to content

Conversation

@Shunpoco
Copy link
Contributor

@Shunpoco Shunpoco commented Dec 27, 2025

If the tool (yarn) has a problem, spawn in the install() raises an error, but the error message is hard to understand which/how application/file/directory has a problem. This commit enhances the error to explain why it fails.

For example, when I ran ./x test tidy --extra-checks=js:

...
tidy check
tidy [extra_checks]: IO error: No such file or directory (os error 2)
tidy [extra_checks]: FAIL
tidy: The following check failed: extra_checks

.. It doesn't explain yarn has a problem (in that case, my env didn't have yarn).

After this PR, the same command prints:

tidy check
can not run yarn install
tidy [extra_checks]: IO error: unable to run yarn: entity not found
tidy [extra_checks]: FAIL
tidy: The following check failed: extra_checks

If the tool (yarn) does not exists, spawn() raise an error, but the error message is just like a `No such file or directory`. So it is hard to understand which application/file/directory has a problem. This commit maps the error to expose the problem is around yarn.
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Dec 27, 2025
@Shunpoco Shunpoco marked this pull request as ready for review December 27, 2025 09:36
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 27, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 27, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 27, 2025

Mark-Simulacrum is not on the review rotation at the moment.
They may take a while to respond.

@rustbot
Copy link
Collaborator

rustbot commented Dec 27, 2025

r? @Mark-Simulacrum

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

@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 2, 2026

📌 Commit f2b640a has been approved by Mark-Simulacrum

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 Jan 2, 2026
bors added a commit that referenced this pull request Jan 2, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #150425 (mapping an error from cmd.spawn() in npm::install)
 - #150444 (Expose kernel launch options as offload intrinsic args)
 - #150495 (Correct hexagon "unwinder_private_data_size")
 - #150578 (Fix a typo in the docs of AsMut for #149609)
 - #150581 (mir_build: Separate match lowering for string-equality and scalar-equality)
 - #150594 (Fix typo in the docs of `CString::from_vec_with_nul`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 51faf00 into rust-lang:main Jan 2, 2026
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Jan 2, 2026
rust-timer added a commit that referenced this pull request Jan 2, 2026
Rollup merge of #150425 - Shunpoco:map-npm-install-error, r=Mark-Simulacrum

mapping an error from cmd.spawn() in npm::install

If the tool (yarn) has a problem, spawn in the install() raises an error, but the error message is hard to understand which/how application/file/directory has a problem. This commit enhances the error to explain why it fails.

For example, when I ran `./x test tidy --extra-checks=js`:
```bash
...
tidy check
tidy [extra_checks]: IO error: No such file or directory (os error 2)
tidy [extra_checks]: FAIL
tidy: The following check failed: extra_checks
```
.. It doesn't explain yarn has a problem (in that case, my env didn't have yarn).

After this PR, the same command prints:
```bash
tidy check
can not run yarn install
tidy [extra_checks]: IO error: unable to run yarn: entity not found
tidy [extra_checks]: FAIL
tidy: The following check failed: extra_checks
```
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jan 2, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#150425 (mapping an error from cmd.spawn() in npm::install)
 - rust-lang/rust#150444 (Expose kernel launch options as offload intrinsic args)
 - rust-lang/rust#150495 (Correct hexagon "unwinder_private_data_size")
 - rust-lang/rust#150578 (Fix a typo in the docs of AsMut for rust-lang/rust#149609)
 - rust-lang/rust#150581 (mir_build: Separate match lowering for string-equality and scalar-equality)
 - rust-lang/rust#150594 (Fix typo in the docs of `CString::from_vec_with_nul`)

r? `@ghost`
`@rustbot` modify labels: rollup
@Shunpoco Shunpoco deleted the map-npm-install-error branch January 3, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants