Skip to content

Conversation

ykhrustalev
Copy link
Contributor

@ykhrustalev ykhrustalev commented Aug 2, 2025

Summary

The guard condition for ios flavors does not work for the x86 ios simulator.

Making the filter to look at ios works for:

  • iphone
  • arm64 simulator
  • x86 simulator

Test plan

Env setup

uv venv --seed --python 3.12
. .venv/bin/activate
./install_executorch.sh

Compilation

cmake -G Xcode -B build-ios -DEXECUTORCH_BUILD_XNNPACK=ON -DPLATFORM=SIMULATOR64 --toolchain third-party/ios-cmake/ios.toolchain.cmake

arch -x86_64 xcodebuild \
  -project build-ios/executorch.xcodeproj \
  -scheme xnnpack_backend \
  -configuration Release \
  -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" \
  build

The error would be

PhaseScriptExecution Generate\ schema/include/executorch/schema/scalar_type_generated.h /Users/liquidai/workplace/executorch/build-ios/build/executorch.build/Release-iphonesimulator/common_schema.build/Script-084D4CECB42D39BCD7AD3EA0.sh (in target 'common_schema' from project 'executorch')
    cd /Users/liquidai/workplace/executorch
    /bin/sh -c /Users/liquidai/workplace/executorch/build-ios/build/executorch.build/Release-iphonesimulator/common_schema.build/Script-084D4CECB42D39BCD7AD3EA0.sh

PhaseScriptExecution Generate\ schema/include/executorch/backends/xnnpack/serialization/schema_generated.h /Users/liquidai/workplace/executorch/build-ios/build/executorch.build/Release-iphonesimulator/xnnpack_schema.build/Script-97267FA7960A2E75E8D4D64D.sh (in target 'xnnpack_schema' from project 'executorch')
    cd /Users/liquidai/workplace/executorch
    /bin/sh -c /Users/liquidai/workplace/executorch/build-ios/build/executorch.build/Release-iphonesimulator/xnnpack_schema.build/Script-97267FA7960A2E75E8D4D64D.sh
Usage:
/Users/liquidai/workplace/executorch/build-ios/third-party/flatbuffers_external_
project/bin/flatc [-b|--binary, -c|--cpp, -n|--csharp, -d|--dart, -g|--go,
-j|--java, -t|--json, --jsonschema, --kotlin, --kotlin-kmp, --lobster, -l|--lua,
--nim, --php, --proto, -p|--python, -r|--rust, --swift, -T|--ts, -o, -I, -M,
--version, -h|--help, --strict-json, --allow-non-utf8, --natural-utf8,
--defaults-json, --unknown-json, --no-prefix, --scoped-enums,
--no-emit-min-max-enum-values, --swift-implementation-only, --gen-includes,
--no-includes, --gen-mutable, --gen-onefile, --gen-name-strings,
--gen-object-api, --gen-compare, --gen-nullable, --java-package-prefix,
--java-checkerframework, --gen-generated, --gen-jvmstatic, --gen-all,
--gen-json-emit, --cpp-include, --cpp-ptr-type, --cpp-str-type,
--cpp-str-flex-ctor, --cpp-field-case-style, --cpp-std, --cpp-static-reflection,
--object-prefix, --object-suffix, --go-namespace, --go-import, --go-module-name,
--raw-binary, --size-prefixed, --proto-namespace-suffix, --oneof-union,
--keep-proto-id, --proto-id-gap, --grpc, --schema, --bfbs-filenames,
--bfbs-absolute-paths, --bfbs-comments, --bfbs-builtins, --bfbs-gen-embed,
--conform, --conform-includes, --filename-suffix, --filename-ext,
--include-prefix, --keep-prefix, --reflect-types, --reflect-names,
--rust-serialize, --rust-module-root-file, --root-type, --require-explicit-ids,
--force-defaults, --force-empty, --force-empty-vectors, --flexbuffers,
--no-warnings, --warnings-as-errors, --cs-global-alias,
--cs-gen-json-serializer, --json-nested-bytes, --ts-flat-files,
--ts-entry-points, --annotate-sparse-vectors, --annotate,
--no-leak-private-annotation, --python-no-type-prefix-suffix, --python-typing,
--ts-omit-entrypoint, --file-names-only]... FILE... [-- BINARY_FILE...]

error:
  unable to load file: backends/xnnpack/serialization/runtime_schema.fbs

/Users/liquidai/workplace/executorch/build-ios/third-party/flatbuffers_external_project/bin/flatc: Command PhaseScriptExecution failed with a nonzero exit code

note: Run script build phase 'Generate third-party/CMakeFiles/flatbuffers_external_project' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'flatbuffers_external_project' from project 'executorch')
note: Run script build phase 'Generate CMakeFiles/ZERO_CHECK' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ZERO_CHECK' from project 'executorch')
** BUILD FAILED **

@pytorch-bot
Copy link

pytorch-bot bot commented Aug 2, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit e6d20ef with merge base 335de46 (image):
💚 Looks good so far! There are no failures yet. 💚

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 Aug 2, 2025
@github-actions
Copy link

github-actions bot commented Aug 2, 2025

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.

@mergennachin mergennachin requested a review from shoumikhin August 2, 2025 18:15
@ykhrustalev
Copy link
Contributor Author

I have updated the commands to compile

-DCMAKE_TOOLCHAIN_FILE=
# If building for iOS, "unset" these variables to rely on the host (macOS) defaults.
$<$<AND:$<BOOL:${APPLE}>,$<BOOL:$<FILTER:${PLATFORM},EXCLUDE,^MAC>>>:-DCMAKE_OSX_SYSROOT=>
$<$<STREQUAL:$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>,ios>:-DCMAKE_OSX_SYSROOT=macosx>
Copy link
Contributor

Choose a reason for hiding this comment

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

@larryliu0820 any objections?

@github-actions
Copy link

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions bot added the stale PRs inactive for over 60 days label Oct 22, 2025
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. stale PRs inactive for over 60 days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants