Skip to content

Path::file_stem mangles target names that contain a period #8

@saethlin

Description

@saethlin
$ cargo +nightly miri setup --target thumbv8m.base-none-eabi
Preparing a sysroot for Miri (target: thumbv8m.base-none-eabi)...
warning: Patch `rustc-std-workspace-alloc v1.99.0 (/home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)` was not used in the crate graph.
Patch `rustc-std-workspace-std v1.99.0 (/home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-std)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.
    Checking core v0.0.0 (/home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling compiler_builtins v0.1.103
    Checking rustc-std-workspace-core v1.99.0 (/home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
    Checking alloc v0.0.0 (/home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc)
    Checking custom-local-sysroot v0.0.0 (/tmp/.tmpfH3QUJ)
    Finished release [optimized] target(s) in 7.85s
fatal error: failed to build sysroot: failed to read cargo out dir

Caused by:
    No such file or directory (os error 2)

The problem is that this comment is not entirely correct:

// If this is a filename, the name is obtained by stripping directory and extension.
// That will also work fine for built-in target names.
path.file_stem()

because this does not work for all built-in target names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions