Fix nullable-to-nonnull conversions for Xcode 26.6 (#20466)#20466
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20466
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: ❌ 3 New Failures, 3 Unrelated FailuresAs of commit 63b852d with merge base aada6d7 ( NEW FAILURES - The following jobs have failed:
BROKEN TRUNK - The following jobs 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. |
|
@NSProgrammer has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109459540. |
This PR needs a
|
Summary: X-link: pytorch/pytorch#187979 Xcode 26.x errors under `-Werror` on implicit conversions from nullable `NSString.UTF8String` results to non-nullable `const char *` / `std::string` parameters. Guard each affected site with a `?: ""` fallback (these paths are non-null in practice, so behavior is unchanged). Fixed sites (both the `fbcode` and `xplat` mirror copies): - `caffe2/.../mpscnn/tests/MPSCNNTests.mm`: the `sf.UTF8String` append in the tensor-printing helper. - `executorch/.../ExecuTorchLLMTextRunner.mm`: `token.UTF8String` (special tokens), `_modelPath`/`_tokenizerPath` (runner creation), and `prompt.UTF8String` (generate). - `executorch/.../ExecuTorchLLMMultimodalRunner.mm`: `_modelPath`/`_tokenizerPath` (runner creation) and `input.text.UTF8String` (text input). ___ Differential Revision: D109459540
e951622 to
63b852d
Compare
Summary: X-link: pytorch/executorch#20466 Xcode 26.x errors under `-Werror` on implicit conversions from nullable `NSString.UTF8String` results to non-nullable `const char *` / `std::string` parameters. Guard each affected site with a `?: ""` fallback (these paths are non-null in practice, so behavior is unchanged). Fixed sites (both the `fbcode` and `xplat` mirror copies): - `caffe2/.../mpscnn/tests/MPSCNNTests.mm`: the `sf.UTF8String` append in the tensor-printing helper. - `executorch/.../ExecuTorchLLMTextRunner.mm`: `token.UTF8String` (special tokens), `_modelPath`/`_tokenizerPath` (runner creation), and `prompt.UTF8String` (generate). - `executorch/.../ExecuTorchLLMMultimodalRunner.mm`: `_modelPath`/`_tokenizerPath` (runner creation) and `input.text.UTF8String` (text input). ___ Test Plan: Affected targets build clean under the Apple SDK: ``` buck2 build fbobjc/mode/buck2/ios-tests -c 'facebook-dt#apple.xcode_sdk_version=xcode_26.4.1_17e202' --skip-incompatible-targets --skip-missing-targets fbsource//xplat/caffe2:aten_metal_testsApple buck2 build fbobjc/mode/buck2/ios-tests -c 'facebook-dt#apple.xcode_sdk_version=xcode_26.4.1_17e202' --skip-incompatible-targets --skip-missing-targets fbsource//xplat/executorch/extension/llm/apple:ExecuTorchLLMTests ``` Differential Revision: D109459540
Summary: X-link: pytorch/executorch#20466 Xcode 26.x errors under `-Werror` on implicit conversions from nullable `NSString.UTF8String` results to non-nullable `const char *` / `std::string` parameters. Guard each affected site with a `?: ""` fallback (these paths are non-null in practice, so behavior is unchanged). Fixed sites (both the `fbcode` and `xplat` mirror copies): - `caffe2/.../mpscnn/tests/MPSCNNTests.mm`: the `sf.UTF8String` append in the tensor-printing helper. - `executorch/.../ExecuTorchLLMTextRunner.mm`: `token.UTF8String` (special tokens), `_modelPath`/`_tokenizerPath` (runner creation), and `prompt.UTF8String` (generate). - `executorch/.../ExecuTorchLLMMultimodalRunner.mm`: `_modelPath`/`_tokenizerPath` (runner creation) and `input.text.UTF8String` (text input). ___ Test Plan: Affected targets build clean under the Apple SDK: ``` buck2 build fbobjc/mode/buck2/ios-tests -c 'facebook-dt#apple.xcode_sdk_version=xcode_26.4.1_17e202' --skip-incompatible-targets --skip-missing-targets fbsource//xplat/caffe2:aten_metal_testsApple buck2 build fbobjc/mode/buck2/ios-tests -c 'facebook-dt#apple.xcode_sdk_version=xcode_26.4.1_17e202' --skip-incompatible-targets --skip-missing-targets fbsource//xplat/executorch/extension/llm/apple:ExecuTorchLLMTests ``` Differential Revision: D109459540 Pull Request resolved: #187979 Approved by: https://github.com/larryliu0820, https://github.com/Skylion007
Summary:
X-link: pytorch/pytorch#187979
Xcode 26.x errors under
-Werroron implicit conversions from nullableNSString.UTF8Stringresults to non-nullableconst char */std::stringparameters. Guard each affected site with a?: ""fallback (these paths are non-null in practice, so behavior is unchanged). Fixed sites (both thefbcodeandxplatmirror copies):caffe2/.../mpscnn/tests/MPSCNNTests.mm: thesf.UTF8Stringappend in the tensor-printing helper.executorch/.../ExecuTorchLLMTextRunner.mm:token.UTF8String(special tokens),_modelPath/_tokenizerPath(runner creation), andprompt.UTF8String(generate).executorch/.../ExecuTorchLLMMultimodalRunner.mm:_modelPath/_tokenizerPath(runner creation) andinput.text.UTF8String(text input).Differential Revision: D109459540