Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression that causes app to not be recompiled #7969

Closed
nazar-pc opened this issue Mar 5, 2020 · 1 comment
Closed

Regression that causes app to not be recompiled #7969

nazar-pc opened this issue Mar 5, 2020 · 1 comment
Labels

Comments

@nazar-pc
Copy link

@nazar-pc nazar-pc commented Mar 5, 2020

Problem
When checking src/main.rs cargo (rustc?) expects file to have newer timestamp than before to detect changes and this causes app to not be recompiled in some cases.

Steps

  1. cargo init
#!/bin/bash
set -e

binary=$(basename $(pwd))
rm -rf target
rm -rf src
mkdir src
echo "WTF ^, cargo?" > src/main-backup.rs
echo "fn main() {println!(\"bad\");}" > src/main.rs
cargo +nightly build --release
target/release/$binary
mv src/main-backup.rs src/main.rs
cargo +nightly build --release
target/release/$binary
touch src/main.rs
cargo +nightly build --release
target/release/$binary

Possible Solution(s)

  1. Ideally it should at least check for inequality instead, maybe file inode, etc., current implementation is just broken.
  2. Fix #2644, I faced this issue with echo "fn main() {}" > src/main.rs workaround to make dependencies compile and cache separately from the app itself

Notes
Last working version was installed with this (Jenkins output):

[2020-03-04T09:15:20.431Z] info: downloading installer
[2020-03-04T09:15:20.431Z] info: profile set to 'default'
[2020-03-04T09:15:20.431Z] info: default host triple is x86_64-unknown-linux-gnu
[2020-03-04T09:15:20.431Z] info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
[2020-03-04T09:15:20.824Z] info: latest update on 2020-03-04, rust version 1.43.0-nightly (4ad624882 2020-03-03)
[2020-03-04T09:15:20.824Z] info: downloading component 'cargo'
[2020-03-04T09:15:20.824Z] info: downloading component 'clippy'
[2020-03-04T09:15:20.824Z] info: downloading component 'rust-docs'
[2020-03-04T09:15:21.647Z] info: downloading component 'rust-std'
[2020-03-04T09:15:22.487Z] info: downloading component 'rustc'
[2020-03-04T09:15:25.011Z] info: downloading component 'rustfmt'
[2020-03-04T09:15:25.011Z] info: installing component 'cargo'
[2020-03-04T09:15:25.827Z] info: installing component 'clippy'
[2020-03-04T09:15:26.211Z] info: installing component 'rust-docs'
[2020-03-04T09:15:27.523Z] info: installing component 'rust-std'
[2020-03-04T09:15:28.831Z] info: installing component 'rustc'
[2020-03-04T09:15:34.019Z] info: installing component 'rustfmt'
[2020-03-04T09:15:34.411Z] info: default toolchain set to 'nightly'
[2020-03-04T09:15:34.411Z] 
[2020-03-04T09:15:34.411Z]   nightly installed - rustc 1.43.0-nightly (4ad624882 2020-03-03)

First non-working was installed with this:

[2020-03-04T19:57:07.393Z] info: downloading installer
[2020-03-04T19:57:07.393Z] info: profile set to 'default'
[2020-03-04T19:57:07.393Z] info: default host triple is x86_64-unknown-linux-gnu
[2020-03-04T19:57:07.393Z] info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
[2020-03-04T19:57:07.394Z] info: latest update on 2020-03-04, rust version 1.43.0-nightly (4ad624882 2020-03-03)
[2020-03-04T19:57:07.394Z] info: downloading component 'cargo'
[2020-03-04T19:57:07.778Z] info: downloading component 'clippy'
[2020-03-04T19:57:07.778Z] info: downloading component 'rust-docs'
[2020-03-04T19:57:07.778Z] info: downloading component 'rust-std'
[2020-03-04T19:57:08.594Z] info: downloading component 'rustc'
[2020-03-04T19:57:09.901Z] info: downloading component 'rustfmt'
[2020-03-04T19:57:09.901Z] info: installing component 'cargo'
[2020-03-04T19:57:10.285Z] info: installing component 'clippy'
[2020-03-04T19:57:10.669Z] info: installing component 'rust-docs'
[2020-03-04T19:57:12.541Z] info: installing component 'rust-std'
[2020-03-04T19:57:13.849Z] info: installing component 'rustc'
[2020-03-04T19:57:20.233Z] info: installing component 'rustfmt'
[2020-03-04T19:57:20.233Z] 
[2020-03-04T19:57:20.233Z] info: default toolchain set to 'nightly'
[2020-03-04T19:57:20.233Z]   nightly installed - rustc 1.43.0-nightly (4ad624882 2020-03-03)

Output of cargo version:

cargo 1.43.0-nightly (bda50510d 2020-03-02)
@nazar-pc nazar-pc added the C-bug label Mar 5, 2020
@nazar-pc nazar-pc changed the title Regression that causes app to not be recompileed Regression that causes app to not be recompiled Mar 5, 2020
@ehuss

This comment has been minimized.

Copy link
Contributor

@ehuss ehuss commented Mar 5, 2020

Alternate fingerprinting strategies are tracked in #6529, so I'm going to close as a duplicate of that.

@ehuss ehuss closed this Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.