Skip to content

[FR]: Add an example that skips node-gyp installs #178

@Aghassi

Description

@Aghassi

What is the current behavior?

Post install hooks can fail with pnpm. One that I ran into was

❯ bazel test //bazel/release/internal/pusher:test
INFO: Invocation ID: f430ce78-99c5-461c-84f5-b135bd3fc6e5
INFO: Analyzed target //bazel/release/internal/pusher:test (2296 packages loaded, 35938 targets configured).
INFO: Found 1 test target...
ERROR: /Users/davidaghassi/robinhood/rh_other_alt/bazel/release/internal/pusher/BUILD.bazel:9:22: Running lifecycle hooks on npm package cpu-features@0.0.4 failed: (Exit 1): lifecycle-hooks.sh failed: error executing command (from target //bazel/release/internal/pusher:.aspect_rules_js/node_modules/cpu-features@0.0.4/lc) bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/aspect_rules_js/npm/private/lifecycle/lifecycle-hooks.sh cpu-features ../../../external/pusher_pnpm_deps__cpu-features__0.0.4/package ... (remaining 1 argument skipped)
/private/var/tmp/_bazel_davidaghassi/299af5c32fa95b8ba15b1237ac8646db/execroot/rh/bazel-out/darwin_arm64-fastbuild/bin/external/aspect_rules_js/npm/private/lifecycle/min/node-gyp-bin/node-gyp: line 5: 1211: command not found

> cpu-features@0.0.4 install /private/var/tmp/_bazel_davidaghassi/299af5c32fa95b8ba15b1237ac8646db/execroot/rh/bazel-out/darwin_arm64-fastbuild/bin/bazel/release/internal/pusher/node_modules/.aspect_rules_js/cpu-features@0.0.4/node_modules/cpu-features
> node buildcheck.js > buildcheck.gypi && node-gyp rebuild

===============================================================
Failure while running lifecycle hook for package 'cpu-features@0.0.4':

  Script:  'install'
  Command: `node buildcheck.js > buildcheck.gypi && node-gyp rebuild`

Stack trace:

spawn ENOENT
    at ChildProcess.<anonymous> (/private/var/tmp/_bazel_davidaghassi/299af5c32fa95b8ba15b1237ac8646db/execroot/rh/bazel-out/darwin_arm64-fastbuild/bin/external/aspect_rules_js/npm/private/lifecycle/min/index.min.js:1:91930)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
===============================================================

having docs/example/suggestion on how to solve this would make error handling better.

Describe the feature

Adding this fix pnpm/pnpm#4347 (comment) to my package.json resolved my issue and let me continue building/testing.

The reason this is hard to troubleshoot is because outside of bazel, running pnpm i works fine.

Fund our work

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationexampleNew example or update to existing examplehelp wantedAspect isn't prioritizing this, but the community could

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions