Conversation
Due to the usage of copy_if_different, python source files might not have been updated before compiling them into bytecode. Since a stamp file is already used for the compile step, the technique can be extended to a stamp file also for the copy step. This reduces the number of files that need to be checked by the CMake generators and ensures that the compile step always runs when any of the original source files changes. With this technique, one could even go back to using copy_if_different, but the dependency tracking will work independent of which copy method is used. The dependencies are now as follows: <all source files> -> copy.stamp -> pybytecode.stamp
guitargeek
approved these changes
Sep 21, 2026
guitargeek
left a comment
Contributor
There was a problem hiding this comment.
Nice idea! This is indeed a cleaner dependency chain. These stamp files are the silver bullet 🙂
Test Results 21 files 21 suites 2d 23h 16m 5s ⏱️ For more details on these failures, see this check. Results for commit c11785b. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Due to the usage of copy_if_different, python source files might not have been updated before compiling them into bytecode. This could trigger rebuilds.
@guitargeek, I think I found a way to do the same fix but with less files that are stat-ed and checked:
Since a stamp file is already used for the compile step, the technique can be extended to a stamp file also for the copy step. This reduces the number of files that need to be checked by the CMake generators and ensures that the compile step always runs when any of the original source files changes.
With this technique, one could even go back to using copy_if_different, but the dependency tracking will work independent of which copy method is used.
The dependencies are now as follows:
<all source files> -> copy.stamp -> pybytecode.stamp