rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.78k stars 2.42k forks source link

re-compilation of git repo download... #8209

Closed progman1 closed 4 years ago

progman1 commented 4 years ago

Problem

a dependency on a git repo is resulting in its repeated recompilation and that of some of its own dependencies (though not recursively).

Steps

1. ocaml="*" is switched to ocaml= {git="git://github ...."} which was done to take advantage of a quick fix before publication to the crates registry.

2. 3.

Possible Solution(s)

Notes

Output of cargo version:

ehuss commented 4 years ago

You can try running Cargo with the CARGO_LOG=cargo::core::compiler::fingerprint=trace environment variable which should display the reason Cargo thinks something needs to be rebuilt. It may provide a clue what's going on.

progman1 commented 4 years ago

here's the output:

dev@raspberrypi:~/experiments/ocaml-rust-starter$
CARGO_LOG=cargo::core::compiler::fingerprint=trace cargo build
--target-dir=_build/default/target/
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/ocaml2rust-3233e6ec320c45ec/lib-ocaml2rust
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint] new
local fingerprints deps
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint] old
local fingerprints deps
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint] new
local fingerprints deps
[2020-05-06T13:45:00Z INFO  cargo::core::compiler::fingerprint] stale:
missing "/home/dev/.cargo/git/checkouts/ocaml-rs-da52f9c65e24ce66/40c8624/sys/ocamlopt"
[2020-05-06T13:45:00Z INFO  cargo::core::compiler::fingerprint]
fingerprint error for ocaml2rust v0.1.0
(/home/dev/experiments/ocaml-rust-starter)/Build/Target { ..:
lib_target("ocaml2rust", ["staticlib", "dylib"],
"/home/dev/experiments/ocaml-rust-starter/src/lib.rs", Edition2018) }
[2020-05-06T13:45:00Z INFO  cargo::core::compiler::fingerprint]
err: current filesystem status shows we're outdated
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/ocaml-ac6d5da7244ae0b7/lib-ocaml-ac6d5da7244ae0b7
[2020-05-06T13:45:00Z INFO  cargo::core::compiler::fingerprint]
fingerprint error for ocaml v0.12.0
(git://github.com/zshipko/ocaml-rs#40c86247)/Build/Target { ..:
lib_target("ocaml", ["lib"],
"/home/dev/.cargo/git/checkouts/ocaml-rs-da52f9c65e24ce66/40c8624/src/lib.rs",
Edition2018) }
[2020-05-06T13:45:00Z INFO  cargo::core::compiler::fingerprint]
err: current filesystem status shows we're outdated
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/ocaml-derive-211fa08717e35cab/lib-ocaml_derive-211fa08717e35cab
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/proc-macro2-8cbec4c8ffe35c50/lib-proc_macro2-8cbec4c8ffe35c50
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/proc-macro2-c261c29f1d5c2acc/run-build-script-build_script_build-c261c29f1d5c2acc
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/proc-macro2-832c187024763536/build-script-build_script_build-832c187024763536
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/unicode-xid-946a2714430f1d30/lib-unicode_xid-946a2714430f1d30
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/quote-03bd8ed9b65a7ad7/lib-quote-03bd8ed9b65a7ad7
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/syn-e31d63e372a675cf/lib-syn-e31d63e372a675cf
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/syn-5f8b30aabeb9e45d/run-build-script-build_script_build-5f8b30aabeb9e45d
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/syn-d2f03ae6218364a7/build-script-build_script_build-d2f03ae6218364a7
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/synstructure-2f10559ceab00947/lib-synstructure-2f10559ceab00947
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/ocaml-sys-3d8f179b282c1d27/lib-ocaml_sys-3d8f179b282c1d27
[2020-05-06T13:45:00Z INFO  cargo::core::compiler::fingerprint]
fingerprint error for ocaml-sys v0.12.0
(git://github.com/zshipko/ocaml-rs#40c86247)/Build/Target { ..:
lib_target("ocaml-sys", ["lib"],
"/home/dev/.cargo/git/checkouts/ocaml-rs-da52f9c65e24ce66/40c8624/sys/src/lib.rs",
Edition2018) }
[2020-05-06T13:45:00Z INFO  cargo::core::compiler::fingerprint]
err: current filesystem status shows we're outdated
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/cty-95dd7124dde8449b/lib-cty-95dd7124dde8449b
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/ocaml-sys-d5b78c7bca8b48b3/run-build-script-build_script_build-d5b78c7bca8b48b3
[2020-05-06T13:45:00Z INFO  cargo::core::compiler::fingerprint]
fingerprint error for ocaml-sys v0.12.0
(git://github.com/zshipko/ocaml-rs#40c86247)/RunCustomBuild/Target {
..: custom_build_target("build-script-build",
"/home/dev/.cargo/git/checkouts/ocaml-rs-da52f9c65e24ce66/40c8624/sys/build.rs",
Edition2018) }
[2020-05-06T13:45:00Z INFO  cargo::core::compiler::fingerprint]
err: current filesystem status shows we're outdated
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint]
fingerprint at:
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/ocaml-sys-8cf61dcdf5f11556/build-script-build_script_build-8cf61dcdf5f11556
   Compiling ocaml-sys v0.12.0 (git://github.com/zshipko/ocaml-rs#40c86247)
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint] new
local fingerprints deps
[2020-05-06T13:45:00Z DEBUG cargo::core::compiler::fingerprint] write
fingerprint (b80c7e1f6c701374) :
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/ocaml-sys-d5b78c7bca8b48b3/run-build-script-build_script_build-d5b78c7bca8b48b3
   Compiling ocaml v0.12.0 (git://github.com/zshipko/ocaml-rs#40c86247)
[2020-05-06T13:45:02Z DEBUG cargo::core::compiler::fingerprint] write
fingerprint (371bbafae1b528b6) :
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/ocaml-sys-3d8f179b282c1d27/lib-ocaml_sys-3d8f179b282c1d27
[2020-05-06T13:45:13Z DEBUG cargo::core::compiler::fingerprint] write
fingerprint (288325c04691658e) :
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/ocaml-ac6d5da7244ae0b7/lib-ocaml-ac6d5da7244ae0b7
   Compiling ocaml2rust v0.1.0 (/home/dev/experiments/ocaml-rust-starter)
[2020-05-06T13:45:16Z DEBUG cargo::core::compiler::fingerprint] write
fingerprint (3395f29ea89d46f8) :
/home/dev/experiments/ocaml-rust-starter/_build/default/target/debug/.fingerprint/ocaml2rust-3233e6ec320c45ec/lib-ocaml2rust
    Finished dev [unoptimized + debuginfo] target(s) in 16.38s

On 06/05/2020, Eric Huss notifications@github.com wrote:

You can try running Cargo with the CARGO_LOG=cargo::core::compiler::fingerprint=trace environment variable which should display the reason Cargo thinks something needs to be rebuilt. It may provide a clue what's going on.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/rust-lang/cargo/issues/8209#issuecomment-624396503

ehuss commented 4 years ago

stale: missing "/home/dev/.cargo/git/checkouts/ocaml-rs-da52f9c65e24ce66/40c8624/sys/ocamlopt"

This is the reason. The build script tells Cargo that it should re-run if that file changes. By default, "ocamlopt" is a package-relative path. But that file doesn't exist in the repo. Missing files are always treated as "changed", so it re-runs every time. I don't understand how that code is supposed to work, or what OCAMLOPT means, but it looks like you need to set it to something.

progman1 commented 4 years ago

the package creator was very responsive and has now fixed the problem. thanks for clarifying the problem!