-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Non-deterministic temporary files left in node_modules #2612
Labels
Comments
4 tasks
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): < Makefile: $(srcdir)/binding.gyp $(srcdir)/deps/defines.gypi $(srcdir)/../../../../local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/deps/sqlite3.gyp $(srcdir)/../../../../../root/.cache/node-gyp/18.16.1/include/node/common.gypi $(srcdir)/deps/common.gypi
---
> Makefile: $(srcdir)/build/config.gypi $(srcdir)/deps/sqlite3.gyp $(srcdir)/deps/defines.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/../../../../../root/.cache/node-gyp/18.16.1/include/node/common.gypi $(srcdir)/deps/common.gypi So even keeping your paths the same doesn't make this deterministic. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: