Skip to content

cargo build --all-targets executes build.rs twice in beta and nightly #5575

@stepancheg

Description

@stepancheg

build.rs

Repro

clone https://github.com/stepancheg/cargo-build-rs-twice
cd cargo-build-rs-twice

Stable:

% rm xx/*; cargo +stable build --all-targets && ls xx/
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling libc v0.2.41
   Compiling fgfgf v0.1.0 (file:///Users/nga/tmp/cargo-build-rs-twice)
    Finished dev [unoptimized + debuginfo] target(s) in 2.59 secs
50421

Nightly:

% rm xx/*; cargo +nightly build --all-targets && ls xx/
   Compiling libc v0.2.41
   Compiling fgfgf v0.1.0 (file:///Users/nga/tmp/cargo-build-rs-twice)
    Finished dev [unoptimized + debuginfo] target(s) in 2.85s
50513	50514

build.rs writes a pid file into xx/ directory.

Two pid files in xx directory mean that build.rs was executed twice in nightly.

% cargo +nightly version
cargo 1.28.0-nightly (f352115d5 2018-05-15)
% cargo +stable version
cargo 1.26.0 (0e7c5a931 2018-04-06)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions