Skip to content

Docs say --remap-path-prefix treats paths as strings during matching but compiler does not #96870

Open
@michaelwoerister

Description

@michaelwoerister

Our --remap-path-prefix documentation says "The
replacement is purely textual, with no consideration of the current system's
pathname syntax."
. But that currently is not the case. Prefix matching is implemented via Path::strip_prefix which can behave quite differently:

`abc` is a prefix of `abc/def`
`abc/.` is a prefix of `abc/def`
`ab` is NOT a prefix of `abc/def`
`abc` is NOT a prefix of `./abc/def`
`./abc` is NOT a prefix of `abc/def`
`./abc` is a prefix of `./abc/def`

It's unclear whether we should update the documentation or change the compiler's behavior.

rustc --version --verbose:

rustc 1.60.0 (7737e0b5c 2022-04-04)
binary: rustc
commit-hash: 7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c
commit-date: 2022-04-04
host: x86_64-unknown-linux-gnu
release: 1.60.0
LLVM version: 14.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-reproducibilityArea: Reproducible / deterministic buildsC-bugCategory: This is a bug.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