Closed tibo-mllr closed 1 year ago
Yep this is the tradeoff with last modified
, it's faster but less resilient to edge cases than either per file hashing (computationally expensive) or IO events.
IIRC stashing files will remove them from the folder, but may not leave any trace. We might be able to cover this by looking for last modified per folder as well as per file.
I'm working on Gold the successor to yarn.build over at gold.build, I roughly planning an initial release towards the end of the year. I'm still merging fixes here, but I'm focussing most of my energy on Gold.
Tracking file changes is one of the areas where many problems and concerns come together. As a quick example you can only have so many file watchers (on some OS's) so you really want to have a program watching the IO events and relaying them to you, this is what watchman is built for.
But, just because you know a file has changed, doesn't mean its contents have meaningfully changed—thats what hashing can get you.
The scope of Gold is a bit bigger than this project, and this is one of the bigger problems I'm addressing with it.
Alright, thanks for your explanation!
Describe the bug Hi everyone, I ran into a problem with yarn build, because I cancelled changes and deleted files in a folder, but when rebuilding, it still kept those files, which wasn't okay with the other apps using this folder. While searching for a solution, I arrived on this issue: https://github.com/ojkelly/yarn.build/discussions/169 In the answer, it is mentioned "[
yarn build
] look at the whole folder and check the last modified date for each file." I think that's a huge problem?.. That's exactly because of that that the bug occurred: I stashed the changes on git. So, after that, the "last modified" date was before my own changes... What made it was just adding a useless comment in the rootindex.ts
...To Reproduce Steps to reproduce the behavior:
Expected behavior I know looking by last modified date is the easiest, but clearly not how it should be done... (I have no idea how though)
Desktop OS: macOS yarn 1.22.19 (maybe it's already fixed in a newer version, just want to make sure this is taken into account)