[go: up one dir, main page]

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

Cargo emits confusing errors when trying to use example crates #10173

Open
mejrs opened this issue Dec 6, 2021 · 0 comments
Open

Cargo emits confusing errors when trying to use example crates #10173

mejrs opened this issue Dec 6, 2021 · 0 comments
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@mejrs
Copy link
mejrs commented Dec 6, 2021

Problem

Cargo emits confusing errors when trying to use example crates

Steps

When you have an example crate, and define it in the main crate's cargo.toml with

[[example]]
name = "example1"
path = "examples/example1"

commands like cargo check --examples gives useless errors like:

  • error: couldn't read examples/example1: Access is denied. (os error 5) on Windows,
  • error: couldn't read examples/example1: Is a directory (os error 21) on Ubuntu/MacOS

Possible Solution(s)

It would be nice if this would Just Work. But otherwise it would be friendlier to nudge users to something like

[[example]]
name = "example1"
path = "examples/example1/src/main.rs"

rather than emitting useless error messages

Notes

No response

Version

cargo 1.57.0 (b2e52d7ca 2021-10-21)
release: 1.57.0
commit-hash: b2e52d7cab0a286ee9fcc0c17510b1e72fcb53eb
commit-date: 2021-10-21
host: x86_64-pc-windows-msvc
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.79.1-DEV (sys:0.4.49+curl-7.79.1 vendored ssl:Schannel)
os: Windows 10.0.19043 (Windows 10 Home) [64-bit]
@mejrs mejrs added the C-bug Category: bug label Dec 6, 2021
@ehuss ehuss added the A-diagnostics Area: Error and warning messages generated by Cargo itself. label Dec 6, 2021
@epage epage added the S-triage Status: This issue is waiting on initial triage. label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

3 participants