Skip to content
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

fix: strip branded binaries #36655

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions script/add-debug-link.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import os
import sys

from lib.config import LINUX_BINARIES, PLATFORM
from lib.util import execute, get_out_dir
from lib.config import PLATFORM
from lib.util import execute, get_linux_binaries, get_out_dir

def add_debug_link_into_binaries(directory, target_cpu, debug_dir):
for binary in LINUX_BINARIES:
for binary in get_linux_binaries():
binary_path = os.path.join(directory, binary)
if os.path.isfile(binary_path):
add_debug_link_into_binary(binary_path, target_cpu, debug_dir)
Expand Down
6 changes: 3 additions & 3 deletions script/copy-debug-symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import os
import sys

from lib.config import LINUX_BINARIES, PLATFORM
from lib.util import execute, get_out_dir, safe_mkdir
from lib.config import PLATFORM
from lib.util import execute, get_linux_binaries, get_out_dir, safe_mkdir

# It has to be done before stripping the binaries.
def copy_debug_from_binaries(directory, out_dir, target_cpu, compress):
for binary in LINUX_BINARIES:
for binary in get_linux_binaries():
binary_path = os.path.join(directory, binary)
if os.path.isfile(binary_path):
copy_debug_from_binary(binary_path, out_dir, target_cpu, compress)
Expand Down
10 changes: 0 additions & 10 deletions script/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@
'win32': 'win32',
}[sys.platform]

LINUX_BINARIES = [
'chrome-sandbox',
'chrome_crashpad_handler',
'electron',
'libEGL.so',
'libGLESv2.so',
'libffmpeg.so',
'libvk_swiftshader.so',
]

verbose_mode = False


Expand Down
11 changes: 11 additions & 0 deletions script/lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,14 @@ def get_buildtools_executable(name):
if sys.platform == 'win32':
path += '.exe'
return path

def get_linux_binaries():
return [
'chrome-sandbox',
'chrome_crashpad_handler',
get_electron_branding()['project_name'],
'libEGL.so',
'libGLESv2.so',
'libffmpeg.so',
'libvk_swiftshader.so',
]
6 changes: 3 additions & 3 deletions script/strip-binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import os
import sys

from lib.config import LINUX_BINARIES, enable_verbose_mode
from lib.util import execute, get_out_dir
from lib.config import enable_verbose_mode
from lib.util import execute, get_linux_binaries, get_out_dir

def strip_binaries(directory, target_cpu):
for binary in LINUX_BINARIES:
for binary in get_linux_binaries():
binary_path = os.path.join(directory, binary)
if os.path.isfile(binary_path):
strip_binary(binary_path, target_cpu)
Expand Down