bazelbuild / rules_apple

Bazel rules to build apps for Apple platforms.
Apache License 2.0
509 stars 264 forks source link

ios_xctestrun_runner fails with Xcode 16 #2468

Closed andre-alves closed 3 months ago

andre-alves commented 3 months ago

ios_unit_test + host_app

bazelisk test //test:ios_xctestrun_runner_unit_test

Testing failed:
    app (60412) encountered an error (Failed to load the test bundle. (Underlying Error: The bundle "PassingUnitSwiftTest.xctest" couldn't be loaded. The bundle couldn't be loaded. Try reinstalling the bundle. dlopen(/var/folders/zy/9t97bkmn6rj4xyk8qcp68f0r0000gp/T/test_tmp_dir.Yxb75T/PassingUnitSwiftTest.xctest/PassingUnitSwiftTest, 0x0109): Library not loaded: @rpath/Testing.framework/Testing

Failing to load the new Testing.framework from Xcode 16.

ios_ui_test

bazelisk test //test:ios_xctestrun_runner_ui_test

Same error as above + there is another error:

2024-06-11 20:11:05.081 xcodebuild[36782:19180774] [MT] IDELaunchReport: bd112cdf6753cd80:bd112cdf6753cd80: Finished with error: App installation failed: Unable to Install “$(XCTRunner)”
Domain: IXUserPresentableErrorDomain
Code: 1
Failure Reason: Please try again later.
Recovery Suggestion: PassingUISwiftTest-Runner.app is missing its bundle executable. Please check your build settings to make sure that a bundle executable is produced at the path "PassingUISwiftTest-Runner.app/$(XCTRunner)".
User Info: {
    DVTErrorCreationDateKey = "2024-06-11 20:11:05 +0000";
    IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
    SimCallingSelector = "installApplication:withOptions:error:";
}
--
Unable to Install “$(XCTRunner)”

That's happening because XCTRunner.app/Info.plist is now using $(WRAPPEDPRODUCTNAME) instead of just WRAPPEDPRODUCTNAME so our sed is not replacing everything.

aaronsky commented 3 months ago

In addition to the changes in #2469, and I could easily be mistaken here, I think this also needs updating to link the new Testing framework

andre-alves commented 3 months ago

In addition to the changes in #2469, and I could easily be mistaken here, I think this also needs updating to link the new Testing framework

I thought about it, but I managed to run tests using the new framework without passing extra arguments to the linker

aaronsky commented 3 months ago

I wonder if Testing.framework is implicitly linked, then. I'll need to do more research.