Skip to content

Conversation

@dbort
Copy link
Contributor

@dbort dbort commented Oct 24, 2024

Our C++ include path assumes that the repo lives in a directory named exactly executorch. Users who name it something else run into hard-to-debug issues (see #6475).

Since we require it, add an explicit check and point users to the issue that tracks the fix.

Test Plan

Tried generating cmake files under a directory named executorch and named not-executorch:

(rm -rf cmake-out \
    && mkdir cmake-out \
    && cd cmake-out \
    && cmake ../)

Note that I added a trailing slash just in case CMAKE_CURRENT_SOURCE_DIR included that slash and might confuse cmake_path(). (note that CMAKE_CURRENT_SOURCE_DIR does not include the trailing slash in this case)

This command succeeded when the directory is named executorch.

Under not-executorch it failed with the error:

CMake Error at CMakeLists.txt:332 (message):
  The ExecuTorch repo must be cloned into a directory named exactly
  `executorch`; found `not-executorch`.  See
  https://github.com/pytorch/executorch/issues/6475 for progress on a fix for
  this restriction.

Also tested with the instructions at pytorch.org/executorch/main/llm/getting-started.html, where executorch is a sub-repo of the top project. It builds when following the directions, but if I rename the repo to third-party/not-executorch then I see the expected error.

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 24, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit ef6758a with merge base f01b20b (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 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 Oct 24, 2024
@dbort dbort requested a review from mergennachin October 24, 2024 01:42
@dbort
Copy link
Contributor Author

dbort commented Oct 24, 2024

We should also check that this works when the ET repo isn't the root of the project, like in https://pytorch.org/executorch/main/llm/getting-started.html

Our C++ include path assumes that the repo lives in a directory named
exactly `executorch`. Users who name it something else run into
hard-to-debug issues (see pytorch#6475).

Since we require it, add an explicit check and point users to the issue
that tracks the fix.

Tried generating cmake files under a directory named `executorch` and
named `not-executorch`:

```
(rm -rf cmake-out \
    && mkdir cmake-out \
    && cd cmake-out \
    && cmake ../)
```

Note that I added a trailing slash just in case CMAKE_CURRENT_SOURCE_DIR
included that slash and might confuse `cmake_path()`. (note that
CMAKE_CURRENT_SOURCE_DIR does not include the trailing slash in this
case)

This command succeeded when the directory is named `executorch`.

Under `not-executorch` it failed with the error:

```
CMake Error at CMakeLists.txt:332 (message):
  The ExecuTorch repo must be cloned into a directory named exactly
  `executorch`; found `not-executorch`.  See
  pytorch#6475 for progress on a fix for
  this restriction.
```
@dbort
Copy link
Contributor Author

dbort commented Nov 13, 2024

Tested with the instructions at https://pytorch.org/executorch/main/llm/getting-started.html, where executorch is a sub-repo of the top project. It builds when following the directions, but if I rename the repo to third-party/not-executorch then I see the expected error.

@dbort dbort merged commit efa4628 into pytorch:main Nov 14, 2024
39 checks passed
@dbort dbort deleted the repo-name branch November 14, 2024 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants