-
Notifications
You must be signed in to change notification settings - Fork 86
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
Bug: Xcode Previews fail when using macos_*_framework
#2915
Comments
Do we maybe need something similar to: #2722 |
I tested using just Previews log== DATE:
== PREVIEW UPDATE ERROR:
== VERSION INFO:
== ENVIRONMENT:
== SELECTED RUN DESTINATION:
== SELECTED RUN DESTINATION:
== PACKAGE RESOLUTION ERRORS: == REFERENCED SOURCE PACKAGES: == SESSION GROUP 5407:
== UPDATE SESSION 5408:
== POWER STATE LOGS:
|
The dylib doesn’t seem to exist in derived data. But if I copy it there manually then it works correctly |
macos_dynamic_framework
macos_*_framework
Similar to the other issue, $ tree /Users/brentley/Developer/rules_xcodeproj/examples/integration/bazel-output-base/rules_xcodeproj.noindex/build_output_base/execroot/_main/
bazel-out/darwin_arm64-dbg-macos-arm64-min14.0-applebin_macos-ST-1fae1195bb35/bin/macOSApp/Source/Lib.framework
/Users/brentley/Developer/rules_xcodeproj/examples/integration/bazel-output-base/rules_xcodeproj.noindex/build_output_base/execroot/_main/bazel-out/darwin_arm64-dbg-macos-arm64-min14.0-applebin_macos-ST-1fae1195bb35/bin/macOSApp/Source/Lib.framework
├── Headers
│ └── Lib.h
├── Info.plist
├── Lib
└── Modules
├── Lib.swiftmodule
│ ├── arm64.swiftdoc
│ └── arm64.swiftmodule
└── module.modulemap Once it creates macOS frameworks with the correct layout, then this will start working automatically. |
Ah gotcha! Interestingly though I can't repro in the integration examples, previews work there for the macOS app |
For the app it worked, but it didn't work when I added a preview to |
@brentleyjones So I started looking at properly making frameworks for macOS with the structure described in: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html It's a non-trivial change to the rules and while we should definitely do it, I'll likely need more help to get that change done. In the meantime, we've been able to work around this by symlinking the framework to the expected |
We symlink the frameworks to versions in bazel-out, so we can't really modify them. Because of this I'm not sure there is an easy way for us to solve it on the rules_xcodeproj side. I'm not opposed to doing something on this side, but anything would still have to be performant (which is what the symlink was made to address), correct, and forward compatible. If you think doing that work would be easier, I won't stop you 😁. |
Description
I have a
macos_dynamic_framework
target we use for distribution, this works fine for normal builds in BwB but when trying to use previews we get the following error:Previews crash log
== DATE:== PREVIEW UPDATE ERROR:
== VERSION INFO:
== ENVIRONMENT:
== SELECTED RUN DESTINATION:
== SELECTED RUN DESTINATION:
== PACKAGE RESOLUTION ERRORS:
== REFERENCED SOURCE PACKAGES:
== SESSION GROUP 6631:
== UPDATE SESSION 6632:
== POWER STATE LOGS:
Reproduction steps
xcodeproj
target with amacos_dynamic_framework
top level target#Preview { Text("Hi") }
Expected behavior
Previews work for
macos_dynamic_framework
rules_xcodeproj version
1.16.0
Xcode version
15.1
Bazel version
6.5.0
rules_apple version
No response
rules_swift version
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: