Skip to content

fix(load-cargo): load workspace from absolute path #19438

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

Closed
wants to merge 1 commit into from

Conversation

snprajwal
Copy link
Contributor

@snprajwal snprajwal commented Mar 24, 2025

Fixes #19386

The change does not break the API, or affect crate users with working code.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 24, 2025
@snprajwal
Copy link
Contributor Author

sigh Windows strikes again... saw #14430, RIP

@snprajwal snprajwal changed the title fix(load-cargo): load workspace from relative path fix(load-cargo): load workspace from absolute path Mar 24, 2025
Comment on lines +47 to +53
// Use the provided path as is if it is absolute.
// Otherwise, join it with the current dir path.
let root = AbsPathBuf::assert_utf8(if root.is_absolute() {
root.to_path_buf()
} else {
std::env::current_dir()?.join(root)
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unnecessary?
Quoting the docs of Path::join

If path is absolute, it replaces the current path.

path being the argument to join here, that is in our case root. So this change shouldn't do anything here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right. In that case, something else locally was breaking the workspace discovery. Apologies for the noise.

@snprajwal snprajwal closed this Mar 24, 2025
@snprajwal snprajwal deleted the loadws-relpath branch March 24, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ra_ap_load_cargo] Use std::fs::canonicalize() instead of std::env::current_dir()?.join(..)
3 participants