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

Add PackageError wrappers for activation errors #6175

Merged
merged 4 commits into from
Oct 17, 2018

Conversation

alexheretic
Copy link
Member

@alexheretic alexheretic commented Oct 15, 2018

Similarly to #6157 this wraps compile errors with PackageId info to allow lib users, in this case rls, to discern where something went wrong.

In particular if a dependency has a dodgy version or doesn't exist the error chain will now contain a PackageError that provides the package id ResolveError that provides the package path from error-parent -> root. From this I figure out if the error better relates to a workspace member, and target that manifest for diagnostics.

@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

Thanks for this! I wonder if a better name might be ResolveError perhaps though?

@alexheretic
Copy link
Member Author

Thanks for this! I wonder if a better name might be ResolveError perhaps though?

Yes perhaps, I named it for what it provides (package id) thinking maybe we could use it in other places to provide the same thing. But I wouldn't it having a more specific name, so I'll take your lead.

Rename package_id() -> parent_package_id() for clarity
@alexheretic
Copy link
Member Author

As an example of what I'm going for this patch; integrated into RLS this change allows me to generate the following diagnostic on a workspace member manifest.

More useful than just the parent
src/cargo/util/errors.rs Outdated Show resolved Hide resolved
Move activation_error, describe_path -> errors.rs
@alexheretic alexheretic force-pushed the compile_package_errors branch from 3c7737a to a853efd Compare October 16, 2018 14:42
@alexcrichton
Copy link
Member

@bors: r+

Thanks @alexheretic and @Eh2406!

@bors
Copy link
Contributor

bors commented Oct 16, 2018

📌 Commit 3c7737a39bead82e2f6e2e8cae4657f89e1dff0b has been approved by alexcrichton

@alexheretic
Copy link
Member Author

3c7737a is not the correct commit, I force pushed a853efd very shortly after making it. The former missed removing the old ResolveError implementation.

@Eh2406

This comment has been minimized.

@bors

This comment has been minimized.

@bors

This comment has been minimized.

@Eh2406

This comment has been minimized.

@alexcrichton

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Oct 17, 2018

📌 Commit a853efd has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Oct 17, 2018

⌛ Testing commit a853efd with merge 84c5815...

bors added a commit that referenced this pull request Oct 17, 2018
Add PackageError wrappers for activation errors

Similarly to #6157 this wraps compile errors with `PackageId` info to allow lib users, in this case rls, to discern where something went wrong.

In particular if a dependency has a dodgy version or doesn't exist the error chain will now contain a <s>PackageError that provides the package id</s> `ResolveError` that provides the package path from error-parent -> root. From this I figure out if the error better relates to a workspace member, and target that manifest for diagnostics.
@bors
Copy link
Contributor

bors commented Oct 17, 2018

💥 Test timed out

@Eh2406
Copy link
Contributor

Eh2406 commented Oct 17, 2018

copied down the case of xs 1940677808 3504257549 3236656445 2871459081 for me to investigate separately. But for now I will guess that this PR did not trigger that problem. edit: I can confirm that I can reproduce locally on master, so it is not related to this pr. Still investigating why that tree is slow.

@bors retry

@bors
Copy link
Contributor

bors commented Oct 17, 2018

⌛ Testing commit a853efd with merge 320fde11afdfa08cd643a31f8c593e8208aaf01e...

bors added a commit that referenced this pull request Oct 17, 2018
Add PackageError wrappers for activation errors

Similarly to #6157 this wraps compile errors with `PackageId` info to allow lib users, in this case rls, to discern where something went wrong.

In particular if a dependency has a dodgy version or doesn't exist the error chain will now contain a <s>PackageError that provides the package id</s> `ResolveError` that provides the package path from error-parent -> root. From this I figure out if the error better relates to a workspace member, and target that manifest for diagnostics.
@bors
Copy link
Contributor

bors commented Oct 17, 2018

⌛ Testing commit a853efd with merge 5f5b211...

@bors
Copy link
Contributor

bors commented Oct 17, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 5f5b211 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants