-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Add a macro for prefixing embedder.h symbols #9851
Add a macro for prefixing embedder.h symbols #9851
Conversation
embedder.h is a C API, so has no namespace, and only uses 'Flutter' as a prefix for most symbol names. This creates potential collisions with other code; for instance, FlutterEngine is the name of a type in embedder.h, but also an ObjC class in the iOS Flutter API. This adds a macro that can be set to prefix symbol names, allowing clients (notably, the macOS embedding) to adjust the names used by the embedding API internally without breaking ABI or API compatibility for the standard engine build. Currently the macro is only applied to FlutterEngine, since that's the symbol that is currently at issue, but it can be expanded to other symbols in the future.
] | ||
# Template for the embedder build. Used to allow building it multiple times with | ||
# different flags. | ||
template("embedder_source_set") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be better to create a template for the embedder dylib (i.e a template that expands to shared_library
instead of source_set
) that not only sets the macro to rename symbols but also adds a suffix to the dylib so that multiple dylib versions with renamed symbols may coexist in the out directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the use case for this? I don't expect us to ever need to build a prefixed dylib.
…9851) (#36762) flutter/engine@1f30131...7d320c4 git log 1f30131..7d320c4 --no-merges --oneline 7d320c4 Add a macro for prefixing embedder.h symbols (flutter/engine#9851) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff ([email protected]), and stop the roller if necessary.
…fixing embedder.h symbols (flutter#9851)
…9851) (flutter#36762) flutter/engine@1f30131...7d320c4 git log 1f30131..7d320c4 --no-merges --oneline 7d320c4 Add a macro for prefixing embedder.h symbols (flutter/engine#9851) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff ([email protected]), and stop the roller if necessary.
embedder.h is a C API, so has no namespace, and only uses 'Flutter' as a
prefix for most symbol names. This creates potential collisions with
other code; for instance, FlutterEngine is the name of a type in
embedder.h, but also an ObjC class in the iOS Flutter API.
This adds a macro that can be set to prefix symbol names, allowing
clients (notably, the macOS embedding) to adjust the names used by the
embedding API internally without breaking ABI or API compatibility for
the standard engine build.
Currently the macro is only applied to FlutterEngine, since that's the
symbol that is currently at issue, but it can be expanded to other
symbols in the future.