Skip to content

[Bug]: Indeterministic npm_import packages with node-gyp #2302

@joeljeske-figma

Description

@joeljeske-figma

What happened?

NPM Packages using node-gyp will always yield an indeterministic file build/Makefile in the resulting package after lifecycle hooks are run, with node versions that do not include this recent change nodejs/gyp-next#293.

Whereas node-gyp isn't straightforward in making all outputs deterministic, this common failure mode could be fixed by simply deleting this Makefile after the package install is completed.

I'd be happy to submit a PR for this case, but wanted wanted to first clarify if this change would be accepted, and if the proper location would be in the node-gyp-bin shims or perhaps the bundle lifecycle-hooks script.

Version

Development (host) and target OS/architectures: linux

Output of bazel --version: bazel 8.3.1

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file: 2.3.8

Language(s) and/or frameworks involved: node 22.10.0

How to reproduce

Add a npm_import for unix-dgram and see build/Makefile contain different results

Any other information?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions