rust-lang / rust-lang/rust

rustc does not always update the mtime of all its outputs

Open
#148,948 5 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug P-high regression-from-stable-to-stable T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

There are apparently situations involving incremental compilation where rustc will conclude that an output file (e.g. an rmeta file) is already fully up-to-date, and will just not do anything to it. However, build systems (including cargo) typically assume that they can use the mtime to figure out whether an output is up-to-date, so rustc not bumping the mtime of an output can lead to confusion.

We may want to fix rustc so that it always bumps the mtime of its outputs, even if they need no other changes. That should be quite cheap to do, and can avoid a lot of downstream head-scratching such as:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the incremental-compilation case described for rustc outputs such as rmeta files, then compare the observed mtimes with the downstream behavior noted in Cargo issue #16104. Done means rustc consistently bumps the mtime of every output, including outputs it considers fully up to date.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.