Skip to content

Potential inconsistency of the build when sources are updated meanwhile #4554

Open

Description

@wclr

Description

Just for the notice. There is potential buggy behaviour when performing builds and actively working with files (in IDE). This happens in the following scenario:

  • Build starts, it reads all the input modules and parses them (takes some time).
  • Some module content is updated while in this phase (e.g., user quickly updates/comments/uncomments something and saves), so that the input build content and the content on the disk differ at this moment.
  • Compiler continues to make a build plan, it reads cache-db file (that contains prev file hash and modification date that it will compare against current info), and it reads current module's hash/date (from disk).
  • The compiler completes the build, and writes a new hash to cache-db, but this is a hash of the module's version that was not built.
  • Next time, the compiler thinks that the module is built against its actual content even though it is not true. And it won't be rebuilt until its content (or its deps) changes.

So the solution in this case would be to calculate cached hashes from initially loaded module's content, not from disk. Modification dates are not relevant in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions