Closed gsingh93 closed 7 years ago
I can't reproduce this on OSX at least. Seems like it's a cargo issue rather than an openssl issue though.
@gsingh93 can you set RUST_LOG=cargo::ops::cargo_rustc::fingerprint=info
when a spurious recompile happens? That should explain at least what's going on here.
vagrant@vagrant-ubuntu-trusty-64:/vagrant/build-test$ RUST_LOG=cargo::ops::cargo_rustc::fingerprint=info cargo build
INFO:cargo::ops::cargo_rustc::fingerprint: stale: /vagrant/build-test/src/lib.rs -- 1483306440.000000000s vs 1483302213.000000000s
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for build-test v0.1.0 (file:///vagrant/build-test): mtime based components have changed: previously Some(FileTime { seconds: 1483302213, nanos: 0 }) now None, paths are "/vagrant/build-test/target/debug/.fingerprint/build-test-944083931e2f0d10/dep-lib-build-test" and "/vagrant/build-test/target/debug/.fingerprint/build-test-944083931e2f0d10/dep-lib-build-test"
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for openssl v0.9.4: rust compiler has changed
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for bitflags v0.7.0: rust compiler has changed
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for lazy_static v0.2.2: rust compiler has changed
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for libc v0.2.18: rust compiler has changed
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for openssl-sys v0.9.4: rust compiler has changed
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for openssl-sys v0.9.4: rust compiler has changed
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for pkg-config v0.3.8: rust compiler has changed
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for openssl v0.9.4: rust compiler has changed
Compiling openssl v0.9.4
Compiling bitflags v0.7.0
Compiling lazy_static v0.2.2
Compiling pkg-config v0.3.8
Compiling libc v0.2.18
Compiling openssl-sys v0.9.4
Compiling build-test v0.1.0 (file:///vagrant/build-test)
Finished debug [unoptimized + debuginfo] target(s) in 8.51 secs
Based on that output, I think it's related to the fact that I'm building in Vagrant but modifying files from the native OS?
Ok, the real issue here is emacs is using flycheck-mode
, which is trying to compile the project on my host OS, which fails on my host OS because I don't have the right openssl lib installed. This means when I rebuild in vagrant, it needs to rebuild openssl-sys because the last build (on the host OS) failed. Disabling flycheck-mode
fixes the problem.
Thanks for the help and sorry for the noise.
I'm running into the same issue but I'm not using Emacs. The new option is CARGO_LOG=cargo::core::compiler::fingerprint=info
and the first error it gives is:
1.115283379s INFO prepare_target{force=false package_id=rget v0.1.0 (/home/me/workspace/rget) target="rget"}: cargo::core::compiler::fingerprint: dependency on `build_script_main` is newer than we are 1729007301.753356001s > 1729007286.214545739s "/home/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.103"
I'm guessing it's rust-analyzer doing this, but that is a shame. :-/
This may be an issue with Cargo, but I want to confirm it's not an issue with this crate first. When I change a file,
openssl-sys
shouldn't have to rebuild if it was already built, but it seems like it's being built every time. Steps to reproduce:cargo init build-test && cd build-test
Cargo.toml
[dependencies] openssl = "0.9.4"
[cfg(test)]
mod tests {
[test]
}