Skip to content

[Build Presets] Create foundation and default configurations #10716

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

Closed
jathu opened this issue May 6, 2025 · 1 comment
Closed

[Build Presets] Create foundation and default configurations #10716

jathu opened this issue May 6, 2025 · 1 comment
Assignees
Labels
module: ci Issues related to continuous integration triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@jathu
Copy link
Contributor

jathu commented May 6, 2025

Create the foundation for presets, and setup the default configurations.

@jathu jathu self-assigned this May 6, 2025
jathu added a commit that referenced this issue May 7, 2025
### Summary
Context: #10661. As
part #10716, this creates a
helper to define ET configs.

#### Why define_overridable_config?

This is a simple wrapper to configure an option via the user or fallback
to a default value. Instead of having people do this manually, this is
convenient and consistent. More specifically:

- If the option is set via the CLI or `set`, then save that value in the
cache — with our own description
- If the option is unset, then fallback to the default value

The user options will be loaded *before* loading the `default.cmake`
file. This means, when we load the default file, we can use the user set
options or fallback on defaults. Then finally we can do a final sweet of
option validations. After this point, all options will be frozen and
immutable.

Moreover, having a helper function will allow us to enforce standards on
options. For example, naming standards done in this PR.

#### Migration plan

For now, I've only migrated a simple option `EXECUTORCH_ENABLE_LOGGING`.
We'll incrementally migrate remaining options in future PRs.

### Test plan

For changes to `EXECUTORCH_ENABLE_LOGGING`, I changed the release modes
and checked the finaly `CMakeCache.txt` file. Rely on CI for full tests.

For python tests:

```
$ python3 -m unittest discover -s tools/cmake -p "*.py"
```

I will include this test in CI in the next diff.
jhelsby pushed a commit to jhelsby/executorch that referenced this issue May 9, 2025
### Summary
Context: pytorch#10661. As
part pytorch#10716, this creates a
helper to define ET configs.

#### Why define_overridable_config?

This is a simple wrapper to configure an option via the user or fallback
to a default value. Instead of having people do this manually, this is
convenient and consistent. More specifically:

- If the option is set via the CLI or `set`, then save that value in the
cache — with our own description
- If the option is unset, then fallback to the default value

The user options will be loaded *before* loading the `default.cmake`
file. This means, when we load the default file, we can use the user set
options or fallback on defaults. Then finally we can do a final sweet of
option validations. After this point, all options will be frozen and
immutable.

Moreover, having a helper function will allow us to enforce standards on
options. For example, naming standards done in this PR.

#### Migration plan

For now, I've only migrated a simple option `EXECUTORCH_ENABLE_LOGGING`.
We'll incrementally migrate remaining options in future PRs.

### Test plan

For changes to `EXECUTORCH_ENABLE_LOGGING`, I changed the release modes
and checked the finaly `CMakeCache.txt` file. Rely on CI for full tests.

For python tests:

```
$ python3 -m unittest discover -s tools/cmake -p "*.py"
```

I will include this test in CI in the next diff.
@Jack-Khuu Jack-Khuu added module: ci Issues related to continuous integration triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels May 9, 2025
@jathu
Copy link
Contributor Author

jathu commented May 28, 2025

This is done.

@jathu jathu closed this as completed May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: ci Issues related to continuous integration triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

2 participants