Skip to content
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

Npm package with broken tarballs leading to "(Permission denied)" error #2026

Open
gregmagolan opened this issue Nov 25, 2024 · 1 comment
Open
Labels
tracking issue This is a tracking issue

Comments

@gregmagolan
Copy link
Member

gregmagolan commented Nov 25, 2024

Some npm packages have malformed tarballs (missing the +x file attr bit on directories) which don't play nicely with Bazel when they are extracted by the rules_js NpmPackageExtract action. See #1637 for more details.

An example error from this issue:

WARNING: Remote Cache: /home/circleci/.cache/bazel/_bazel_circleci/a6e8cb0ce75ceb1ea1faa0cca0b0ae0d/execroot/figma/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/pngjs@7.0.0/node_modules/pngjs/lib/format-normaliser.js (Permission denied)
ERROR: /home/circleci/foobar/BUILD.bazel:11:22: Extracting npm package pngjs@7.0.0 failed: IOException while logging spawn: /home/circleci/.cache/bazel/_bazel_circleci/a6e8cb0ce75ceb1ea1faa0cca0b0ae0d/execroot/figma/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/pngjs@7.0.0/node_modules/pngjs/lib/bitmapper.js (Permission denied)

The work-around for these npm packages is to add custom_postinstall scripts for each with chmod -R a+X * or chmod -R a+X * && <other custom postinstall steps> to the npm_translate_lock repository rule / bzlmod extension.

This issue is here for users to share all of the package that this problem has been observed on where this work-around may be needed.

@gregmagolan gregmagolan added the tracking issue This is a tracking issue label Nov 25, 2024
@gregmagolan
Copy link
Member Author

@rahul-roy-glean listed a number of them in this comment #1637 (comment):

custom_postinstalls = {
        "pngjs": "chmod -R a+X *",
        "websocket-extensions": "chmod -R a+X *",
        "pretty-format": "chmod -R a+X *",
        "readdirp": "chmod -R a+X *",
        "serve-static": "chmod -R a+X *",
        "serialize-javascript": "chmod -R a+X *",
        "supports-preserve-symlinks-flag": "chmod -R a+X *",
        "strip-final-newline": "chmod -R a+X *",
        "webpack-dev-server": "chmod -R a+X *",
        "tapable": "chmod -R a+X *",
        "statuses": "chmod -R a+X *",
        "@nivo/legends": "chmod -R a+X *",
        "@lingui/react": "chmod -R a+X *",
        "license-webpack-plugin": "chmod -R a+X *",
        "command-exists-promise": "chmod -R a+X *",
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracking issue This is a tracking issue
Projects
None yet
Development

No branches or pull requests

1 participant