# 4747cc23ae334a57a35ed3c8e6adcdbc8a50d479 source_version = sys.argv[1] print('Building Chromium ' + source_version) # Set the environment variables required by the build tools print('Configuring the build environment') configure_environment() # Sync the codebase to the correct version, syncing master first # to ensure that we actually have all the versions we may refer to print('Syncing source code') os.chdir(os.path.join(root_dir, 'chromium/src')) runcmd('git checkout master') runcmd('git fetch origin') runcmd('gclient sync --with_branch_heads --with_tags --jobs 16') runcmd('git checkout ' + source_version) runcmd('gclient sync --with_branch_heads --with_tags --jobs 16') runcmd('gclient runhooks') # Copy build args/{Linux | Darwin | Windows}.gn from the root of our directory to out/headless/args.gn, platform_build_args = os.path.join(script_dir, platform.system().lower(), 'args.gn') print('Generating platform-specific args') print('Copying build args: ' + platform_build_args + ' to out/headless/args.gn') mkdir('out/headless') shutil.copyfile(platform_build_args, 'out/headless/args.gn') runcmd('gn gen out/headless')
import os, platform, sys from build_util import runcmd, mkdir, md5_file, root_dir, configure_environment # This is a cross-platform initialization script which should only be run # once per environment, and isn't intended to be run directly. You should # run the appropriate platform init script (e.g. Linux/init.sh) which will # call this once the platform-specific initialization has completed. os.chdir(root_dir) # Configure git runcmd('git config --global core.autocrlf false') runcmd('git config --global core.filemode false') runcmd('git config --global branch.autosetuprebase always') # Grab Chromium's custom build tools, if they aren't already installed # (On Windows, they are installed before this Python script is run) if not os.path.isdir('depot_tools'): runcmd( 'git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git' ) # Put depot_tools on the path so we can properly run the fetch command configure_environment() # Fetch the Chromium source code mkdir('chromium') os.chdir('chromium') runcmd('fetch chromium') # Build Linux deps
# This is a cross-platform initialization script which should only be run # once per environment. # Set to "arm" to build for ARM arch_name = sys.argv[1] if len(sys.argv) >= 2 else 'undefined' build_path = path.abspath(os.curdir) src_path = path.abspath(path.join(build_path, 'chromium', 'src')) if arch_name != 'x64' and arch_name != 'arm64': raise Exception('Unexpected architecture: ' + arch_name + '. `x64` and `arm64` are supported.') # Configure git print('Configuring git globals...') runcmd('git config --global core.autocrlf false') runcmd('git config --global core.filemode false') runcmd('git config --global branch.autosetuprebase always') runcmd('git config --global core.compression 0') # Grab Chromium's custom build tools, if they aren't already installed # Put depot_tools on the path so we can properly run the fetch command if not path.isdir('depot_tools'): print('Installing depot_tools...') runcmd( 'git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git' ) else: print('Updating depot_tools...') original_dir = os.curdir os.chdir(path.join(build_path, 'depot_tools'))
# 4747cc23ae334a57a35ed3c8e6adcdbc8a50d479 source_version = sys.argv[1] print('Building Chromium ' + source_version) # Set the environment variables required by the build tools print('Configuring the build environment') configure_environment() # Sync the codebase to the correct version, syncing master first # to ensure that we actually have all the versions we may refer to print('Syncing source code') os.chdir(os.path.join(root_dir, 'chromium/src')) runcmd('git checkout master') runcmd('git fetch origin') runcmd('gclient sync --with_branch_heads --with_tags --jobs 16') runcmd('git checkout ' + source_version) runcmd('gclient sync --with_branch_heads --with_tags --jobs 16') runcmd('gclient runhooks') # Copy build args/{Linux | Darwin | Windows}.gn from the root of our directory to out/headless/args.gn, platform_build_args = os.path.join(script_dir, platform.system().lower(), 'args.gn') print('Generating platform-specific args') print('Copying build args: ' + platform_build_args + ' to out/headless/args.gn') mkdir('out/headless') shutil.copyfile(platform_build_args, 'out/headless/args.gn') runcmd('gn gen out/headless') # Build Chromium... this takes *forever* on underpowered VMs
src_path) print('src path: ' + src_path) print('depot_tools path: ' + path.join(build_path, 'depot_tools')) print('build_chromium_path: ' + build_chromium_path) print('args.gn file: ' + argsgn_file) print # Sync the codebase to the correct version print('Setting local tracking branch') print(' > cd ' + src_path) os.chdir(src_path) checked_out = runcmdsilent('git checkout build-' + base_version) if checked_out != 0: print('Syncing remote version') runcmd('git fetch origin ' + source_version) print('Creating a new branch for tracking the source version') runcmd('git checkout -b build-' + base_version + ' ' + source_version) depot_tools_path = os.path.join(build_path, 'depot_tools') path_value = depot_tools_path + os.pathsep + os.environ['PATH'] print('Updating PATH for depot_tools: ' + path_value) os.environ['PATH'] = path_value print('Updating all modules') runcmd('gclient sync') # Copy build args/{Linux | Darwin | Windows}.gn from the root of our directory to out/headless/args.gn, argsgn_destination = path.abspath('out/headless/args.gn') print('Generating platform-specific args') mkdir('out/headless') print(' > cp ' + argsgn_file + ' ' + argsgn_destination)
src_path) print('src path: ' + src_path) print('depot_tools path: ' + path.join(build_path, 'depot_tools')) print('build_chromium_path: ' + build_chromium_path) print('args.gn file: ' + argsgn_file) print # Sync the codebase to the correct version print('Setting local tracking branch') print(' > cd ' + src_path) os.chdir(src_path) checked_out = runcmdsilent('git checkout build-' + base_version) if checked_out != 0: print('Syncing remote version') runcmd('git fetch origin ' + source_version) print('Creating a new branch for tracking the source version') runcmd('git checkout -b build-' + base_version + ' ' + source_version) # configure environment: environment path depot_tools_path = os.path.join(build_path, 'depot_tools') full_path = depot_tools_path + os.pathsep + os.environ['PATH'] print('Updating PATH for depot_tools: ' + full_path) os.environ['PATH'] = full_path # configure environment: build dependencies if platform.system() == 'Linux': if arch_name: print('Running sysroot install script...') runcmd(src_path + '/build/linux/sysroot_scripts/install-sysroot.py --arch=' +
import os, platform from build_util import runcmd, mkdir, md5_file, root_dir, configure_environment # This is a cross-platform initialization script which should only be run # once per environment, and isn't intended to be run directly. You should # run the appropriate platform init script (e.g. Linux/init.sh) which will # call this once the platform-specific initialization has completed. os.chdir(root_dir) # Configure git runcmd('git config --global core.autocrlf false') runcmd('git config --global core.filemode false') runcmd('git config --global branch.autosetuprebase always') # Grab Chromium's custom build tools, if they aren't already installed # (On Windows, they are installed before this Python script is run) if not os.path.isdir('depot_tools'): runcmd('git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git') # Put depot_tools on the path so we can properly run the fetch command configure_environment() # Fetch the Chromium source code mkdir('chromium') os.chdir('chromium') runcmd('fetch chromium') # Build Linux deps if platform.system() == 'Linux': os.chdir('src')