Skip to content

Adjust xcodeproj in react-native ios demo to use relative paths on CMake #8522

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

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

sskarz
Copy link
Contributor

@sskarz sskarz commented Feb 18, 2025

Adjust xcodeproj in react-native ios demo to use relative paths on CMake

Summary

This PR updates the Xcode project configuration in the react-native iOS demo to use relative paths for CMake references instead of hard-coded absolute paths. Additionally, the DEVELOPMENT_TEAM setting has been cleared. These changes improve the portability of the project and simplify the setup process for contributors using different environments.

Changes

  • Relative Paths for CMake Toolchain:
    The absolute path to the iOS CMake toolchain:

    -DCMAKE_TOOLCHAIN_FILE="/Users/jh/dev/executorch/third-party/ios-cmake/ios.toolchain.cmake" \
    +DCMAKE_TOOLCHAIN_FILE="$PROJECT_DIR/../../../../../third-party/ios-cmake/ios.toolchain.cmake" \

    This change ensures that the toolchain reference is now relative to the project directory.

  • Relative Paths for Third-party Dependencies:
    Updated the paths for third-party dependencies (abseil-cpp, re2, sentencepiece) from absolute paths like:

    -cmake_build "/Users/jh/dev/executorch/extension/llm/third-party/abseil-cpp" \
    +cmake_build "$PROJECT_DIR/../../../../../extension/llm/third-party/abseil-cpp" \

    This applies similarly to the other dependencies, allowing the project structure to be self-contained.

  • Removal of Hard-coded DEVELOPMENT_TEAM:
    The DEVELOPMENT_TEAM value has been cleared:

    -DEVELOPMENT_TEAM = CLFN2N8XXS;
    +DEVELOPMENT_TEAM = "";

    This lets individual developers configure the appropriate team in their Xcode settings as needed.

Rationale

  • Portability:
    Absolute paths can cause issues when the project is cloned or used in different environments. By switching to relative paths (using $PROJECT_DIR), we ensure that the project can be built regardless of where it is located on a filesystem.

  • Customization:
    Removing the hard-coded DEVELOPMENT_TEAM value allows individual developers to configure their own team settings within Xcode, reducing potential conflicts and build errors.

Testing

  • Tested on macOS Sequoia 15.1 | Conda 24.5.0 | Python 3.10.16

Thank you for reviewing this PR.

cc @shoumikhin @cbilgin

Copy link

pytorch-bot bot commented Feb 18, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/8522

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 843344d with merge base fcb40f1 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link
Contributor

Hi @sskarz!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@sskarz sskarz marked this pull request as draft February 18, 2025 01:31
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 18, 2025
@sskarz sskarz marked this pull request as ready for review February 18, 2025 01:35
@sskarz
Copy link
Contributor Author

sskarz commented Feb 18, 2025

@pytorchbot label "release notes: build"

@pytorch-bot pytorch-bot bot added the release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc. label Feb 18, 2025
@sskarz sskarz marked this pull request as draft February 18, 2025 01:49
@sskarz sskarz marked this pull request as ready for review February 18, 2025 01:52
@swolchok swolchok added triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module module: ios Issues related to iOS code, build, and execution labels Feb 18, 2025
@sskarz sskarz requested a review from kirklandsign as a code owner February 20, 2025 17:43
@orionr
Copy link
Contributor

orionr commented Feb 24, 2025

LGTM - thoughts @shoumikhin ?

@sskarz sskarz force-pushed the relative-paths-react-demo-ios branch from 3d84fb0 to 86c8dd6 Compare February 24, 2025 20:36
@sskarz
Copy link
Contributor Author

sskarz commented Feb 24, 2025

Why did the test fail here? Is there anything I need to do on my side to get this merged?

@mergennachin
Copy link
Contributor

Why did the test fail here? Is there anything I need to do on my side to get this merged?

It might be a flaky test. I just reran that particular failed test. If it's green, feel free to merge

@sskarz sskarz force-pushed the relative-paths-react-demo-ios branch from 86c8dd6 to 843344d Compare February 25, 2025 16:51
@sskarz
Copy link
Contributor Author

sskarz commented Feb 25, 2025

Merging is blocked for me after rebase, I believe a maintainer has to merge it.

@mergennachin
Copy link
Contributor

Merging

@mergennachin mergennachin merged commit fd3b5e9 into pytorch:main Feb 26, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: ios Issues related to iOS code, build, and execution release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc. triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants