Skip to content

Commit

Permalink
Update on "use-pt-pinned-commit for test-arm-{backend,reference}-dele…
Browse files Browse the repository at this point in the history
…gation"

Without this, these builds don't respect the torchgen pinned commit and thus fail with #7546.

Differential Revision: [D67996459](https://our.internmc.facebook.com/intern/diff/D67996459/)

[ghstack-poisoned]
  • Loading branch information
Github Executorch committed Jan 11, 2025
2 parents 1774946 + 8d175a2 commit bda857d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion build/build_apple_frameworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ echo "Exporting headers"
mkdir -p "$HEADERS_PATH"

# Set BUCK2 to the path of the buck2 executable in $OUTPUT/*/buck2-bin/buck2-*
BUCK2=$(find . -type f -path '*/buck2-bin/buck2-*' | head -n 1)
BUCK2=$(find $SOURCE_ROOT_DIR -type f -path '*/buck2-bin/buck2-*' | head -n 1)
if [[ -z "$BUCK2" ]]; then
echo "Could not find buck2 executable in any buck2-bin directory under $OUTPUT"
BUCK2=$(which buck2)
Expand All @@ -201,6 +201,20 @@ check_command "$BUCK2"
//extension/tensor: \
| rsync -av --files-from=- "$SOURCE_ROOT_DIR" "$HEADERS_PATH/executorch"

# HACK: XCFrameworks don't appear to support exporting any build
# options, but we need the following:
# - runtime/core/portable/type/c10 reachable with `#include <c10/...>`
# - exported -DC10_USING_CUSTOM_GENERATED_MACROS compiler flag
# So, just patch our generated framework to do that.
sed -i '' '1i\
#define C10_USING_CUSTOM_GENERATED_MACROS
' $SOURCE_ROOT_DIR/runtime/core/portable_type/c10/macros/Macros.h
sed -i '' '1i\
#define C10_USING_CUSTOM_GENERATED_MACROS
' $SOURCE_ROOT_DIR/runtime/core/portable_type/c10/macros/Export.h
cp -r $SOURCE_ROOT_DIR/runtime/core/portable_type/c10 "$HEADERS_PATH/"


cp "$SOURCE_ROOT_DIR/extension/apple/ExecuTorch/Exported/"*.h "$HEADERS_PATH/executorch"
cp "$SOURCE_ROOT_DIR/extension/apple/ExecuTorch/Exported/"*.modulemap "$HEADERS_PATH"

Expand Down

0 comments on commit bda857d

Please sign in to comment.