-
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
Changes from 39 commits
6a78ebc
d3a057c
67bc714
0423843
8ae3143
0d9065f
61e802f
baa7ce7
69ffbdd
4e340bd
5e33487
c1b0c6f
8b17dbf
a6c90d0
d01a21e
3a00f84
d05661a
c574844
a9164ac
99cb123
b7c4382
2ed99dc
723e26e
2840d35
eca1452
f9a5846
609e748
5f747f7
6865231
9e14cc0
74a4c07
cb1f66e
ca29af7
f23c706
1e10a48
fd0c6d9
eeb528b
b2f7a06
af33afa
f543a28
3ee6f56
1783d7a
ba52fda
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 |
---|---|---|
|
@@ -28,8 +28,8 @@ on: | |
|
||
env: | ||
# Packaging prerequisites | ||
# Demumble 1.1.0 released Nov 13, 2018 | ||
demumbleVer: "1.1.0" | ||
# Demumble version from March 22, 2022 | ||
demumbleVer: "df938e45c2b0e064fb5323d88b692d03b451d271" | ||
# Use SHA256 for hashing files. | ||
hashCommand: "sha256sum" | ||
# Xcode version 13.3.1 is the version we build the SDK with. | ||
|
@@ -94,6 +94,11 @@ jobs: | |
if: runner.os == 'macOS' | ||
run: sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Fetch and build binutils | ||
run: | | ||
set +e | ||
|
@@ -154,14 +159,14 @@ jobs: | |
with: | ||
repository: nico/demumble | ||
path: demumble-src | ||
ref: v${{ env.demumbleVer }} | ||
ref: ${{ env.demumbleVer }} | ||
|
||
- name: build demumble | ||
run: | | ||
cd demumble-src | ||
cmake . | ||
cmake --build . | ||
python demumble_test.py | ||
python3 demumble_test.py | ||
cd - | ||
mkdir -p packaging-tools | ||
cp -af demumble-src/demumble packaging-tools | ||
|
@@ -544,6 +549,9 @@ jobs: | |
cd sdk-src | ||
python scripts/gha/install_prereqs_desktop.py --ssl boringssl | ||
cd .. | ||
if [[ $(uname) == "Darwin"* ]]; 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. 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 commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
brew install parallel | ||
fi | ||
|
||
- name: postprocess and package built SDK | ||
run: | | ||
|
@@ -605,6 +613,44 @@ jobs: | |
name: firebase-cpp-sdk-${{ matrix.sdk_platform }}${{ matrix.suffix}}-package | ||
path: firebase-cpp-sdk-${{ matrix.sdk_platform }}${{ matrix.suffix}}-package.tgz | ||
|
||
- name: Check for unrenamed namespaces | ||
shell: bash | ||
run: | | ||
set +e | ||
if [[ "${{ matrix.sdk_platform }}" == "darwin" ]]; then | ||
nm=bin/llvm-nm | ||
elif [[ "${{ matrix.sdk_platform }}" == "windows" ]]; then | ||
if [[ "${{ matrix.sdk_platform }}" == *"x64"* ]]; then | ||
nm="bin/nm --target pe-x86-64" | ||
else | ||
nm="bin/nm --target pe-i386" | ||
fi | ||
else # sdk_platform = linux | ||
nm=bin/nm | ||
fi | ||
${nm} `find firebase-cpp-sdk-*-package/libs/${{ matrix.sdk_platform }} -type f` | grep '^[0-9a-fA-F][0-9a-fA-F]* ' | cut -d' ' -f3- > raw_symbols.txt | ||
if [[ "${{ matrix.sdk_platform }}" == "windows" ]]; then | ||
cat raw_symbols.txt | sort | uniq | bin/demumble | grep '^[a-zA-Z_]*::' > cpp_symbols.txt | ||
elif [[ "${{ matrix.sdk_platform }}" == "darwin" ]]; then | ||
# remove leading _ on mach-o symbols | ||
cat raw_symbols.txt | sort | uniq | sed 's/^_//' | bin/c++filt | grep '^[a-zA-Z_]*::' > cpp_symbols.txt | ||
else # linux | ||
cat raw_symbols.txt | sort | uniq | bin/c++filt | grep '^[a-zA-Z_]*::' > cpp_symbols.txt | ||
fi | ||
# cpp_symbols.txt contains a list of all C++ symbols, sorted and deduped | ||
# get a list of all top-level namespaces (except system namespaces) | ||
cat cpp_symbols.txt | cut -d: -f1 | sort | uniq > cpp_namespaces.txt | ||
echo "List of all namespaces found:" | ||
cat cpp_namespaces.txt | ||
# Filter out renamed namespaces (f_b_*), standard namespaces, and the public namespace (firebase::) | ||
allow_namespaces="f_b_.*|std|stdext|__gnu_cxx|cxxabiv1|firebase" | ||
DellaBitta marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cat cpp_namespaces.txt | grep -vE "^(${allow_namespaces})$" > extra_namespaces.txt | ||
# If there are any namespaces in this file, print an error. | ||
if [[ -s extra_namespaces.txt ]]; then | ||
echo '::error ::Unrenamed C++ namespaces in ${{ matrix.sdk_platform }}${{ matrix.suffix }} package:%0A'$(cat extra_namespaces.txt | tr '\n' ' ' | sed 's/ /%0A/g') | ||
exit 1 | ||
fi | ||
|
||
- name: cleanup build artifacts | ||
if: | | ||
( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,29 +208,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_ | ||
|
||
|
@@ -260,14 +237,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=firebase | ||
) | ||
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 | ||
|
Uh oh!
There was an error while loading. Please reload this page.