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

Portable copy_dir_contents_to_dir #1246

Merged
merged 3 commits into from
Aug 8, 2024

Conversation

lamcw
Copy link
Contributor

@lamcw lamcw commented Aug 6, 2024

On BSD-based distro/MacOS, using cp -L -R {source}/ ignores files or directories with a leading dot. If users have GNU-based coreutils installed on their BSD/Mac system (via Nix for e.g.), cp -L -R {source}/ would also copy the source directory underneath the target directory, which is not what we want.

This PR changes both the copy_dir_contents_to_dir implementation for BSD and MacOS such that it works regardless of whether user has GNU or BSD coreutils installed.

@lamcw lamcw changed the title Macos portable cp Portable copy_dir_contents_to_dir Aug 6, 2024
Copy link
Member

@jsharpe jsharpe left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@jsharpe jsharpe enabled auto-merge (squash) August 8, 2024 09:37
@jsharpe jsharpe force-pushed the macos-portable-cp branch from 6d1b244 to 164d5a8 Compare August 8, 2024 09:52
@jsharpe jsharpe merged commit 509b5aa into bazel-contrib:main Aug 8, 2024
2 checks passed
@lamcw lamcw deleted the macos-portable-cp branch August 13, 2024 00:37
jsharpe added a commit to jsharpe/rules_foreign_cc that referenced this pull request Aug 23, 2024
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