Skip to content

Auto populate the namespace list to rename in desktop packaging #1000

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

Merged
merged 43 commits into from
Jul 27, 2022

Conversation

jonsimantov
Copy link
Contributor

@jonsimantov jonsimantov commented Jun 17, 2022

Description

Provide details of the change, and generalize the change in the PR title above.

Currently, there is a large list of C++ namespaces that are renamed in the binary version of the desktop SDK. This allows the Firebase C++ SDK to embed its own C++ dependencies (e.g. absl, BoringSSL, gRPC, etc.) without affecting any other versions of those dependencies that may be present in the build (for example, if the developer's desktop app uses OpenSSL or a different version of gRPC).

Because that list of C++ namespaces is manually maintained in the desktop packaging script, it's possible that when dependencies changed (as grpc recently did), there can be new namespaces introduced in dependencies that are not added to that list. This would result in duplicate symbols when a developer ultimately links their desktop app—which, for example, already uses gRPC—with the Firebase C++ SDK, which embeds its own version of gRPC.

Fortunately, the script that performs this renaming has a mode where it will scan for all C++ namespaces and rename them all automatically, except the ones we specifically want to preserve (in this case, just "firebase::"). This will rename all namespaces inside the C++ libraries, except for certain system namespaces (currently "std" and "__gnu_cxx").

This PR enables this option. Ultimately the binary SDK created in this PR will need to be checked to make sure it does not have any extraneous frameworks. (This PR also adds such a check to the end of the packaging workflow.)

Finally, this PR brings back the merge_libraries_test script from the internal repo, which runs a battery of tests on merge_libraries, including new ones added to catch these very issues. The script is not in CI but can be run locally via scripts/merge_libraries_test.sh.


Testing

Describe how you've tested these changes. Link any manually triggered Integration tests or CPP binary SDK Packaging Github Action workflows, if applicable.

CPP binary SDK packaging runs


Type of Change

Place an x the applicable box:

  • Bug fix. Add the issue # below if applicable.
  • New feature. A non-breaking change which adds functionality.
  • Other, such as a build process or documentation change.

Notes

  • Bug fixes and feature changes require an update to the Release Notes section of release_build_files/readme.md.
  • Read the contribution guidelines CONTRIBUTING.md.
  • Changes to the public API require an internal API review. If you'd like to help us make Firebase APIs better, please propose your change in a feature request so that we can discuss it together.

…ces to rename.

This prevents some namespaces from accidentally being omitted. Instead,
the script will rename all namespaces except for std:: and __gnu_cxx.
Also add 'firestore' to top-level namespaces.

Also upgrade demumble to 1.2.2 which handles more MSVC demangling cases.
This fixes grpc_resource_quota_arg_vtable::$_0::__invoke
)
cache_param=--cache=${cache_file}

if [[ ${platform} == "windows" ]]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer needed with the newer Demumble version.

@@ -544,6 +549,9 @@ jobs:
cd sdk-src
python scripts/gha/install_prereqs_desktop.py --ssl boringssl
cd ..
if [[ $(uname) == "Darwin"* ]]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes an issue where Mac packaging was not done in parallel due to the "parallel" tool not being installed. Speeds up packaging on Mac.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jonsimantov jonsimantov requested a review from DellaBitta July 20, 2022 18:29
@@ -544,6 +549,9 @@ jobs:
cd sdk-src
python scripts/gha/install_prereqs_desktop.py --ssl boringssl
cd ..
if [[ $(uname) == "Darwin"* ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jonsimantov jonsimantov merged commit c046c8a into main Jul 27, 2022
@github-actions github-actions bot added the tests: in-progress This PR's integration tests are in progress. label Jul 27, 2022
@github-actions
Copy link

github-actions bot commented Jul 27, 2022

❌  Integration test FAILED

Requested by @jonsimantov on commit c046c8a
Last updated: Wed Jul 27 19:33 PDT 2022
View integration test log & download artifacts

Failures Configs
missing_log [TEST] [ERROR] [Android] [1/3 os: macos] [1/2 android_device: emulator_target]
firestore [TEST] [FAILURE] [Android] [1/3 os: ubuntu] [1/2 android_device: emulator_target]
(1 failed tests)  FirestoreIntegrationTest.AuthWorks
[TEST] [FAILURE] [tvOS] [macos] [tvos_simulator]
(1 failed tests)  CleanupTest.DocumentChangeIsBlankAfterCleanup
[TEST] [FLAKINESS] [Android] [1/3 os: ubuntu] [1/2 android_device: android_target]
(1 failed tests)  CRASH/TIMEOUT
gma [TEST] [FLAKINESS] [Android] [1/3 os: windows] [1/2 android_device: android_target]
(1 failed tests)  CRASH/TIMEOUT
[TEST] [FLAKINESS] [iOS] [macos] [1/2 ios_device: ios_target]
(1 failed tests)  FirebaseGmaTest.TestRewardedAdStress

Add flaky tests to go/fpl-cpp-flake-tracker

@github-actions github-actions bot added the tests: failed This PR's integration tests failed. label Jul 28, 2022
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Jul 28, 2022
@jonsimantov jonsimantov deleted the bugfix/packaging_auto_hide_namespaces branch August 8, 2022 18:16
@firebase firebase locked and limited conversation to collaborators Aug 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tests: failed This PR's integration tests failed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants