Repository navigation
Open
Description
We recently updated macOS to 15.3.1 and Xcode 16.1 for all macOS VMs on Bazel CI.
(01:03:28) ERROR: /Users/buildkite/builds/bk-macos-arm64-nn86/bazel/rules-apple-darwin/test/starlark_tests/targets_under_test/ios/BUILD:129:16: AssetCatalogCompile test/starlark_tests/targets_under_test/ios/app-intermediates/bundle_library_ios.bundle/xcassets failed: (Exit 1): xctoolrunner failed: error executing AssetCatalogCompile command (from target //test/starlark_tests/targets_under_test/ios:app)
(cd /private/var/tmp/_bazel_buildkite/3ebd711cd99f106e0bfcf0a4dddc286c/execroot/_main && \
exec env - \
APPLE_SDK_PLATFORM=iPhoneSimulator \
APPLE_SDK_VERSION_OVERRIDE=18.2 \
PATH=/Users/buildkite/Library/Caches/bazelisk/downloads/sha256/ac72ad67f7a8c6b18bf605d8602425182b417de4369715bf89146daf62f7ae48/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin \
XCODE_VERSION_OVERRIDE=16.2.0.16C5032a \
bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/tools/xctoolrunner/xctoolrunner actool --compile '[ABSOLUTE]bazel-out/ios_sim_arm64-fastbuild-ios-sim_arm64-min12.0-applebin_ios-ST-26d4f6b9029b/bin/test/starlark_tests/targets_under_test/ios/app-intermediates/bundle_library_ios.bundle/xcassets' --platform iphonesimulator --minimum-deployment-target 12.0 --compress-pngs --target-device iphone '[ABSOLUTE]test/starlark_tests/resources/assets.xcassets')
# Configuration: 8931e66e98dfc14da7a42f9369975f695461c8159360912aca94c6ca1a76bc52
# Execution platform: @@platforms//host:host
/Users/buildkite/builds/bk-macos-arm64-nn86/bazel/rules-apple-darwin/test/starlark_tests/resources/assets.xcassets: error: No simulator runtime version from [<DVTBuildVersion 21F79>, <DVTBuildVersion 22D8075>] available to use with iphonesimulator SDK version <DVTBuildVersion 22C146>
Activity
meteorcloudy commentedon Mar 11, 2025
@fweikert @brentleyjones
fweikert commentedon Mar 11, 2025
The tests request Xcode 15.4, which is no longer installed on our MacOS workers. That's why CI bumps the version ("Fixed Xcode version: 15.4 -> 16.2..."), which might cause the problem. @brentleyjones is there something we need to do here, or is it a fix in rules_apple?
brentleyjones commentedon Mar 11, 2025
Even if using Xcode 16.2, we have the simulator runtime issue. @aaronsky has some experience with that and can give more context.
aaronsky commentedon Mar 11, 2025
For the period we're using Xcode 16.2 on the CI nodes,
xcodebuild -downloadPlatform iOSwill install the iOS 18.3.1 simulator runtime by default, rather than the originally distributed iOS 18.2. The rules expect by default that the SDK version (18.2) match the simulator runtime version (now 18.3, represented sometimes as 18.3.1). The best thing to do in the short term would be to add a line like this somewhere in the VM/image setup:This was the best workaround I could find in my own environment to make Bazel,
simulator_creator.py, and xcodebuild happy. I wouldn't recommend running this on every CI job, as-downloadPlatformis very slow and needs some time to finish mounting the simulator runtime disk image after it's been installed.meteorcloudy commentedon Mar 12, 2025
@aaronsky Where is this code? Can we fix the code to not make the assumption?
aaronsky commentedon Mar 12, 2025
The code where this all breaks down is in these spots:
When I examined this a couple weeks ago I couldn't figure out another sensible default that could be used to replace the assumption without requiring a new field or some new functionality in
xcode_version. Makingos_versionrequired on the test runner would break building across different Xcode versions.meteorcloudy commentedon Mar 12, 2025
I'm mostly worried that the next time we upgrade macOS this will happen again, is there a long term solution for this you have in mind?
aaronsky commentedon Mar 12, 2025
That's a reasonable concern, and no, I don't have a long-term plan in the event Apple drops a new runtime on us out of the blue again. I agree it needs a more robust solution beyond this workaround.
meteorcloudy commentedon Mar 17, 2025
We added
to our setup script and updated the VMs, can you please verify if it works now?
meteorcloudy commentedon Mar 19, 2025
Looks like rules_apple is still red: https://buildkite.com/bazel/rules-apple-darwin/builds/10157
@aaronsky Can you try to fix this from rules_apple side? I don't know what else we could do on the infra side and building and deploying a new VIM image is not very trivial.
aaronsky commentedon Mar 20, 2025
There seems to still be a mismatch related to the installed simulator runtimes, but this time with the visionOS runtime. Which, as far as I'm aware, haven't received an update recently. I don't recognize runtime 22N895, but 21O5565d is the SDK that shipped alongside Xcode 15.4, and 22N799 is the SDK in Xcode 16.2.
meteorcloudy commentedon Mar 27, 2025
@aaronsky I believe this has to be fixed from rules_apple side, so I'm closing this now.
wip: fix sdk->runtime mapping assumptions in ios test runners
aaronsky commentedon Mar 29, 2025
@meteorcloudy while I work on this from the rules_apple side, there is at least one other thing I need done on the macOS image (if you wouldn't mind reopening this issue). It appears as though the xros1.2 simulator runtime is still installed on the image, and it's confusing Xcode. Can we please see about removing the xros1.2 runtime and keeping xros2.2?
Alternatively, we could use
xcrun simctl runtime match setto forcefully map SDKs to simulator runtimes. But neither of these two things are things we can do from rules_apple on bazelci.25 remaining items
keith commentedon Apr 24, 2025
if so I would think it would be from background process since
bazel infodefinitely doesn't care about the state of those things. but since we found that the commands are also somewhat persistent I'm surprised it would affect things much. we can either move them to the VM setup or upgrade to 16.3 and delete themmeteorcloudy commentedon Apr 25, 2025
Looks like the postsubmit at least became more stable after bazelbuild/rules_apple#2701Presubmit still timing out...
Let try upgrading Xcode to 16.3 first.
fweikert commentedon Apr 28, 2025
We're currently deploying new Silicon workers with MacOS 15.4.1 and Xcode 16.3.
UebelAndre commentedon Apr 28, 2025
I think this is failing a build in
rules_rust:@fweikert can you take a quick look?
fweikert commentedon Apr 28, 2025
@UebelAndre based on other reports this seems to be a problem with zlib (example patch: https://www.mail-archive.com/[email protected]/msg860049.html). The version used by the examples is quite old (1.2.11 from 2017)
fweikert commentedon Apr 28, 2025
Still having problems with rules_apple, too: https://buildkite.com/bazel/rules-apple-darwin/builds/10356
keith commentedon Apr 28, 2025
i think on the rules_apple one you'll want to add the logging part of my shell_commands back just to make sure the platform defaults look good, seems to be a similar issue to the original one here
UebelAndre commentedon Apr 28, 2025
Upgrading did indeed fix the issue, thanks!
fweikert commentedon Apr 29, 2025
After uninstalling older versions:
Still no success, though :(
mattrobmattrob commentedon Apr 29, 2025
I'm trying to get it through again in bazelbuild/rules_apple#2703. The builds are so drastically slow like @keith has mentioned though.
How are you all uninstalling the older runtime versions? For example, I'd expect this missing file to exist (does for my local Xcode 16.2 install anyway):
fweikert commentedon Apr 29, 2025
I was running
xcrun simctl runtime delete, just as @keith did in bazelbuild/rules_apple@a44773ckeith commentedon Apr 29, 2025
that output after uninstalling the old simulator runtimes looks right to me
mattrobmattrob commentedon Apr 29, 2025
Now it seems like there's an xctestrunner issue where Xcode 16.3 doesn't have the expected path to the simulator device type's
profile.plist(simtype_profile.py::profile_plist_obj). I'm trying to figure it out to unblock that part of figuring this out (this dev forum post).For example, on my system:
Update: Fix for that is in google/xctestrunner#67
meteorcloudy commentedon Apr 30, 2025
Sorry, we actually rolled back the Xcode 16.3 yesterday due to #2269
fweikert commentedon May 14, 2025
How bad is the current situation?
I still want to upgrade to Xcode 16.3 again, but there are some ongoing problems caused by the zlib update.