Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"failed to find TestImports-Unit-Tests.xctest in expected locations:" if apple.experimental.tree_artifact_outputs is set to 1 #854

Open
thiagohmcruz opened this issue Mar 26, 2024 · 1 comment

Comments

@thiagohmcruz
Copy link
Contributor

thiagohmcruz commented Mar 26, 2024

# Generate a project
bazel run //tests/ios/xcodeproj:Test-Imports-App-Project

# Invoke `xcodebuild`
xcodebuild -project tests/ios/xcodeproj/Test-Imports-App-Project.xcodeproj -scheme TestImports-Unit-Tests -destination "id=SOME_VALID_SIM_ID" -PBXBuildsContinueAfterErrors=0 test

You'll hit this err:

Testing failed:
        failed to find TestImports-Unit-Tests.xctest in expected locations: bazel-bin//tests/ios/unit-test/test-imports-app/TestImports-Unit-Tests.xctest bazel-bin//tests/ios/unit-test/test-imports-app/TestImports-Unit-Tests.__internal__.__test_bundle_archive-root/TestImports-Unit-Tests.xctest bazel-bin//tests/ios/unit-test/test-imports-app/TestImports-Unit-Tests.runfiles/_main//tests/ios/unit-test/test-imports-app/TestImports-Unit-Tests.xctest bazel-bin//tests/ios/unit-test/test-imports-app/TestImports-Unit-Tests.runfiles/_main//tests/ios/unit-test/test-imports-app/TestImports-Unit-Tests.zip
        Testing cancelled because the build failed.

The issue doesn't happen if apple.experimental.tree_artifact_outputs is set to 0.

@thiagohmcruz
Copy link
Contributor Author

thiagohmcruz commented Mar 26, 2024

The only two ways I was able to avoid this:

  1. Set transition_support.apple_rule_transition as an incoming edge transition in the legacy_xcodeproj.bzl => xcodeproj rule
  2. Set transition_support.apple_platform_split_transition as an outgoing edge transition in the same rule above for its deps attribute

Both "hacks" require the platform_type and minimum_os_version attributes to be set to something in the rule (rules_apple requirement) and I'm debating if this is even the right approach here. I doesn't make a lot of sense for the project to be opinionated on platform_type/minimum_os_version.

Given that this generator is getting more and more in "life support" mode due to most folks moving to rules_xcodeproj one might want to avoid setting apple.experimental.tree_artifact_outputs=1 when building from this generator as a workaround as I'm not convinced that its worth investing time in adjusting the rule to run well with the latest transitions-related changes that landed in rules_ios recently (e.g. 1, 2, 3).

We might want to simply close this once we deprecate the legacy generator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant