From 14d23b7e4890e0f6b903011eaec756f5dee0d28d Mon Sep 17 00:00:00 2001 From: Danny Povolotski Date: Wed, 15 Jul 2026 01:35:26 +0300 Subject: [PATCH 1/3] avoid copying extended file attributes when inside virtiofs --- packages/react-native-codegen/scripts/oss/build.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/react-native-codegen/scripts/oss/build.sh b/packages/react-native-codegen/scripts/oss/build.sh index 64c22f5a0a64..170471b865a7 100755 --- a/packages/react-native-codegen/scripts/oss/build.sh +++ b/packages/react-native-codegen/scripts/oss/build.sh @@ -24,7 +24,12 @@ fi YARN_BINARY="${YARN_BINARY:-$YARN_OR_NPM}" # mv command to use when copying files into the working directory -EDEN_SAFE_MV="mv" +SAFE_MV="mv" + +# Detect if we are on a VirtioFS volume via Apple Virtualization.framework +if /sbin/mount | /usr/bin/awk -v dev="$(/bin/df -P "$CODEGEN_DIR" | /usr/bin/awk 'NR==2 {print $1}')" '$1 == dev && /AppleVirtIOFS/' >/dev/null; then + SAFE_MV="/bin/cp -R -X" +fi if [ -x "$(command -v eden)" ]; then pushd "$THIS_DIR" @@ -32,7 +37,7 @@ if [ -x "$(command -v eden)" ]; then # Detect if we are in an EdenFS checkout with `eden info` (we ignore the output as it creates noise on CI/IDE logs) # Also be sure to use /bin/cp in case users have GNU coreutils installed which is incompatible with -X if [[ "$OSTYPE" == "darwin"* ]] && eden info 2>/dev/null; then - EDEN_SAFE_MV="/bin/cp -R -X" + SAFE_MV="/bin/cp -R -X" fi popd >/dev/null @@ -71,7 +76,7 @@ else popd >/dev/null - $EDEN_SAFE_MV "$TMP_DIR/lib" "$CODEGEN_DIR" - $EDEN_SAFE_MV "$TMP_DIR/node_modules" "$CODEGEN_DIR" + $SAFE_MV "$TMP_DIR/lib" "$CODEGEN_DIR" + $SAFE_MV "$TMP_DIR/node_modules" "$CODEGEN_DIR" rm -rf "$TMP_DIR" fi From 8f78f899b8e480d9491726fe2784a768bc22e823 Mon Sep 17 00:00:00 2001 From: Danny Povolotski Date: Wed, 15 Jul 2026 01:51:29 +0300 Subject: [PATCH 2/3] fix the if check always resolving as true --- packages/react-native-codegen/scripts/oss/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-codegen/scripts/oss/build.sh b/packages/react-native-codegen/scripts/oss/build.sh index 170471b865a7..15b206634686 100755 --- a/packages/react-native-codegen/scripts/oss/build.sh +++ b/packages/react-native-codegen/scripts/oss/build.sh @@ -27,7 +27,7 @@ YARN_BINARY="${YARN_BINARY:-$YARN_OR_NPM}" SAFE_MV="mv" # Detect if we are on a VirtioFS volume via Apple Virtualization.framework -if /sbin/mount | /usr/bin/awk -v dev="$(/bin/df -P "$CODEGEN_DIR" | /usr/bin/awk 'NR==2 {print $1}')" '$1 == dev && /AppleVirtIOFS/' >/dev/null; then +if /sbin/mount | /usr/bin/awk -v dev="$(/bin/df -P "$CODEGEN_DIR" | /usr/bin/awk 'NR==2 {print $1}')" '$1 == dev && /AppleVirtIOFS/ { found=1 } END { exit !found }'; then SAFE_MV="/bin/cp -R -X" fi From 6a846d843080559ba36a6fc90e0cfebdfbc8320f Mon Sep 17 00:00:00 2001 From: Danny Povolotski Date: Wed, 15 Jul 2026 02:06:30 +0300 Subject: [PATCH 3/3] Only check for virtiofs on MacOS --- packages/react-native-codegen/scripts/oss/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-codegen/scripts/oss/build.sh b/packages/react-native-codegen/scripts/oss/build.sh index 15b206634686..b390da38098f 100755 --- a/packages/react-native-codegen/scripts/oss/build.sh +++ b/packages/react-native-codegen/scripts/oss/build.sh @@ -27,7 +27,7 @@ YARN_BINARY="${YARN_BINARY:-$YARN_OR_NPM}" SAFE_MV="mv" # Detect if we are on a VirtioFS volume via Apple Virtualization.framework -if /sbin/mount | /usr/bin/awk -v dev="$(/bin/df -P "$CODEGEN_DIR" | /usr/bin/awk 'NR==2 {print $1}')" '$1 == dev && /AppleVirtIOFS/ { found=1 } END { exit !found }'; then +if [[ "$OSTYPE" == "darwin"* ]] && /sbin/mount | /usr/bin/awk -v dev="$(/bin/df -P "$CODEGEN_DIR" | /usr/bin/awk 'NR==2 {print $1}')" '$1 == dev && /AppleVirtIOFS/ { found=1 } END { exit !found }'; then SAFE_MV="/bin/cp -R -X" fi