Skip to content

Export ET_LOG_ENABLED=0 as PUBLIC compile definition on cmake targets#17907

Merged
lucylq merged 24 commits intomainfrom
gh/lucylq/137/head
Mar 7, 2026
Merged

Export ET_LOG_ENABLED=0 as PUBLIC compile definition on cmake targets#17907
lucylq merged 24 commits intomainfrom
gh/lucylq/137/head

Conversation

@lucylq
Copy link
Contributor

@lucylq lucylq commented Mar 5, 2026

The executorch and executorch_core cmake targets did not propagate
ET_LOG_ENABLED=0 to consumers via INTERFACE_COMPILE_DEFINITIONS.
This caused inline/template functions from headers (e.g.
MemoryAllocator::allocate, Result::CheckOk) to be instantiated
with logging enabled in consumer TUs, pulling in format strings,
et_pal_emit_log_message, and the full POSIX logging stack (fprintf,
chrono).

Adding ET_LOG_ENABLED=0 as a PUBLIC definition ensures consumers
compile header code with the same logging state as the library.

Reduces stripped size_test by 4,096 bytes and stripped
size_test_all_ops by 8,192 bytes.

Github Executorch added 3 commits March 5, 2026 09:08
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@lucylq
Copy link
Contributor Author

lucylq commented Mar 5, 2026

@pytorch-bot
Copy link

pytorch-bot bot commented Mar 5, 2026

🔗 Helpful Links

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

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

⏳ No Failures, 125 Pending

As of commit 6b49d95 with merge base 1143673 (image):
💚 Looks good so far! There are no failures yet. 💚

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Github Executorch added 9 commits March 5, 2026 10:54
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Github Executorch added 6 commits March 6, 2026 10:58
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Github Executorch added 5 commits March 6, 2026 14:38
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Base automatically changed from gh/lucylq/136/head to main March 6, 2026 23:52
[ghstack-poisoned]
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@lucylq lucylq merged commit da2223f into main Mar 7, 2026
145 of 150 checks passed
@lucylq lucylq deleted the gh/lucylq/137/head branch March 7, 2026 00:39
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.

3 participants