-
Notifications
You must be signed in to change notification settings - Fork 170
build: fix cross-platform android builds on OS X #237
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
Changes from all commits
3eaff4f
555c92f
a793292
c214363
bf359bb
ddb4149
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -14,20 +14,6 @@ | |||
|
|
||||
| licenses(["notice"]) | ||||
|
|
||||
| config_setting( | ||||
| name = "osx", | ||||
| constraint_values = [ | ||||
| "@platforms//os:osx", | ||||
| ], | ||||
| ) | ||||
|
|
||||
| config_setting( | ||||
| name = "ios", | ||||
| constraint_values = [ | ||||
| "@platforms//os:ios", | ||||
| ], | ||||
| ) | ||||
|
|
||||
| ### libraries | ||||
|
|
||||
| cc_library( | ||||
|
|
@@ -66,15 +52,10 @@ cc_library( | |||
| "include/cctz/zone_info_source.h", | ||||
| ], | ||||
| includes = ["include"], | ||||
| linkopts = select({ | ||||
| "//:osx": [ | ||||
| "-framework Foundation", | ||||
| ], | ||||
|
Comment on lines
-70
to
-72
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was added in #102, which references abseil/abseil-cpp#291. Do we understand why that was wrong, or what has changed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What I know is what is on the associated issue, which is this change broke absl for Envoy Mobile and tensorflow builds.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From reading the history of that other PR and issue that @devbww mentioned, I think the issue was that old versions of bazel didn't automatically link with That said, I'm not sure we actually should do that. Today, our code explicitly references macOS TimeZone types, for example: Line 25 in c674330
and in the spirit of From abseil/abseil-cpp#326, it sounds like the real issue is w/ the native android build rules. @alyssawilk did you say that you have an alternative workaround that may allow you to fix your issue while allowing CCTZ to retain its explicit dep? [1]: We're currently linking with
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Our workaround is carrying an abseil.patch file* which removes the foundation files (which looks like what everyone else is doing). I'm now trying to get rid of that patch file, either by removing the explicit dependency or making it optional because the code is switching repos and I'm trying to clean up all the backported patches that I can. Worst case I can probably move the backported patch but I'd rather find a fix we're all Ok with, whether it be removing the dependency as outdated and known problematic, or having an opt-in bazel select. I'm happy to do whatever works best for you folks but I'd really prefer we fix abseil rather than expect everyone downstream to patch! https://github.com/envoyproxy/envoy-mobile/blob/main/bazel/abseil.patch
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that it would be good to avoid the need for everyone (anyone) to have to apply a patch in order to use abseil/cctz w/ an android build target (when compiling on macos). I think I'd be OK with replacing the @devbww WDYT? @derekmauro can you confirm whether this PR, when patched in to Abseil, will pass all of Abseil's tests?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SG thanks! I'f we're doing that as general clean up I'm inclined to do it for both, not just for the dependency my project needs. I'm very happy to revert that half if y'all prefer but I'll start with that so @derekmauro 's CI run tests both removals and optimistically hope the other ccd folks buy in on this plan.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This passes CI: abseil/abseil-cpp#1306
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Forgive my naivety, but if I'm understanding correctly bazel now adds And not adding it avoids this: "the problem is when you're trying to build android libraries on a mac machine it gets confused about platforms." That seems like a problem far removed from this change, and not even cctz specific. Is there an alternative that targets the real confusion? |
||||
| "//:ios": [ | ||||
| "-framework Foundation", | ||||
| ], | ||||
| "//conditions:default": [], | ||||
| }), | ||||
| # OS X and iOS no longer use `linkopts = ["-framework CoreFoundation"]` | ||||
| # as (1) bazel adds it automatically, and (2) it caused problems when | ||||
| # cross-compiling for Android. | ||||
| # See https://github.com/abseil/abseil-cpp/issues/326 for details. | ||||
| visibility = ["//visibility:public"], | ||||
| deps = [":civil_time"], | ||||
| ) | ||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.