This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Add a macro for prefixing embedder.h symbols #9851
Merged
stuartmorgan-g
merged 4 commits into
flutter:master
from
stuartmorgan-g:embedder-prefix-macro
Jul 23, 2019
Merged
Add a macro for prefixing embedder.h symbols #9851
stuartmorgan-g
merged 4 commits into
flutter:master
from
stuartmorgan-g:embedder-prefix-macro
Jul 23, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") { |
Member
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.
Contributor
Author
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.
chinmaygarde
approved these changes
Jul 22, 2019
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jul 23, 2019
engine-flutter-autoroll
added a commit
to flutter/flutter
that referenced
this pull request
Jul 23, 2019
…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.
clarkezone
added a commit
to clarkezone/engine
that referenced
this pull request
Jul 27, 2019
…fixing embedder.h symbols (flutter#9851)
johnsonmh
pushed a commit
to johnsonmh/flutter
that referenced
this pull request
Jul 30, 2019
…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.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.