Skip to content

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

Description

@jsgf

--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

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

      Issue actions