distrib: win: Repurpose sandbox distrib for bootstrap executables (see #3824)

This commit is contained in:
Marshall Greenblatt
2025-05-15 14:15:21 -04:00
parent dadfe2c8dc
commit 6a97b82ffc
3 changed files with 34 additions and 18 deletions

View File

@ -893,7 +893,7 @@ if not branch_is_master:
# Verify the minimum supported branch number. # Verify the minimum supported branch number.
if int(cef_branch) < 5060: if int(cef_branch) < 5060:
print('The requested branch (%s) is too old to build using this tool. ' + print('The requested branch (%s) is too old to build using this tool. ' +
'The minimum supported branch is 3071.' % cef_branch) 'The minimum supported branch is 5060.' % cef_branch)
sys.exit(1) sys.exit(1)
# True if the requested branch is 7151 or older. # True if the requested branch is 7151 or older.
@ -911,13 +911,20 @@ if platform == 'mac' and not (options.x64build or options.arm64build):
'Add --x64-build or --arm64-build flag to generate a 64-bit build.') 'Add --x64-build or --arm64-build flag to generate a 64-bit build.')
sys.exit(1) sys.exit(1)
# Platforms that build a cef_sandbox library. # Platforms that build a cef_sandbox library in a separate output directory.
sandbox_lib_platforms = ['mac'] sandbox_lib_platforms = ['mac']
if branch_is_7151_or_older:
sandbox_lib_platforms.append('win')
if not platform in sandbox_lib_platforms and (options.sandboxdistrib or # Platforms that build a bootstrap executable in the same output directory.
options.sandboxdistribonly): bootstrap_exe_platforms = []
if branch_is_7151_or_older:
sandbox_lib_platforms.append('windows')
else:
bootstrap_exe_platforms.append('windows')
if not platform in sandbox_lib_platforms and \
not platform in bootstrap_exe_platforms and \
(options.sandboxdistrib or options.sandboxdistribonly):
print('The sandbox distribution is not supported on this platform.') print('The sandbox distribution is not supported on this platform.')
sys.exit(1) sys.exit(1)
@ -1342,7 +1349,7 @@ if not options.nobuild and (chromium_checkout_changed or \
target += ' ' + options.testtarget target += ' ' + options.testtarget
if platform == 'linux': if platform == 'linux':
target += ' chrome_sandbox' target += ' chrome_sandbox'
if platform == 'windows' and not branch_is_7151_or_older: if platform in bootstrap_exe_platforms:
target += ' bootstrap bootstrapc' target += ' bootstrap bootstrapc'
# Make a CEF Debug build. # Make a CEF Debug build.

View File

@ -1,9 +1,9 @@
CONTENTS CONTENTS
-------- --------
Debug Contains the Debug build of cef_sandbox.lib. Debug Contains the Debug build of bootstrap.exe and bootstrapc.exe.
Release Contains the Release build of cef_sandbox.lib. Release Contains the Release build of bootstrap.exe and bootstrapc.exe.
USAGE USAGE
@ -11,4 +11,4 @@ USAGE
Please visit the CEF Website for usage information. Please visit the CEF Website for usage information.
https://bitbucket.org/chromiumembedded/cef/ https://bitbucket.org/chromiumembedded/cef/wiki/SandboxSetup.md

View File

@ -743,7 +743,7 @@ parser.add_option(
action='store_true', action='store_true',
dest='sandbox', dest='sandbox',
default=False, default=False,
help='include only the cef_sandbox static library (macOS only)') help='include only the cef_sandbox static library (macOS) or bootstrap executables (Windows)')
parser.add_option( parser.add_option(
'--tools', '--tools',
action='store_true', action='store_true',
@ -791,8 +791,8 @@ if options.armbuild and platform != 'linux':
print_error('--arm-build is only supported on Linux.') print_error('--arm-build is only supported on Linux.')
sys.exit() sys.exit()
if options.sandbox and platform != 'mac': if options.sandbox and not platform in ('mac', 'windows'):
print_error('--sandbox is only supported on macOS.') print_error('--sandbox is only supported on macOS and Windows.')
sys.exit() sys.exit()
if not options.ninjabuild: if not options.ninjabuild:
@ -1127,8 +1127,6 @@ elif platform == 'windows':
{'path': 'vulkan-1.dll'}, {'path': 'vulkan-1.dll'},
] ]
pdb_files = [ pdb_files = [
{'path': 'bootstrap.exe.pdb'},
{'path': 'bootstrapc.exe.pdb'},
{'path': 'chrome_elf.dll.pdb'}, {'path': 'chrome_elf.dll.pdb'},
{'path': 'dxcompiler.dll.pdb', 'conditional': True}, {'path': 'dxcompiler.dll.pdb', 'conditional': True},
{'path': '%s.pdb' % libcef_dll}, {'path': '%s.pdb' % libcef_dll},
@ -1144,14 +1142,25 @@ elif platform == 'windows':
'path': 'cefsimple.exe' if platform_arch == 'arm64' else 'cefclient.exe' 'path': 'cefsimple.exe' if platform_arch == 'arm64' else 'cefclient.exe'
}) })
else: else:
if mode == 'sandbox':
# Only include the sandbox binaries.
binaries = []
pdb_files = []
# yapf: disable # yapf: disable
binaries.extend([ binaries.extend([
{'path': 'bootstrap.exe'}, {'path': 'bootstrap.exe'},
{'path': 'bootstrapc.exe'}, {'path': 'bootstrapc.exe'},
{'path': '%s.lib' % libcef_dll, 'out_path': 'libcef.lib'}, ])
pdb_files.extend([
{'path': 'bootstrap.exe.pdb'},
{'path': 'bootstrapc.exe.pdb'},
]) ])
# yapf: enable # yapf: enable
if mode != 'sandbox':
binaries.append({'path': '%s.lib' % libcef_dll, 'out_path': 'libcef.lib'})
# yapf: disable # yapf: disable
resources = [ resources = [
{'path': 'chrome_100_percent.pak'}, {'path': 'chrome_100_percent.pak'},
@ -1164,7 +1173,7 @@ elif platform == 'windows':
valid_build_dir = None valid_build_dir = None
if mode == 'standard': if mode == 'standard' or mode == 'sandbox':
# transfer Debug files # transfer Debug files
build_dir = build_dir_debug build_dir = build_dir_debug
if not options.allowpartial or path_exists( if not options.allowpartial or path_exists(
@ -1199,7 +1208,7 @@ elif platform == 'windows':
else: else:
sys.stdout.write("No Release build files.\n") sys.stdout.write("No Release build files.\n")
if not valid_build_dir is None: if mode != 'sandbox' and not valid_build_dir is None:
# transfer resource files # transfer resource files
build_dir = valid_build_dir build_dir = valid_build_dir
if mode == 'client': if mode == 'client':