Skip to content

src: reset `process.versions` during pre-execution

Reset process.versions during pre-execution so that it reflects the versions at run-time rather than when the snapshot was taken.

Fixes: https://github.com/nodejs/node/pull/51007#issuecomment-1836825122


I'm not sure there's an easy way to test this currently in the CI -- it requires Node.js to be built against a dynamically linked library (e.g. zlib[1]) at one version and then run against a different, ABI-compatible version so that the snapshot has one version of the dependency recorded but Node.js is actually running with a different one.

cc @joyeecheung -- re. https://github.com/nodejs/node/pull/51007#issuecomment-1837028324 -- it seemed easier to reset the entire process.versions object rather than checking each individual entry (and also meant I could extract and reuse the setting code).

[1]: OpenSSL would be another, but there's a separate bug with obtaining the version of OpenSSL that I'll open another PR for.

Merge request reports

Loading