T
Task4mo ago
trim21

encounter a issue that task caching not working anymore.

I have a simple task running just echo 1 with sources and generates. and it's hash in .task/checksum/ doesn't change. But it never consider up to date and command always run. I have same version task on debian and it's ok, but not working as expected on windows Is this maybe a bug?
8 Replies
andreynering
andreynering4mo ago
Hi @trim21, Can you provide an example Taskfile that reproduces the issue?
trim21
trim214mo ago
OK, I find reason. I have a glob defined in generated doesn't match any files. so it always consider out of date but the file it generated is platform-specific, any way I can workaround this?
generates:
- ./src/**/*.so #
- ./src/**/*.pyd # windows
generates:
- ./src/**/*.so #
- ./src/**/*.pyd # windows
of is this expected behavior or it's a bug?
andreynering
andreynering4mo ago
That's a by design behavior. If any of the entries do not have any files, Task will run. The idea is that if the generated file was deleted, it should be re-generated.
trim21
trim214mo ago
make sense anyway I can workaround this? looks like I'll have to write 2 internal task for this?
andreynering
andreynering4mo ago
Yeah, having separed tasks for Windows and others is probably the most obvious solution. You can use platforms: for that: https://taskfile.dev/usage/#platform-specific-tasks-and-commands
trim21
trim214mo ago
thanks not an ideal solution althrough just read the source and find that I can use *.{so,pyd} in this case
trim21
trim214mo ago
thanks anyway
Want results from more Discord servers?
Add your server