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 does not work in bzlmod #2438

Open
purkhusid opened this issue Jan 23, 2024 · 3 comments
Open

Rust Analyzer does not work in bzlmod #2438

purkhusid opened this issue Jan 23, 2024 · 3 comments

Comments

@purkhusid
Copy link

There seems to be a couple of issues with the Rust Analyzer project generator.

  1. The workaround here:
    let rules_rust_name = env!("ASPECT_REPOSITORY");
    does not work with bzlmod and AFAIK is no longer needed for bzlmod. If I just set the name to rules_rust it works and gets further into generating the project.
  2. The generator uses the runfiles library and that library does not support bzlmod:
    let r = Runfiles::create()?;

Updating the Runfiles library to support is a bit bigger task since but there is prior art in e.g. rules_go/python/java/dotnet

@csmulhern
Copy link
Contributor

The runfiles library needs to be updated to read _repo_mapping from the runfiles base directory to map repo names to the canonical name on disk. It's a simple file format (1 item per line, each line with 3 comma separated values, with no ambiguity as the values cannot contain commas).

More details are available here: https://github.com/bazelbuild/proposals/blob/main/designs/2022-07-21-locating-runfiles-with-bzlmod.md.

@cameron-martin
Copy link
Contributor

After #2450, gen_rust_project works for me. Is there another issue here?

@csmulhern
Copy link
Contributor

After #2450, gen_rust_project works for me. Is there another issue here?

I believe #2440 is also necessary.

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

No branches or pull requests

4 participants