Skip to content

Stop using autoglob mode constants#18022

Merged
manuelcandales merged 1 commit intopytorch:mainfrom
manuelcandales:export-D95399679
Mar 9, 2026
Merged

Stop using autoglob mode constants#18022
manuelcandales merged 1 commit intopytorch:mainfrom
manuelcandales:export-D95399679

Conversation

@manuelcandales
Copy link
Copy Markdown
Contributor

Summary: There's no point to using constants for this, it's an immediate Buck parse error if you use an invalid mode. It's an extra step the AI needs to figure out (and humans!) - just use strings.

Reviewed By: d16r

Differential Revision: D95399679

Summary: There's no point to using constants for this, it's an immediate Buck parse error if you use an invalid mode. It's an extra step the AI needs to figure out (and humans!) - just use strings.

Reviewed By: d16r

Differential Revision: D95399679
Copilot AI review requested due to automatic review settings March 9, 2026 21:27
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Mar 9, 2026

🔗 Helpful Links

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

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

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

@meta-cla meta-cla 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 Mar 9, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Mar 9, 2026

@manuelcandales has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95399679.

Copy link
Copy Markdown
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

This PR replaces the use of the EXPORT_UNLESS_INTERNAL Starlark constant with its equivalent string literal "EXPORT_UNLESS_INTERNAL" in two Apple BUCK build files. The motivation is to simplify the build files: using the string directly is more readable, reduces indirection, and eliminates the need to import an external constant just for this purpose. An invalid string would be caught as an immediate Buck parse error anyway, so there's no safety benefit to using the constant.

Changes:

  • extension/llm/apple/BUCK: Changed autoglob_mode from the constant EXPORT_UNLESS_INTERNAL to the string "EXPORT_UNLESS_INTERNAL".
  • extension/apple/BUCK: Same change as above for the ExecuTorch library target.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
extension/llm/apple/BUCK Replaces autoglob_mode = EXPORT_UNLESS_INTERNAL with autoglob_mode = "EXPORT_UNLESS_INTERNAL"
extension/apple/BUCK Replaces autoglob_mode = EXPORT_UNLESS_INTERNAL with autoglob_mode = "EXPORT_UNLESS_INTERNAL"

Note: Both files still retain the now-unused load("@fbsource//tools/build_defs/apple:autoglob.bzl", "EXPORT_UNLESS_INTERNAL") statement on line 3. Since the constant is no longer referenced after this change, these load statements should also be removed to avoid dead imports.


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread extension/llm/apple/BUCK
non_fbcode_target(_kind = fb_apple_library,
name = "ExecuTorchLLM",
autoglob_mode = EXPORT_UNLESS_INTERNAL,
autoglob_mode = "EXPORT_UNLESS_INTERNAL",
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

After replacing the constant with the string literal "EXPORT_UNLESS_INTERNAL", the load statement on line 3 that imports EXPORT_UNLESS_INTERNAL from autoglob.bzl is now unused. This dead import should be removed to keep the file clean and avoid any potential lint/parse warnings about unused symbols.

Copilot uses AI. Check for mistakes.
Comment thread extension/apple/BUCK
non_fbcode_target(_kind = fb_apple_library,
name = "ExecuTorch",
autoglob_mode = EXPORT_UNLESS_INTERNAL,
autoglob_mode = "EXPORT_UNLESS_INTERNAL",
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

After replacing the constant with the string literal "EXPORT_UNLESS_INTERNAL", the load statement on line 3 that imports EXPORT_UNLESS_INTERNAL from autoglob.bzl is now unused. This dead import should be removed to keep the file clean and avoid any potential lint/parse warnings about unused symbols.

Copilot uses AI. Check for mistakes.
@manuelcandales manuelcandales added the release notes: none Do not include this in the release notes label Mar 9, 2026
@manuelcandales manuelcandales merged commit 6abcb53 into pytorch:main Mar 9, 2026
166 of 192 checks passed
jpiat pushed a commit to jpiat/executorch that referenced this pull request Mar 17, 2026
Summary: There's no point to using constants for this, it's an immediate
Buck parse error if you use an invalid mode. It's an extra step the AI
needs to figure out (and humans!) - just use strings.

Reviewed By: d16r

Differential Revision: D95399679

Co-authored-by: Adam Ernst <adamjernst@meta.com>
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. fb-exported meta-exported 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