rules_xcodeproj icon indicating copy to clipboard operation
rules_xcodeproj copied to clipboard

Feature Request: Support rules_ios's `apple_framework`

Open hzfanfei opened this issue 2 years ago • 4 comments

I user apple_framework in my project build file, bug when I run [bazel run //:xcodeproj], error is outputed fail("Could not find product for target {}".format(target.label))

hzfanfei avatar Jul 11 '22 12:07 hzfanfei

Do you have an example repro I can use to debug this? We haven't put any work towards making intermediate framework rules work, so this doesn't necessarily surprise me. We have an upcoming milestone dedicated to working on them though, and their priority can be raised based on demand.

brentleyjones avatar Jul 11 '22 12:07 brentleyjones

https://github.com/hzfanfei/learn_bazel.git I quickly built a demo with two branches. cd ios-app bazel run //:xcodeproj the result at main branch is run fine the result at apple_framework branch is wrong. apple_framework branch use apple_framework n 13, in process_product fail("Could not find product for target {}".format(target.label)) Error in fail: Could not find product for target //:SnapKit_swift_vfs

hzfanfei avatar Jul 11 '22 13:07 hzfanfei

Thank you. I'll look at it soon.

brentleyjones avatar Jul 11 '22 13:07 brentleyjones

Using rules_xcodeproj 0.6.0 and build_mode = "bazel" I was able to get the project to build and run:

CleanShot 2022-07-13 at 15 23 55@2x

BwX (build_mode = "xcode", the current default) has issues with linking, which will be resolved in Milestone 0.9: Frameworks.

brentleyjones avatar Jul 13 '22 20:07 brentleyjones

So this now works in BwB mode again, but BwX mode is blocked by supporting the VFS overlay that the rule uses (which is similar to #619). Because of the path manipulation needed for BwX mode, this might never be "properly" supported in BwX mode.

I'm moving this to the 1.0 milestone for now, and I'm thinking about how to handle situations like this in BwX mode.

brentleyjones avatar Oct 03 '22 19:10 brentleyjones

I believe this works in BwB mode now. BwX mode has an error at generation since we can't support VFS overlays in BwX mode.

brentleyjones avatar Jan 20 '23 14:01 brentleyjones