-
Notifications
You must be signed in to change notification settings - Fork 179
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 allows directories as well #323
Conversation
4e86ba4
to
bbd442b
Compare
bbd442b
to
437b878
Compare
bazelbuild/bazel-skylib#323 is patched into our vendored copy of copy_file rule. That lets a tsc action run with just four inputs: [a.ts, bazel-out/host/bin/external/npm_typescript-3.5.3/out, external/bazel_tools/tools/genrule/genrule-setup.sh, external/node16_linux_amd64/bin/nodejs/bin/node] This is obviously not ergonomic for users yet, just a step in the right direction.
bazelbuild/bazel-skylib#323 is patched into our vendored copy of copy_file rule. That lets a tsc action run with just four inputs: [a.ts, bazel-out/host/bin/external/npm_typescript-3.5.3/out, external/bazel_tools/tools/genrule/genrule-setup.sh, external/node16_linux_amd64/bin/nodejs/bin/node] This is obviously not ergonomic for users yet, just a step in the right direction.
bazelbuild/bazel-skylib#323 is patched into our vendored copy of copy_file rule. That lets a tsc action run with just four inputs: [a.ts, bazel-out/host/bin/external/npm_typescript-3.5.3/out, external/bazel_tools/tools/genrule/genrule-setup.sh, external/node16_linux_amd64/bin/nodejs/bin/node] This is obviously not ergonomic for users yet, just a step in the right direction.
bazelbuild/bazel-skylib#323 is patched into our vendored copy of copy_file rule. That lets an action run with minimal inputs. This is obviously not ergonomic for users yet, just a step in the right direction.
bazelbuild/bazel-skylib#323 is patched into our vendored copy of copy_file rule. That lets an action run with minimal inputs. This is obviously not ergonomic for users yet, just a step in the right direction.
bazelbuild/bazel-skylib#323 is patched into our vendored copy of copy_file rule. That lets an action run with minimal inputs. This is obviously not ergonomic for users yet, just a step in the right direction.
@brandjon @tetromino do you have any feedback on this PR? I believe this will help unblock using rules_nodejs with remote build execution, which would be really nice to see! |
Ping! Is anyone triaging PRs in this repo? |
# https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/copy | ||
# https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy | ||
if dst.is_directory: | ||
cmd_tmpl = "@xcopy \"%s\" \"%s\\\" /V /E /H /Y /Q >NUL" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use /v for xcopy, but not for copy?
Why delete the destination directory in the bash version, but not in the Windows version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall - looks good; thank you for the patch!
However, I would prefer a separate copy_directory rule: less confusing name (files aren't directories), no confusing interaction between is_directory and allow_symlinks flags, more noticeable documentation of -DBAZEL_TRACK_SOURCE_DIRECTORIES.
The one new test is insufficient. Scenarios we'd probably want to test:
- copying an empty directory
- copying a directory whose content includes a symlink
- copying a directory to a location which is an existing file
- copying a directory to a location which is an existing directory
replaced by #366 |
Fixes #322