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

fix: remove problematic chmod extract command in npm_package_store in favor of using a custom postinstall #1904

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

gregmagolan
Copy link
Member

@gregmagolan gregmagolan commented Aug 21, 2024

Addresses #1637 (the original issue that brought in chmod -R a+X * as the fix). See Bazel Slack thread https://bazelbuild.slack.com/archives/CEZUUKQ6P/p1723821643734399 for more context.

Changes are visible to end-users: yes

  • Searched for relevant documentation and updated as needed: yes
  • Breaking change (forces users to change their own code or config): for some users yes but unavoidable as this is fixing a blocking bug
  • Suggested release notes appear below: yes

Backing out of the blanket chmod after npm package tarball extract since it can lead to exceeding MAX_ARGS on the command with the glob expansion in npm packages with a very large number of files.

Instead, users should opt-in packages such as [email protected] that have malformed tarball content file permissions and require fixing with chmod with custom_postinstalls. For example,

npm_translate_lock(
    name = "npm",
    custom_postinstalls = {
        "pngjs": "chmod -R a+X *",
    },
    ...

Test plan

  • Covered by existing test cases

CI

Copy link

aspect-workflows bot commented Aug 21, 2024

Test

All tests were cache hits

193 tests (100.0%) were fully cached saving 47s.


Test

e2e/bzlmod

All tests were cache hits

5 tests (100.0%) were fully cached saving 631ms.


Test

e2e/gyp_no_install_script

All tests were cache hits

2 tests (100.0%) were fully cached saving 516ms.


Test

e2e/js_image_oci

All tests were cache hits

1 test (100.0%) was fully cached saving 6s.


Test

e2e/npm_link_package

All tests were cache hits

3 tests (100.0%) were fully cached saving 925ms.


Test

e2e/npm_link_package-esm

All tests were cache hits

3 tests (100.0%) were fully cached saving 925ms.


Test

e2e/npm_translate_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 59ms.


Test

e2e/npm_translate_lock_empty

All tests were cache hits

1 test (100.0%) was fully cached saving 59ms.


Test

e2e/npm_translate_lock_multi

All tests were cache hits

2 tests (100.0%) were fully cached saving 184ms.


Test

e2e/npm_translate_lock_partial_clone

All tests were cache hits

1 test (100.0%) was fully cached saving 55ms.


Test

e2e/npm_translate_lock_replace_packages

All tests were cache hits

3 tests (100.0%) were fully cached saving 770ms.


Test

e2e/npm_translate_lock_subdir_patch

All tests were cache hits

1 test (100.0%) was fully cached saving 167ms.


Test

e2e/npm_translate_package_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 59ms.


Test

e2e/npm_translate_yarn_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 59ms.


Test

e2e/package_json_module

All tests were cache hits

1 test (100.0%) was fully cached saving 507ms.


Test

e2e/pnpm_lockfiles

All tests were cache hits

40 tests (100.0%) were fully cached saving 16s.


Test

e2e/pnpm_workspace

All tests were cache hits

10 tests (100.0%) were fully cached saving 7s.


Test

e2e/pnpm_workspace_rerooted

All tests were cache hits

10 tests (100.0%) were fully cached saving 4s.


Test

e2e/repo_mapping

All tests were cache hits

2 tests (100.0%) were fully cached saving 324ms.


Test

e2e/rules_foo

All tests were cache hits

2 tests (100.0%) were fully cached saving 562ms.


Test

e2e/vendored_node

All tests were cache hits

1 test (100.0%) was fully cached saving 251ms.


Buildifier      Format

@gregmagolan gregmagolan force-pushed the hoist_malformed_package_fix branch 3 times, most recently from 8147457 to ee184a7 Compare August 21, 2024 19:09
Copy link
Member

@jbedard jbedard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an example to some docs somewhere?

@gregmagolan
Copy link
Member Author

Add an example to some docs somewhere?

I thought about adding something to the FAQ but I think the issue with the error message itself is more discoverable anyway. I commented on the bottom of the issue. #1637

@gregmagolan gregmagolan merged commit 4f5ef8c into main Aug 21, 2024
73 checks passed
@gregmagolan gregmagolan deleted the hoist_malformed_package_fix branch August 21, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants