markbates / pkger

Embed static files in Go binaries (replacement for gobuffalo/packr)
MIT License
1.19k stars 60 forks source link

Non deterministic output #130

Open zdebra opened 4 years ago

zdebra commented 4 years ago

Hello, I've run into the CLI stability issue.

I am using pkger in a project workflow where the pkger output is committed to the repository. Then, I run the Pull Request check to verify that developer run the command before PR was made.

The problem is that the output of the pkger is not always the same as you can see in the following image: image

I am sure that pkger.go is not a part of /resources directory. There is just a bunch of static assets in the packaged directory.

Do you know what is the issue here? Thank you.

creker commented 4 years ago

The reason is because pkger includes a bunch of metadata (in my opinion completely useless) that can easily change between calls. What you would have to do is hash actual files content instead of whole pkged.go That's how I implemented the same check in my project.

Zikoel commented 4 years ago

This sounds weird! What are these metadata that are not deterministic?

phanirithvij commented 4 years ago

@Zikoel I see LastAccessTime for all files, StaleReason etc.