Skip to content
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

Do not use mtime comparision to determine file task execution #4

Closed
srackham opened this issue May 7, 2020 · 4 comments
Closed

Do not use mtime comparision to determine file task execution #4

srackham opened this issue May 7, 2020 · 4 comments

Comments

@srackham
Copy link
Owner

srackham commented May 7, 2020

Timestamp-only file task dependency checking is fraught with problems, see mtime comparison
considered harmful
.

This is further complicated by the fact that Deno.utime and Deno.utimeSync APIs have been marked
"unstable" in Deno 1.0.0-rc1 and they have resolution limitations.

Drake's file task dependency check mechanism should not rely on target and prerequisite file
timestamp comparisions.

@srackham
Copy link
Owner Author

Resolved with the introduction of file history caching in Drake v1.0.0-rc2.

@duncanmak
Copy link

@srackham I'm using Drake 1.5.2 and I noticed that on Windows, the mtime check in isOutOfDate is returning true all the time.

isOutOfDate: build\index.html: true: build\index.html
from: {"size":532,"mtime":"2022-06-07T21:29:05.186Z"}
to:   {"size":532,"mtime":"2022-06-07T23:21:29.811Z"}

I was scanning the same article you referred to, mtime comparison considered harmful, and I wonder if a better check could be implemented instead of checking that the result of Date.toISOString is !==.

An interesting note, I only see this error when running in Windows - on Linux (in WSL, no less), isOutOfDate returns false as expected after running the same target a second time.

@srackham
Copy link
Owner Author

srackham commented Jun 9, 2022

Thanks for this, very interesting. I'll look into it when I get some free time.

@srackham
Copy link
Owner Author

@duncanmak The only possibilities I can think of are that somehow the Drake cache file is not being updated after a sucessful task execution (if the task action is executed sucessfully then the Drake cache should be updated) or the information returned by the Deno.statSync API is stale.

Try cloning the Drake repo and running the Drake tests on WSL with deno run -A Drakefile.ts test command (I don't have WSL installed).

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

No branches or pull requests

2 participants