-
Notifications
You must be signed in to change notification settings - Fork 570
vfsgendev updates modification times #804
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
Comments
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
There are two PRs that I'm working on where this becomes relevant: #618 and #790. Not critical, just pointing out how I came across this given the change introduced in #787.
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.
The new |
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 |
What's the current status on this? I confirmed that reproduceable build results would make us happy. |
The comments above accurately reflect the current status. There hasn't been new progress made since then. |
@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 |
Uh oh!
There was an error while loading. Please reload this page.
@shurcooL I just got caught out using
vfsgendev
and I wonder whether you can help advise how best to fix this.I forgot that post #787 a
go generate
is required after any changes togithub.com/gopherjs/gopherjs/js
. Indeed the CI build didn't give me any clues either; my test just failed for an innocuous reason.After running
go generate github.com/gopherjs/gopherjs/...
I got a load of modification time changes in the twofs_vfsdata.go
files in addition to the expected content change injs/js.go
. Am I right in thinking this is because the modification times are taken from the files on disk?What would seem ideal here would be that we run
go generate github.com/gopherjs/gopherjs/...
as one of the first steps in CI so that the subsequentdiff -u <(echo -n) <(git status --porcelain)
can help us catch when we've forgotten to regenerate anything. We are already running a generate step for the prelude for this exact reason.But I think this requires some changes in
vfsgendev
or at least the way we are using it in GopherJS. The following repro is another way of demonstrating the issue:gives the output:
What do you think is the best way forward here?
Thanks
The text was updated successfully, but these errors were encountered: