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

Optimise copying of data inputs in npm_install and yarn_install #41

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

Silic0nS0ldier
Copy link
Contributor

repository_ctx.___ actions (e.g. spawning a process, working with files) are very slow vs. most other environments. To optimise copying data dependencies this PR refactors _copy_data_dependencies to;

  1. Create an input files list and write it to a file (avoids the argument length limits).
  2. Performs copy in a shell script using tar.

tar was selected as;

  • Easy to preserve the desired directory structure (BSD cp only does this for directory copying, GNU cp can via --parents).
  • Built in support for an inputs list via --files-from.

rsync would likely represent a more optimal solution, however I'm not very familiar with it. It may make sense as a follow up if there is sufficient room for improvement.

Copy link
Member

@christianscott christianscott left a comment

Choose a reason for hiding this comment

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

LGTM

@Silic0nS0ldier Silic0nS0ldier merged commit f26a72c into main Dec 4, 2023
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