Skip to content

Fix generates problems. #2317

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix generates problems. #2317

wants to merge 2 commits into from

Conversation

trulede
Copy link
Contributor

@trulede trulede commented Jul 5, 2025

Fixes some problems with 'generates'.

1. Generates with timestamp method does not generate deleted files

Previously generated files, then deleted, are not regenerated when Task is subsequently run.

Task does not actually check the generates items exist, rather, it cunningly 'globs" each generates item and only notices those files which exist, and the timestamp file itself. That means, if you delete a file, task will not notice and because the timestamp file, created when the source last changed, was considered for the check ... another cunning move ... it will appear that the task is up-to-date.

Solution is to adopt the glob mechanism from checksum. If a generate item is globbed and returns no files, or a NotExist error, then return indicating that the Task should run.

2. Generates (and sources) items with a space in filename will be expanded correctly.

Curiously, this problem is often masked by the first problem. In any case, it seems that a fix from long ago has been lost. The fix is introduced again, at a slightly different location (i.e. the glob() function).

Original fix here.

fixes #2314
fixes #1506
fixes #1230

@andreynering andreynering self-requested a review July 5, 2025 16:45
@trulede
Copy link
Contributor Author

trulede commented Jul 6, 2025

It might be worthwhile adding a few more test cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

method: timestamp does not run when generates: path is missing A timestamp method is expected when using sources and generates
1 participant