You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Makefile is generated during compilation, for example the ffi-napi package leaves a file node_modules/ffi-napi/build/Makefile on the disk.
This file contains an absolute path on the disk, which is non-deterministic: it depends on the setup of the machine where the installation takes place.
As a result, build systems which do incremental re-build/re-test based on distributed caches (such as Bazel) will have a cache miss when this file gets included in the inputs.
As a workaround, Bazel users must delete the build folder from offending packages in a postinstall step to avoid re-building everything that depends on that package.
"scripts": {
"// ": "we must delete non-deterministic outputs from compiling native packages, or they bust the bazel cache",
"postinstall": "rm -rf node_modules/{deasync,iltorb,node-sass}/build node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__",
}
Instead I think it would be better for node-gyp to clean up its temporary files. (Perhaps a flag can be added for users who want to inspect those files to debug a native compilation)
The text was updated successfully, but these errors were encountered:
I'm buildng on Docker, so the paths are always the same, but the order of some of the dependencies for the Makefile target differs from one build to the next (this example is from better-sqlite3):
A
Makefile
is generated during compilation, for example theffi-napi
package leaves a filenode_modules/ffi-napi/build/Makefile
on the disk.This file contains an absolute path on the disk, which is non-deterministic: it depends on the setup of the machine where the installation takes place.
As a result, build systems which do incremental re-build/re-test based on distributed caches (such as Bazel) will have a cache miss when this file gets included in the inputs.
As a workaround, Bazel users must delete the
build
folder from offending packages in apostinstall
step to avoid re-building everything that depends on that package.Instead I think it would be better for node-gyp to clean up its temporary files. (Perhaps a flag can be added for users who want to inspect those files to debug a native compilation)
The text was updated successfully, but these errors were encountered: