Fix MSVC build: replace ET_UNWRAP with manual error check#18798
Fix MSVC build: replace ET_UNWRAP with manual error check#18798meta-codesync[bot] merged 1 commit intomainfrom
Conversation
Summary:
ET_UNWRAP uses GCC statement expressions ({...}) which MSVC does not
support, causing compilation failure on Windows CI.
Replace with equivalent manual check: get the Result, check ok(), return
error on failure, then dereference. Same semantics, cross-platform compatible.
Differential Revision: D100218870
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18798
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ⏳ 37 Pending, 1 Unrelated FailureAs of commit 2b8e8cd with merge base c5e917d ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@kirklandsign has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100218870. |
This PR needs a
|
There was a problem hiding this comment.
Pull request overview
This PR fixes Windows/MSVC compilation by removing use of ET_UNWRAP (which relies on GCC/Clang statement-expressions) and replacing it with an equivalent, explicit Result check in the LLM runner metadata path.
Changes:
- Replace
ET_UNWRAP(module->get(...))withauto get_result = ...; if (!get_result.ok()) return get_result.error();to preserve error-propagation semantics on MSVC. - Keep metadata extraction behavior the same while making the implementation cross-platform.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Differential Revision: D100218870 Pull Request resolved: pytorch#18798
Summary:
ET_UNWRAP uses GCC statement expressions ({...}) which MSVC does not
support, causing compilation failure on Windows CI.
Replace with equivalent manual check: get the Result, check ok(), return
error on failure, then dereference. Same semantics, cross-platform compatible.
Differential Revision: D100218870