Skip to content
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

Binary checksum different after each rebuild. #597

Closed
indieisaconcept opened this issue Mar 22, 2015 · 6 comments
Closed

Binary checksum different after each rebuild. #597

indieisaconcept opened this issue Mar 22, 2015 · 6 comments

Comments

@indieisaconcept
Copy link

I've been trying to track down what would cause a rebuild to generate a binary with a different checksum. No files have changed and yet each time a rebuild is done it's different.

I suspect a compile time timestamp or similar in being included within the result.

Is anyone aware of an argument I can specify to prevent this behaviour?

@indieisaconcept
Copy link
Author

Further research has resulted in the possible use of the argument -frandom-seed=string. I'll give this a go - all going well I will close.

http://stackoverflow.com/questions/4140329/binary-object-file-changing-in-each-build

@indieisaconcept
Copy link
Author

I was hoping the following would work but seems to have no bearing on the output. It is included though as an argument.

  "xcode_settings": {
    ....
    "OTHER_CFLAGS":["-frandom-seed=0"]
    ....
  }

@rvagg
Copy link
Member

rvagg commented Jun 20, 2019

closing due to staleness, reproducable builds would be cool but I think there's a ton of work to do in the entire node toolchain, V8 possibly being the most difficult.

@rvagg rvagg closed this as completed Jun 20, 2019
@Globegitter
Copy link

@rvagg This also just came up today on a discussion around integration with Bazel (https://bazel.build/) which works with sha256 sums of binaries and actions for caching and incrementality. Running yarn install twice with the same yarn.lock does indeed create a binary with different checksums, which invalidates the cache but also in the end creates docker images with different checksums, also making them reuploaded etc, even if nothing as changed. I think it is worth keeping this open or at the very least link any issues from further down the node toolchan.

@Globegitter
Copy link

Globegitter commented Jun 28, 2019

Seems nodejs/build#589 and mapbox/node-pre-gyp#136 is related. Also some mention of build reproducability here: nodejs/node#21897

@refack
Copy link
Contributor

refack commented Jun 28, 2019

@Globegitter, do you have any leads as to where does the entropy come from? AFAICT node-gyp does create identical build files so it seems like the variability stems from the compiler/linked tools. Also did anyone happen to track this behavior across multiple platforms and compilers (Mac/Linux/Win X GCC/Clang/MSVC)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants