Skip to content

Failure on subsequent builds when --emit asm used without -C save-temps. #89149

Closed
@hydra

Description

@hydra

I tried this code:

(see attached project)
buildfailure-1.zip

cargo build --bin=nucleof446re --target=thumbv7m-none-eabi --features="dep-stm32f446" -vv
...
cargo build --bin=nucleof446re --target=thumbv7m-none-eabi --features="dep-stm32f446" -vv

I expected to see this happen:

build the first time, build the second time.

Instead, this happened: explanation

On the first build, success.
On the second build

error: could not copy "D:\\Users\\Hydra\\Documents\\dev\\playground\\rust\\buildfailure-1\\crates\\boards\\target\\thumbv7m-none-eabi\\debug\\deps\\boards-381a71c28462db46.19nwjvde6m7mbrbk.rcgu.s" to "D:\\Users\\Hydra\\Documents\\dev\\playground\\rust\\buildfailure-1\\crates\\boards\\target\\thumbv7m-none-eabi\\debug\\deps\\boards-381a71c28462db46.s": The system cannot find the file specified. (os error 2)

See log (attached)

log.txt

Upon investigation it appears that the rustflags (in the cargo configuration) --emit asm cause the subsequent build failure, but only when -C save-temps is NOT used.

i.e:

savetemps emit asm result
disabled disabled success
enabled disabled success
disabled enabled failure
enabled enabled success

Meta

rustc --version --verbose:

rustc 1.57.0-nightly (5ecc8ad84 2021-09-19)
binary: rustc
commit-hash: 5ecc8ad8462574354a55162a0c16b10eb95e3e70
commit-date: 2021-09-19
host: x86_64-pc-windows-gnu
release: 1.57.0-nightly
LLVM version: 13.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions