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

Can't compile Firebase (anymore) #998

Closed
krypt-lx opened this issue Apr 8, 2024 · 2 comments · Fixed by #999
Closed

Can't compile Firebase (anymore) #998

krypt-lx opened this issue Apr 8, 2024 · 2 comments · Fixed by #999

Comments

@krypt-lx
Copy link
Contributor

krypt-lx commented Apr 8, 2024

This is related to what Slack message I sent
https://bazelbuild.slack.com/archives/C05NZSHE7FU/p1712411153265529

Targets FirebaseMessaging and GoogleDataTransport are failing to compile
Initially appeared on CI build agent (first ever project build attempt on that machine), but during attempts to fix this I updated bazel dependencies (including rspm), which caused the issue to appear on my mac too.
Reverting to older project version is not helping, the issue persists.

The example project (it is not compiling on my machine at current time):
FirebaseTest.zip
note: "swiftpkg_googledatatransport" is manually added into use_repo command for purposes of the test, it is not normally exposed after bazel run //:swift_update_pkgs command
rules_swift_package_manager 0.26.2 used in this project but it also reproducible in 0.29.1

What I see, for some reason build files for those dependencies are generated differently:
the old BUILD file for GoogleDataTransport: old_GoogleDataTransport_BUILD.bazel.txt
new BUILD file for GoogleDataTransport: new_GoogleDataTransport_BUILD.bazel.txt

The difference I see in those files is presence of line:

        "-include$(location :GoogleDataTransport_GoogleDataTransport_objc_resource_bundle_accessor_hdr)",

inside of rule's GoogleDataTransport_GoogleDataTransport copt parameter (line 49)
the same for FirebaseMessaging, but I have no old version and it it is 28222 lines long, so, not attaching it

Commenting those lines, in fact, makes both targets compile

bazel build output:
bazel build output.txt

@krypt-lx
Copy link
Contributor Author

krypt-lx commented Apr 8, 2024

    "-Iexternal/rules_swift_package_manager~0.29.1~swift_deps~swiftpkg_googledatatransport/GoogleDataTransport/GDTCCTLibrary/Private",

By looks of it, I somehow was able to compile with rspm 0.29.1 (this is the build file I uploaded to slack)

downgrade to rspm 0.22.0 makes Firebase to compile, but it is not a viable option: project uses modules which require SWIFTPM_MODULE_BUNDLE macro. But it seems like the implementation of this macro is related to the issue on hands

@krypt-lx
Copy link
Contributor Author

krypt-lx commented Apr 8, 2024

GoogleDataTransport_GoogleDataTransport_objc_resource_bundle_accessor_hdr_ObjcResourceBundleAccessor.h.txt
The header file generated by GoogleDataTransport_GoogleDataTransport_objc_resource_bundle_accessor_hdr

cgrindel added a commit that referenced this issue Apr 8, 2024
This commit adds check for presence of ObjC support in currently used
compiler. If not, skips SWIFTPM_MODULE_BUNDLE macros altogether.

fixes #998

Co-authored-by: Krypt <me@mail>
Co-authored-by: Chuck Grindel <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant