Skip to content

gen_rust_project should use absolute paths for modules whose root is a generated file #1121

@csmulhern

Description

@csmulhern

For example, when creating a rust library that wraps bindgen generated source, the following JSON entry is created for gen_rust_project.

{
    "display_name": "png_sys",
    "root_module": "bazel-out/darwin-fastbuild/bin/png_sys/png_sys__bindgen.rs",
    "edition": "2021",
    "deps": [],
    "is_workspace_member": true,
    "cfg": [
        "test",
        "debug_assertions"
    ],
    "target": "x86_64-apple-darwin",
    "env": {},
    "is_proc_macro": false
}

The relative path for root_module causes rust_analyzer to be unable to find the right file when not using convenience symlinks (i.e. when --experimental_convenience_symlinks=ignore is set). This would be fixed by using an absolute path instead.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions