Skip to content

Enforce required cmake flags as explicit requirements #11457

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jathu
Copy link
Contributor

@jathu jathu commented Jun 6, 2025

Summary

The build file currently turns on a bunch of implicitly dependent flags, perhaps unnecessarily. Let's make these dependencies explicit now.

For example, previously if EXECUTORCH_BUILD_EXTENSION_TRAINING was turned on, it would then turn on its own set of dependencies. This is good from a developer experience point of view because users would need to just turn on one flag. However, from a build point of view, it makes it harder to maintain and understand what flags are conflicting with one another. Now, if you want to build the training extension, you will have to explicitly turn on the required flags. However, with our build presets — most developers should not have to do to this!

I have created a follow up ticket to actually comb through the existing flags and trim the fat if necessary: #11458

Test plan

CI

cc @larryliu0820

@jathu jathu added module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch ciflow/trunk ciflow/binaries release notes: none Do not include this in the release notes labels Jun 6, 2025
Copy link

pytorch-bot bot commented Jun 6, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures, 1 Unrelated Failure

As of commit d189a21 with merge base 2bb567f (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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 Jun 6, 2025
@jathu jathu changed the title ✨ Simplify CMake build configuration and validation logic. Enforce required cmake flags as explicit requirements Jun 6, 2025
@jathu jathu force-pushed the jathu/cmake-explicit-flag-requires branch from e3fba22 to 60fa340 Compare June 6, 2025 20:41
@jathu jathu force-pushed the jathu/cmake-explicit-flag-requires branch from 60fa340 to 469e165 Compare June 6, 2025 21:03
@jathu jathu force-pushed the jathu/cmake-required-flags branch from 28bcb5d to e8aec99 Compare June 6, 2025 21:11
@jathu jathu force-pushed the jathu/cmake-explicit-flag-requires branch 2 times, most recently from ac1180e to e23f1cc Compare June 6, 2025 21:24
@jathu jathu marked this pull request as ready for review June 6, 2025 21:33
@jathu jathu force-pushed the jathu/cmake-explicit-flag-requires branch from e23f1cc to 9e19d27 Compare June 6, 2025 21:40
@jathu jathu force-pushed the jathu/cmake-explicit-flag-requires branch from 9e19d27 to 02e8f57 Compare June 6, 2025 21:57
jathu added a commit that referenced this pull request Jun 6, 2025
### Summary

Some flags require other flags to also be turned on. So this function
helps use enforce it.

### Test plan

Used in: #11457

```
$ python -m unittest tools.cmake.common.preset_test.TestPreset
```


cc @larryliu0820
Base automatically changed from jathu/cmake-required-flags to main June 6, 2025 21:59
@jathu jathu force-pushed the jathu/cmake-explicit-flag-requires branch 3 times, most recently from ce72c8c to 86602c7 Compare June 6, 2025 23:26
@jathu jathu force-pushed the jathu/cmake-explicit-flag-requires branch from 86602c7 to d189a21 Compare June 6, 2025 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/binaries 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: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch release notes: none Do not include this in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants