Skip to content

vfsgendev updates modification times #804

Open
@myitcv

Description

@myitcv

@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 to github.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 two fs_vfsdata.go files in addition to the expected content change in js/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 subsequent diff -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:

cd `mktemp -d`
export GOPATH=$PWD
go get github.com/shurcooL/vfsgen/cmd/vfsgendev
go get github.com/gopherjs/gopherjs
cd src/github.com/gopherjs/gopherjs/
npm install
go generate ./...
git status --porcelain

gives the output:

 M compiler/gopherjspkg/fs_vfsdata.go
 M compiler/natives/fs_vfsdata.go

What do you think is the best way forward here?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions