Skip to content

Paths in save-analysis files are not remapped by --remap-path-prefix #52549

@jsgf

Description

@jsgf
Contributor

--remap-path-prefix is supposed to remap all references to paths in all output (error messages, debug info, etc). It looks like this isn't happening for save-analysis files.

For example, in current nightly: rustc 1.29.0-nightly (12ed235 2018-07-18)

This input

pub struct Foo;
rustc -Zsave-analysis -g --crate-type=rlib --emit=metadata t.rs --error-format json --remap-path-prefix=$(pwd)=.

produces a save-analysis file which still has references to my home dir:

        "external_crates": [
            {
                "file_name": "/Users/jsgf/t.rs",
                "id": {
                    "disambiguator": [
                        287500826263317014,
                        5864436369277545838
                    ],
                    "name": "std"
                },
                "num": 1
            },

Example in full output.

This is undesirable because it makes the output depend on the build directory, which breaks build artifact caching.

Activity

jsgf

jsgf commented on Jul 19, 2018

@jsgf
ContributorAuthor
added
A-save-analysisArea: saving results of analyses such as inference and borrowck results to a file.
C-bugCategory: This is a bug.
on Jul 19, 2018
added
T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.
on Jul 19, 2018
added 4 commits that reference this issue on Aug 8, 2018
3230c07
7683e1b
e35ca13
e9a4e44
added a commit that references this issue on Aug 9, 2018
c24ba7e
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-bugCategory: This is a bug.T-dev-toolsRelevant to the dev-tools subteam, 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

        Participants

        @kennytm@jsgf@nrc

        Issue actions

          Paths in save-analysis files are not remapped by --remap-path-prefix · Issue #52549 · rust-lang/rust