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 better logging for Wally packages in the wrong dependency organization #83

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,30 @@ pub fn resolve(
}

if conflicting.is_empty() {
let test = match &dependency_request.request_realm {
Realm::Server => format!(
"Try putting this in your wally.toml: \n \n[dependencies]\n{req}",
req = format!("{}@{}", dependency_request.package_req.name(), dependency_request.package_req.version_req())
)
.to_owned(),
Realm::Shared => format!(
"Try putting this in your wally.toml: \n \n[server-dependencies]\n{req}",
req = format!("{}@{}", dependency_request.package_req.name(), dependency_request.package_req.version_req())
)
.to_owned(),
_ => format!(
"Are you sure this is a {req}?",
req = format!("{}@{}", dependency_request.package_req.name(), dependency_request.package_req.version_req())
)
.to_owned(),
};

bail!(
"No packages were found that matched ({req_realm:?}) {req}.\
\nAre you sure this is a {req_realm:?} dependency?",
\n{test}",
req_realm = dependency_request.request_realm,
req = dependency_request.package_req,
test = test
);
} else {
let conflicting_debug: Vec<_> = conflicting
Expand Down