Skip to content

rust stdlib analysis contains absolute paths from appveyor and travis-CI #60157

Closed as not planned

Description

@staktrace

Running something like rustup component add rust-analysis will download a tarball containing the -Zsave-analysis data for the rust stdlib crates. However, these JSON files in some cases contain absolute paths for the environment they were generated in, like /Users/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.46/src/unix/mod.rs or similar windows paths at C:\Users\appveyor, or other absolute paths like /cargo/registry/src/github.com-1ecc6299db9ec823/rustc-demangle-0.1.10/src/lib.rs. It would be better if the analysis data had relative paths so that the analysis files can be used on other machines.

See also rust-lang/rls#1339, /cc @Xanewok

Activity

  1. added
    A-save-analysisArea: saving results of analyses such as inference and borrowck results to a file.
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Apr 21, 2019
  2. Xanewok commented on Apr 21, 2019

    @Xanewok
    Contributor

    I believe we can use --remap-path-prefix to fix that.

    Now we encode some of the paths (which are represented as PathBufs in rls-data see #60053 (comment)) as a byte vector, so it'd be also good for #60053 to land so we can see how much of the paths are affected.

  3. jyn514 commented on May 19, 2021

    @jyn514
    Member

    The compiler should be using /rustc/<long hash> for these paths consistently since #83813.

  4. jyn514 commented on Feb 19, 2023

    @jyn514
    Member

    Save-analysis has been removed from the compiler.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-save-analysisArea: saving results of analyses such as inference and borrowck results to a file.C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions