MobileNativeFoundation / MobileNativeFoundation/rules_xcodeproj

Bug: `xcschemes.top_level_anchor_target` fails for `*_build_test` if the library was merged into another top-level-target

Open
#2,951 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Swift
Stars
626
Forks
124
PR merge metrics
No merged PRs in 30d

Description

Description

Since https://github.com/MobileNativeFoundation/rules_xcodeproj/commit/6f65b40b1c04fc6aa0e8910e8d1597954de95777 we can now list *_build_test targets in xcschemes.top_level_anchor_target macros. But if the *_build_test target is for a library that has merged into another top-level target, then we get an error like this:

Run build target "@@//Lib:Lib ios_sim_arm64-dbg-ios-sim_arm64-min15.0-applebin_ios-ST-a89b5310e066" not found in:
[@@//Lib/dist/dynamic:iOS ios_sim_arm64-dbg-ios-sim_arm64-min15.0-applebin_ios-ST-a89b5310e066]

Where @@//Lib:Lib ios_sim_arm64-dbg-ios-sim_arm64-min15.0-applebin_ios-ST-a89b5310e066 is the library target that was merged into @@//Lib/dist/dynamic:iOS ios_sim_arm64-dbg-ios-sim_arm64-min15.0-applebin_ios-ST-a89b5310e066, but also referenced by @@//Lib:ios_Lib (which is an ios_build_test).

Reproduction steps

Change minimum_os_version to 15.0 on //Lib:ios_Lib in examples/integation. Then bazel run //:xcodeproj-incremental-bazel-sim_arm64.

Expected behavior

Project generates without an error.

rules_xcodeproj version

871632ea9c717c8d06442243bb2c59d5baf92c20

Xcode version

N/A

Bazel version

N/A

rules_apple version

No response

rules_swift version

No response

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by changing minimum_os_version to 15.0 on //Lib:ios_Lib in examples/integation, then running bazel run //:xcodeproj-incremental-bazel-sim_arm64. Trace how the merged library target and the *_build_test target are represented in generated Xcode schemes. Done means the project generates without the missing build-target error.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.