craftr-build / craftr-build-4.x

Frontend for the Craftr build framework.
https://craftr-build.github.io/craftr/
Other
60 stars 14 forks source link

Targets that export a command file can not be detected dirty when command changes #132

Closed NiklasRosenstein closed 6 years ago

NiklasRosenstein commented 7 years ago

If a target must be exported into a command-file, Ninja can not easily detect when the actual command has changed. For files that we re-export every time during the build process, we need to implement some kind of hashing mechanism to tell Ninja when a target's command has changed.

The same is true for partial command-files, eg. the additional arguments exported into a file for MSVC (due to cmd command-line buffer limit).

NiklasRosenstein commented 7 years ago

A similar problem is with files that are created with cmake_configure_file() and included in C/C++ source files. Since the header file is rendered every time the build is invoked, the file timestamp changes and all edges of files that include this header are dirty.

NiklasRosenstein commented 6 years ago

This is no longer relevant as Craftr 3 does not export command files (it instead has a database of all commands that are then invoked by Ninja via craftr --run-action <action_id>^<action_hash>. The hash in the command will mark the build node(s) as dirty when the action's commands, environment, input files or cwd change.