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

rust_analyzer: make all paths in rust-project.json absolute #3033

Merged
merged 6 commits into from
Dec 2, 2024

Conversation

sam-mccall
Copy link
Contributor

This is a step towards supporting automatic project discovery (#2755).

Relative paths are resolved against the location of rust-project.json,
but in auto-discovery this is the location of the BUILD file being
discovered, not the workspace root.

We already use absolute paths for generated files, so rust-project.json
is not workspace-independent today.

The alternatives seem more complex for little gain:

  • Only use absolute paths for auto-discovery mode, relative otherwise.
  • Use ../../ to express all workspace paths relative to the BUILD.

See #2755 (comment)

This is a step towards supporting automatic project discovery (bazelbuild#2755).

Relative paths are resolved against the location of rust-project.json,
but in auto-discovery this is the location of the BUILD file being
discovered, not the workspace root.

We already use absolute paths for generated files, so rust-project.json
is not workspace-independent today.

The alternatives seem more complex for little gain:

- Only use absolute paths for auto-discovery mode, relative otherwise.
- Use ../../ to express all workspace paths relative to the BUILD.

See bazelbuild#2755 (comment)
output.nth(1).unwrap()
})
.expect("Failed to find sysroot entry.");
// /tmp/_bazel/12345678/external/tools/rustlib/library => /tmp/bazel
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't this be// ... => /tmp/_bazel?

@krasimirgg krasimirgg enabled auto-merge December 2, 2024 13:11
@sam-mccall
Copy link
Contributor Author

sam-mccall commented Dec 2, 2024

@krasimirgg CI is broken, can you re-trigger or merge?

EDIT: I can re-trigger myself, let's see

@krasimirgg krasimirgg added this pull request to the merge queue Dec 2, 2024
Merged via the queue into bazelbuild:main with commit 74f164b Dec 2, 2024
4 checks passed
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.

2 participants