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

copy_file doesn't work for directories #322

Closed
alexeagle opened this issue Oct 9, 2021 · 2 comments
Closed

copy_file doesn't work for directories #322

alexeagle opened this issue Oct 9, 2021 · 2 comments
Labels
P3 We're not considering to work on this, but happy to review a PR. (No assignee) type: feature request

Comments

@alexeagle
Copy link
Contributor

There should be a way to copy directories, just like we copy files.

It would use ctx.actions.declare_directory so that Bazel tracks the result as a TreeArtifact.

We need this in rules_nodejs for example, because third-party packages are always on disk as directories, and globbing them as a bunch of files runs into filename restrictions (spaces in names) and is very non-performant (thousands of files to symlink into execroot/runfiles trees).

Another reasoning for this: RBE doesn't allow InputArtifacts that are directories (see @ulfjack's note on bazelbuild/bazel@c64421b) so it's necessary to copy them as TreeArtifacts to use them in remote-compatible actions.

alexeagle added a commit to alexeagle/bazel-skylib that referenced this issue Oct 9, 2021
alexeagle added a commit to alexeagle/bazel-skylib that referenced this issue Oct 9, 2021
alexeagle added a commit to alexeagle/bazel-skylib that referenced this issue Oct 9, 2021
alexeagle added a commit to alexeagle/bazel-skylib that referenced this issue Oct 9, 2021
alexeagle added a commit to alexeagle/bazel-skylib that referenced this issue Oct 9, 2021
alexeagle added a commit to alexeagle/bazel-skylib that referenced this issue Oct 9, 2021
alexeagle added a commit to alexeagle/bazel-skylib that referenced this issue Oct 9, 2021
@tetromino tetromino added P3 We're not considering to work on this, but happy to review a PR. (No assignee) type: feature request labels Jan 10, 2022
@bsilver8192
Copy link

I ran across this, it looks like it's been implemented with copy_directory.

@tetromino
Copy link
Collaborator

Thanks for the reminder! This was fixed by #366 - but we forgot to close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering to work on this, but happy to review a PR. (No assignee) type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants