Skip to content

Indexing failure with unexpected directory layout #5

@varungandhi-src

Description

@varungandhi-src

When trying to auto-index https://sourcegraph.com/github.com/Picovoice/rhino, we run into a failure:

[ERROR rust_analyzer] Unexpected error: no projects

It seems like the underlying assumption -- that rust-analyzer will figure out the various crates etc. -- doesn't quite work. We should add some logic to spawn the correct rust-analyzer jobs based on the Cargo.toml files.

Noah attempted a fix earlier but I don't think that covers all the edge cases. Ideally, we would make sure that:

  1. If there are multiple unrelated crates (e.g. there is no workspace), they are all indexed.
  2. If there are multiple workspaces, they are all indexed.
  3. We shouldn't double-index crates that are part of a workspace (once for the workspace, and once inside the workspace).
  4. We shouldn't double-index crates that are local dependencies. (e.g. one crate depends on another via path)

I think it would be reasonable to aim for 1, 2, and 3 for a first pass at fixing this problem. 4 may be a little tricky if one is using non-default features for the path imported crate.

For each criterion that should be satisfied, it would be good to add some tests.

This is probably as good a time as any to move the logic from a shell script to something more sensible (e.g. Go or Rust).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions