Skip to content

node_code_cache.cc and node_snapshot.cc generation is unreproducible #29108

Closed
@ChALkeR

Description

@ChALkeR

Refs: nodejs/build#589

Currently, performing these steps on Linux:

  1. Download source https://nodejs.org/dist/latest/node-v12.8.0.tar.xz (or some other version)
  2. Extract the archive to /tmp/node-v12.8.0, build once with default configuration, rename the dir to /tmp/node-v12.8.0-1
  3. Extract the archive to /tmp/node-v12.8.0, build again with default configuration, rename the dir to /tmp/node-v12.8.0-2.
  4. Diff the two folders with diff -qr /tmp/node-v12.8.0-1 /tmp/node-v12.8.0-2.

Produces this result:

Files node-v12.8.0-1/node and node-v12.8.0-2/node differ
Files node-v12.8.0-1/out/Release/node and node-v12.8.0-2/out/Release/node differ
Files node-v12.8.0-1/out/Release/obj/gen/node_code_cache.cc and node-v12.8.0-2/out/Release/obj/gen/node_code_cache.cc differ
Files node-v12.8.0-1/out/Release/obj/gen/node_snapshot.cc and node-v12.8.0-2/out/Release/obj/gen/node_snapshot.cc differ
Files node-v12.8.0-1/out/Release/obj.target/node/gen/node_code_cache.o and node-v12.8.0-2/out/Release/obj.target/node/gen/node_code_cache.o differ
Files node-v12.8.0-1/out/Release/obj.target/node/gen/node_snapshot.o and node-v12.8.0-2/out/Release/obj.target/node/gen/node_snapshot.o differ

Note: it is important to extract from archive (to preserve the same modification timestamps) and build it from the same path, at least at this moment.

Note: on macOS, the diff is larger due to something unreproducible happening on the linker stage, let's check on Linux only for now. But on macOS, node_code_cache.cc and node_snapshot.cc generation is also affected.

That blocks reproducible builds afaik, and it at the first glance seems to be the only major cause behind mismatching binaries produced in the same environment with the process above.

Those files differ in generated array contents.
Perhaps someone knows what exactly is going on there?

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to build files or the CI.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions