Closed CognitiveDisson closed 5 months ago
error: Multiple commands produce '<Touch /Users/vadims/DD/Integration-fchgxtvzxxtuejfflddfdmeyscna/Build/Products/Debug-iphonesimulator/bazel-out/ios_sim_arm64-dbg-ios-sim_arm64-min15.0-applebin_ios-ST-a89b5310e066/bin/iOSApp/Source/iOSApp.app/PlugIns/iOSAppObjCUnitTests.xctest>'
This error is expected. Both tests produce a bundle with the same name. They both can't be put into the test host. A normal Xcode project wouldn't support this either.
We encountered this problem with other types of output files, such as
link.params
andc.compile.params
.
I have a fix for this part coming though.
Description
If a scheme contains two test targets with the same name, the build will fail, with the following error:
We encountered this problem with other types of output files, such as
link.params
andc.compile.params
.Reproduction steps
After making some modifications, I was able to reproduce this issue on an example project. Here is the branch. Diff.
bazelisk run --config=cache //:xcodeproj-incremental-bazel-sim_arm64
xed Integration.xcodeproj
)The key change that led to this issue was a test target with the same name. Changing the target name should resolve the problem. It assume that rules_xcodeproj uses the target name to specify the output file location for the "Create Link Dependencies" step, leading to a collision.
Also, this issue can only be reproduced for the Objective-C test targets, as the Xcode target for swift tests does not include this step.
Expected behavior
There's no error even if two targets have the same name.
rules_xcodeproj version
11e698b0b987def9db74f24a9473a3b7fc6c0594
Xcode version
15.1
Bazel version
7.1.0
rules_apple version
No response
rules_swift version
No response
Additional information
No response