Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
vfsgendev updates modification times #804
@shurcooL I just got caught out using
I forgot that post #787 a
What would seem ideal here would be that we run
But I think this requires some changes in
gives the output:
What do you think is the best way forward here?
Yes, this is a known limitation of
That's right, they are taken from the files in the
To be more specific,
Unfortunately, git doesn't do a great job of keeping file modify times very consistent, and so as a result, regenerating those two packages can result in the modify times changing even when the file contents haven't.
shurcooL/vfsgen#26 is an issue I would very much like to find a good resolution for, but it's not high on my list of priorities. It's something I think about in the background, but can't afford to spend time looking for a solution more aggressively right now. I'd rather wait until I find a good solution than to try fix it at any cost now.
As a result, until that issue is resolved, it won't be possible to rely on
I can think of two ways at this time:
Indeed. But the only thing we need to rely on here is the contents of those files; the modification times are irrelevant aren't they? This is something that the
Yes, agreed. Whilst it would also break the isolation rule, having
Is that the case? I'm not sure, but I suspect they might be used by GopherJS to determine staleness.
This can be investigated, and if they're really not needed, then we can solve this issue trivially by overriding all modtimes to be zero in the VFS.
At a guess, even if it is using modification times to determine staleness, then when reading from the VFS it will always get the same answer (because I don't think we're updating the VFS at runtime and we either read from the VFS or disk). Hence I think we can zero them. But that's just a gut feel.
Yes, it will be the same—but non-zero—answer. It would change only when you modify
referenced this issue
Apr 23, 2018
@hajimehoshi - I'm using a fork that only includes the file contents, not any time-related information: https://github.com/myitcv/gopherjs/blob/edcf4d6ad7d30c37850f3211cc76b9413fc4c128/go.mod#L20