lemon-noon-33245
04/24/2023, 8:17 PMadhoc_tool
to install our node dependencies using pnpm
while javascript support is not yet ready. I’m having some issues with post-install scripts in core-js
and cpu-features
. Has anyone faced anything like that and have any tips for me?wide-midnight-78598
04/24/2023, 8:22 PMlemon-noon-33245
04/24/2023, 8:25 PMsystem_binary
says it can’t find it in my path.lemon-noon-33245
04/24/2023, 8:25 PMcore-js
failing without any reason really. 😐lemon-noon-33245
04/24/2023, 8:25 PMfiles(
name = "package-config",
dependencies = [],
sources = [
"package.json",
"pnpm-workspace.yaml",
"pnpm-lock.yaml",
".npmrc",
],
)
# Require node 18
system_binary(
name = "node",
binary_name = "node",
extra_search_paths = [env("HOME") + "/.nvm/versions/node/v18.12.0/bin"],
fingerprint = r"v18.12.0",
fingerprint_args = ["--version"],
)
# system_binary(
# name = "node-gyp",
# binary_name = "node-gyp.js",
# extra_search_paths = [env("HOME") + "/.nvm/versions/node/v18.12.0/lib/node_modules/node-gyp/bin"],
# )
# Require pnpm v8
system_binary(
name = "pnpm",
binary_name = "pnpm",
extra_search_paths = [env("HOME") + "/.nvm/versions/node/v18.12.0/bin"],
fingerprint = r"8\..*\..*",
fingerprint_args = ["--version"],
fingerprint_dependencies = [":node"],
)
# Fetch the dependencies and produce a `node_modules` directory
adhoc_tool(
name = "node-modules",
timeout = 300,
args = ["install"],
execution_dependencies = [":package-config"],
output_dependencies = [":package-config"],
output_directories = ["node_modules"],
runnable = ":pnpm",
runnable_dependencies = [
":node",
":node-gyp",
],
)
lemon-noon-33245
04/24/2023, 10:16 PMbroad-processor-92400
04/24/2023, 10:44 PMlemon-noon-33245
04/24/2023, 10:47 PM.../core-js@2.6.12/node_modules/core-js postinstall$ node -e "try{require('./postinstall')}catch(e){}"
undefined
ELIFECYCLE Command failed with exit code -2.
stderr:
lemon-noon-33245
04/24/2023, 10:48 PMlemon-noon-33245
04/24/2023, 10:49 PMpnpm build
instead of a pnpm next build
. Instead of showing me the output coming from next (which was that it can’t find sed
, uname
and dirname
in the sandbox) it just showed me an exit code -2broad-processor-92400
04/24/2023, 11:01 PMsh
in the sandbox for some of our npm installs, that might include core-js… so maybe yet another system binary would help 🤷♂️
More generally, are you aware of the —`keep-sandboxes=on_failure` arg to pants? It gives you the sandbox and command (in __run.sh) that pants executed to introspect/debug… although if you’re unblocked, that might not be needed for nowlemon-noon-33245
04/24/2023, 11:09 PMsh
was indeed the culprit!lemon-noon-33245
04/24/2023, 11:10 PMlemon-noon-33245
04/24/2023, 11:11 PMMore generally, are you aware of the —`keep-sandboxes=on_failure` arg to pants? It gives you the sandbox and command (in __run.sh) that pants executed to introspect/debug… although if you’re unblocked, that might not be needed for nowYeah, I’m aware! It’s been a lifesaver when it comes to these mysterious pnpm errors
broad-processor-92400
04/25/2023, 12:45 AMlemon-noon-33245
04/25/2023, 1:10 PMbuild-essential
but with a few common bash tools like dirname
, sed
and uname
.