Skip to content

Commit

Permalink
Fix Codegen build script on EdenFS
Browse files Browse the repository at this point in the history
Summary:
Fixes running the `build.sh` script for `react-native-codegen` when on [EdenFS](https://github.com/facebook/sapling). This would previously fail due a filesystem "unable to copy extended attributes" error.

NOTE: The change from `mv` to `cp -R` makes this script more expensive, which will make Android builds via Gradle take slightly longer. I have a WIP cleanup planned which will 1/ move `react-native-codegen` to the [shared monorepo build setup](facebook#38718), and 2/ drop this step entirely from the Android Gradle build.

Differential Revision: D49230445
  • Loading branch information
huntie authored and facebook-github-bot committed Sep 13, 2023
1 parent eddefec commit 9a072aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/react-native-codegen/scripts/oss/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ else
if [ "$OSTYPE" = "msys" ] || [ "$OSTYPE" = "cygwin" ]; then
tar cf - --exclude='*.lock' "$CODEGEN_DIR" | (cd "$TMP_DIR" && tar xvf - );
else
cp -R "$CODEGEN_DIR/." "$TMP_DIR";
cp -R -X "$CODEGEN_DIR/." "$TMP_DIR";
fi

pushd "$TMP_DIR" >/dev/null
Expand All @@ -56,6 +56,7 @@ else

popd >/dev/null

mv "$TMP_DIR/lib" "$TMP_DIR/node_modules" "$CODEGEN_DIR"
cp -R -X "$TMP_DIR/lib" "$CODEGEN_DIR"
cp -R -X "$TMP_DIR/node_modules" "$CODEGEN_DIR"
rm -rf "$TMP_DIR"
fi

0 comments on commit 9a072aa

Please sign in to comment.