-
Notifications
You must be signed in to change notification settings - Fork 124
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
Changes from 40 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
6a78ebc
Change desktop packaging to automatically get the list of C++ namespa…
jonsimantov d3a057c
Add additional namespace to ignore.
jonsimantov 67bc714
Add readme note
jonsimantov 0423843
After packaging, scan the libraries to ensure no leaking namespaces.
jonsimantov 8ae3143
Update to newer demumble version
jonsimantov 0d9065f
Fix hash
jonsimantov 61e802f
demumble now requires python3
jonsimantov baa7ce7
Add missing parallel install
jonsimantov 69ffbdd
Merge branch 'main' into bugfix/packaging_auto_hide_namespaces
jonsimantov 4e340bd
Fix a bug in merge_libraries that did not rename all symbols.
jonsimantov 5e33487
Turn on debug output
jonsimantov c1b0c6f
Remove top-level firestore namespace from ignore list.
jonsimantov 8b17dbf
Don't ignore firestore namespace when checking for invalid ones
jonsimantov a6c90d0
Fix a bug that failed to find namespaces with tildes.
jonsimantov d01a21e
Temporarily enable logging of found namespaces
jonsimantov 3a00f84
Fix command line
jonsimantov d05661a
Revert "Temporarily enable logging of found namespaces"
jonsimantov c574844
Add more implicit namespaces.
jonsimantov a9164ac
Add debug output
jonsimantov 99cb123
Fix shell script
jonsimantov b7c4382
Fix regex to catch destructors properly.
jonsimantov 2ed99dc
Also parse `RTTI Class Heirarchy Descriptor` on windows.
jonsimantov 723e26e
Add '$' to top-level namespace search for Darwin.
jonsimantov 2840d35
Fix renaming of Windows symbols with RTTI info, etc.
jonsimantov eca1452
Add tests for merge_libraries script.
jonsimantov f9a5846
Fix Windows symbol renaming for odd C++ symbols like RTTI descriptors
jonsimantov 609e748
Ignore underscores as well to fix a Windows packging issue
jonsimantov 5f747f7
Don't detect namespaces from external symbols.
jonsimantov 6865231
Don't auto-add namespaces with underscores.
jonsimantov 9e14cc0
Fix namespace detection to only rename top-level; add test.
jonsimantov 74a4c07
Format code
jonsimantov cb1f66e
Clean up merge_libraries_test output
jonsimantov ca29af7
Fix python bug
jonsimantov f23c706
Add test for add_automatic_namespaces
jonsimantov 1e10a48
Turn off debug output.
jonsimantov fd0c6d9
Add additional namespace to the list of ignored namespaces, for Windows.
jonsimantov eeb528b
Remove commented-out code
jonsimantov b2f7a06
Merge branch 'main' into bugfix/packaging_auto_hide_namespaces
jonsimantov af33afa
Move readme comment to upcoming release.
jonsimantov f543a28
Allow the list of allowed namespaces to be determined programatically.
jonsimantov 3ee6f56
Fix path.
jonsimantov 1783d7a
Fix typo
jonsimantov ba52fda
Fix regex
jonsimantov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ options: | |
-j, run merge_libraries jobs in parallel | ||
-v, enable verbose mode | ||
-L, use LLVM binutils | ||
-R, print rename prefix and exit | ||
-N, print allowed namespaces and exit | ||
example: | ||
build_scripts/desktop/package.sh -b firebase-cpp-sdk-linux -p linux -o package_out -v x86 -j" | ||
} | ||
|
@@ -42,6 +44,11 @@ use_llvm_binutils=0 | |
|
||
readonly SUPPORTED_PLATFORMS=(linux windows darwin) | ||
|
||
# String to prepend to all hidden symbols. | ||
readonly rename_string=f_b_ | ||
# Comma-separated list of c++ namespaces to allow. | ||
readonly allow_cpp_namespaces=firebase | ||
|
||
abspath(){ | ||
if [[ -d $1 ]]; then | ||
echo "$(cd "$1"; pwd -P)" | ||
|
@@ -50,7 +57,7 @@ abspath(){ | |
fi | ||
} | ||
|
||
while getopts "f:b:o:p:d:m:P:t:hjLv" opt; do | ||
while getopts "f:b:o:p:d:m:P:t:NRhjLv" opt; do | ||
case $opt in | ||
f) | ||
binutils_format=$OPTARG | ||
|
@@ -94,6 +101,14 @@ while getopts "f:b:o:p:d:m:P:t:hjLv" opt; do | |
t) | ||
tools_path=$OPTARG | ||
;; | ||
N) | ||
echo "${allow_cpp_namespaces}" | tr ',' '\n' | ||
exit 0 | ||
;; | ||
R) | ||
echo "${rename_string}" | ||
exit 0 | ||
;; | ||
h) | ||
usage | ||
exit 0 | ||
|
@@ -208,32 +223,6 @@ readonly deps_hidden_firebase_firestore=" | |
*/firestore-build/*/grpc-build/third_party/re2/*${subdir}${prefix}re2.${ext} | ||
" | ||
|
||
# List of C++ namespaces to be renamed, so as to not conflict with the | ||
# developer's own dependencies. | ||
readonly -a rename_namespaces=(flatbuffers flexbuffers reflection ZLib bssl uWS absl google | ||
base_raw_logging ConnectivityWatcher grpc | ||
grpc_access_token_credentials grpc_alts_credentials | ||
grpc_alts_server_credentials grpc_auth_context | ||
grpc_channel_credentials grpc_channel_security_connector | ||
grpc_chttp2_hpack_compressor grpc_chttp2_stream grpc_chttp2_transport | ||
grpc_client_security_context grpc_composite_call_credentials | ||
grpc_composite_channel_credentials grpc_core grpc_deadline_state | ||
grpc_google_default_channel_credentials grpc_google_iam_credentials | ||
grpc_google_refresh_token_credentials grpc_impl grpc_local_credentials | ||
grpc_local_server_credentials grpc_md_only_test_credentials | ||
grpc_message_compression_algorithm_for_level | ||
grpc_oauth2_token_fetcher_credentials grpc_plugin_credentials | ||
grpc_server_credentials grpc_server_security_connector | ||
grpc_server_security_context | ||
grpc_service_account_jwt_access_credentials grpc_ssl_credentials | ||
grpc_ssl_server_credentials grpc_tls_credential_reload_config | ||
grpc_tls_server_authorization_check_config GrpcUdpListener leveldb | ||
leveldb_filterpolicy_create_bloom leveldb_writebatch_iterate strings | ||
TlsCredentials TlsServerCredentials tsi snappy re2) | ||
|
||
# String to prepend to all hidden symbols. | ||
readonly rename_string=f_b_ | ||
|
||
readonly demangle_cmds=${tools_path}/c++filt,${tools_path}/demumble | ||
if [[ ${use_llvm_binutils} -eq 1 ]]; then | ||
readonly binutils_objcopy=${tools_path}/llvm-objcopy | ||
|
@@ -260,14 +249,11 @@ merge_libraries_params=( | |
--binutils_objcopy_cmd=${binutils_objcopy} | ||
--demangle_cmds=${demangle_cmds} | ||
--platform=${platform} | ||
--hide_cpp_namespaces=$(echo "${rename_namespaces[*]}" | sed 's| |,|g') | ||
--auto_hide_cpp_namespaces | ||
--ignore_cpp_namespaces="${allow_cpp_namespaces}" | ||
) | ||
cache_param=--cache=${cache_file} | ||
|
||
if [[ ${platform} == "windows" ]]; then | ||
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. No longer needed with the newer Demumble version. |
||
# Windows has a hard time with strict C++ demangling. | ||
merge_libraries_params+=(--nostrict_cpp) | ||
fi | ||
if [[ ${verbose} -eq 1 ]]; then | ||
merge_libraries_params+=(--verbosity=3) | ||
fi | ||
|
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
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
Oops, something went wrong.
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.
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.
Fixes an issue where Mac packaging was not done in parallel due to the "parallel" tool not being installed. Speeds up packaging on Mac.
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.
👍