-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Allow react-native and expo to build when using GNU coreutils #35382
Conversation
Base commit: 2d1d61a |
Base commit: 2d1d61a |
PR build artifact for ea27953 is ready. |
PR build artifact for ea27953 is ready. |
Can you please fix the CLA? Also you can you please clarify why this is needed. We're copying a folder, I'm not sure we want to copy |
@cortinico - Here's a quick summary of how BSD cp (default on macOS) and GNU cp (default on Linux and often used on macOS) behave with the # setup
mkdir -p /tmp/cp/{bad,fix}/{bsd,gnu}/{src,dst}
touch /tmp/cp/{bad,fix}/{bsd,gnu}/src/{1,2,3,4}.txt
# Starting point, with all files in their 'src' directory:
tree /tmp/cp
/tmp/cp
├── bad
│ ├── bsd
│ │ ├── dst
│ │ └── src
│ │ ├── 1.txt
│ │ ├── 2.txt
│ │ ├── 3.txt
│ │ └── 4.txt
│ └── gnu
│ ├── dst
│ └── src
│ ├── 1.txt
│ ├── 2.txt
│ ├── 3.txt
│ └── 4.txt
└── fix
├── bsd
│ ├── dst
│ └── src
│ ├── 1.txt
│ ├── 2.txt
│ ├── 3.txt
│ └── 4.txt
└── gnu
├── dst
└── src
├── 1.txt
├── 2.txt
├── 3.txt
└── 4.txt
14 directories, 16 files
# bad method (uses "src/")
gnu-cp -R /tmp/cp/bad/gnu/src/ /tmp/cp/bad/gnu/dst
bsd-cp -R /tmp/cp/bad/bsd/src/ /tmp/cp/bad/bsd/dst
# fix method (uses "src/.")
gnu-cp -R /tmp/cp/fix/gnu/src/. /tmp/cp/fix/gnu/dst
bsd-cp -R /tmp/cp/fix/bsd/src/. /tmp/cp/fix/bsd/dst
# Show result, see how gnu/src was copied to gnu/dst/src
# But, using "src/." works for both gnu and bsd
tree /tmp/cp
/tmp/cp
├── bad
│ ├── bsd
│ │ ├── dst
│ │ │ ├── 1.txt
│ │ │ ├── 2.txt
│ │ │ ├── 3.txt
│ │ │ └── 4.txt
│ │ └── src
│ │ ├── 1.txt
│ │ ├── 2.txt
│ │ ├── 3.txt
│ │ └── 4.txt
│ └── gnu
│ ├── dst
│ │ └── src
│ │ ├── 1.txt
│ │ ├── 2.txt
│ │ ├── 3.txt
│ │ └── 4.txt
│ └── src
│ ├── 1.txt
│ ├── 2.txt
│ ├── 3.txt
│ └── 4.txt
└── fix
├── bsd
│ ├── dst
│ │ ├── 1.txt
│ │ ├── 2.txt
│ │ ├── 3.txt
│ │ └── 4.txt
│ └── src
│ ├── 1.txt
│ ├── 2.txt
│ ├── 3.txt
│ └── 4.txt
└── gnu
├── dst
│ ├── 1.txt
│ ├── 2.txt
│ ├── 3.txt
│ └── 4.txt
└── src
├── 1.txt
├── 2.txt
├── 3.txt
└── 4.txt
15 directories, 32 files |
@cortinico - You are right, that second "/." isn't needed. But, the first one is critical for copying to work correctly across BSD and GNU versions of the |
PR build artifact for 57d6e1b is ready. |
PR build artifact for 57d6e1b is ready. |
/rebase |
See the issue at facebook#32432 (comment) This fixes a bizarre issue when using the GNU coreutils tools. There are very minor changes in the standard command-line tools on macOS and the GNU coreutils. The `cp` command has slightly different semantics across these operating systems, so this commit normalizes those differences and allows GNU coreutils to be used or the system native version of `cp`.
1be4a05
to
d240dbc
Compare
Should be synced up now 👍🏻 |
Great 👍 Let's wait for a CI run and we can import/merge it |
PR build artifact for d240dbc is ready. |
PR build artifact for d240dbc is ready. |
@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @shreeve in f5e5274. When will my fix make it into a release? | Upcoming Releases |
Summary: See the issue at #32432 (comment) This fixes a bizarre issue when using the GNU coreutils tools. There are very minor differences in the standard command-line tools on macOS and the GNU coreutils. The `cp` command has slightly different semantics across these operating systems, so this commit normalizes those differences and allows GNU coreutils to be used or the system native version of `cp`. Fixes #32432 ## Changelog [General] [Fixed] - Allow GNU coreutils to be used to build projects Pull Request resolved: #35382 Test Plan: This change allows the use of the system or GNU coreutils verson of `cp`. Reviewed By: cipolleschi Differential Revision: D41532472 Pulled By: cortinico fbshipit-source-id: f0fe5274d3828bf6099deceee797a82a6adfdcab
…ok#35382) Summary: See the issue at facebook#32432 (comment) This fixes a bizarre issue when using the GNU coreutils tools. There are very minor differences in the standard command-line tools on macOS and the GNU coreutils. The `cp` command has slightly different semantics across these operating systems, so this commit normalizes those differences and allows GNU coreutils to be used or the system native version of `cp`. Fixes facebook#32432 ## Changelog [General] [Fixed] - Allow GNU coreutils to be used to build projects Pull Request resolved: facebook#35382 Test Plan: This change allows the use of the system or GNU coreutils verson of `cp`. Reviewed By: cipolleschi Differential Revision: D41532472 Pulled By: cortinico fbshipit-source-id: f0fe5274d3828bf6099deceee797a82a6adfdcab
Summary
See the issue at #32432 (comment)
This fixes a bizarre issue when using the GNU coreutils tools. There are very minor differences in the standard BSD based command-line tools on macOS and the GNU coreutils versions. In particular, the
cp
command has slightly different semantics across these two versions. This commit normalizes those differences and allows the GNU coreutilscp
command to work the same as the BSD version, thus fixing a hard to track down bug.Changelog
[General] [Fixed] - Allow GNU coreutils to be used to build projects
Test Plan
This change allows the use of the system or GNU coreutils verson of
cp
.