-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Reporting] code cleanup for reporting browser build/install/setup utilities #98799
Changes from all commits
ceeb4d9
361bc1e
fa138c8
325ef7b
95dc744
78a0642
222cb22
571b1bd
1690b04
395785a
ef22598
ca531a9
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 |
---|---|---|
|
@@ -3,21 +3,18 @@ | |
from build_util import ( | ||
runcmd, | ||
runcmdsilent, | ||
mkdir, | ||
md5_file, | ||
configure_environment, | ||
) | ||
|
||
# This file builds Chromium headless on Windows, Mac, and Linux. | ||
|
||
# Verify that we have an argument, and if not print instructions | ||
if (len(sys.argv) < 2): | ||
print('Usage:') | ||
print('python build.py {chromium_version} [arch_name]') | ||
print('python build.py {chromium_version} {arch_name}') | ||
print('Example:') | ||
print('python build.py 68.0.3440.106') | ||
print('python build.py 4747cc23ae334a57a35ed3c8e6adcdbc8a50d479') | ||
print('python build.py 4747cc23ae334a57a35ed3c8e6adcdbc8a50d479 arm64 # build for ARM architecture') | ||
print('python build.py 4747cc23ae334a57a35ed3c8e6adcdbc8a50d479 x64') | ||
print('python build.py 4747cc23ae334a57a35ed3c8e6adcdbc8a50d479 arm64 # cross-compile for ARM architecture') | ||
sys.exit(1) | ||
|
||
|
@@ -57,25 +54,34 @@ | |
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') | ||
path_value = depot_tools_path + os.pathsep + os.environ['PATH'] | ||
print('Updating PATH for depot_tools: ' + path_value) | ||
os.environ['PATH'] = path_value | ||
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=' + arch_name) | ||
print('Running install-build-deps...') | ||
runcmd(src_path + '/build/install-build-deps.sh') | ||
|
||
|
||
print('Updating all modules') | ||
runcmd('gclient sync') | ||
runcmd('gclient sync -D') | ||
|
||
# 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) | ||
shutil.copyfile(argsgn_file, argsgn_destination) | ||
print('Setting up build directory') | ||
runcmd('rm -rf out/headless') | ||
runcmd('mkdir out/headless') | ||
|
||
# Copy build args/{Linux | Darwin | Windows}.gn from the root of our directory to out/headless/args.gn, | ||
# add the target_cpu for cross-compilation | ||
print('Adding target_cpu to args') | ||
|
||
f = open('out/headless/args.gn', 'a') | ||
f.write('\rtarget_cpu = "' + arch_name + '"\r') | ||
f.close() | ||
argsgn_file_out = path.abspath('out/headless/args.gn') | ||
runcmd('cp ' + argsgn_file + ' ' + argsgn_file_out) | ||
runcmd('echo \'target_cpu="' + arch_name + '"\' >> ' + argsgn_file_out) | ||
|
||
runcmd('gn gen out/headless') | ||
|
||
|
@@ -136,3 +142,6 @@ def archive_file(name): | |
print('Creating ' + path.join(src_path, md5_filename)) | ||
with open (md5_filename, 'w') as f: | ||
f.write(md5_file(zip_filename)) | ||
|
||
runcmd('gsutil cp ' + path.join(src_path, zip_filename) + ' gs://headless_shell_staging') | ||
runcmd('gsutil cp ' + path.join(src_path, md5_filename) + ' gs://headless_shell_staging') | ||
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. cc @spalger : this adds an auto-upload to a staging bucket as we talked about. I think this suffices the problem we had here: #98688 (comment) This is without adding a dry-run option to the script, as discussed. LMK if you think it needs the dry-run option. (It would be a pain since a run takes hours.) 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. Yeah, I think this is the best approach, then staging assets can just be Might be nice to use an environment variable to switch out the URLs to actually download from staging so we can test things before promoting them. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,15 @@ use_alsa = false | |
use_cups = false | ||
use_dbus = false | ||
use_gio = false | ||
# Please, consult @elastic/kibana-security before changing/removing this option. | ||
use_kerberos = false | ||
use_libpci = false | ||
use_pulseaudio = false | ||
use_udev = false | ||
|
||
is_debug = false | ||
symbol_level = 0 | ||
is_component_build = false | ||
remove_webcore_debug_symbols = true | ||
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.
|
||
|
||
# Please, consult @elastic/kibana-security before changing/removing this option. | ||
use_kerberos = false | ||
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. moved these lines down to match the order of lines with |
||
|
||
# target_cpu is appended before build: "x64" or "arm64" |
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.
the
f.write
code was not working most of the time: seemed to be a race condition where the previous line of code would complete later than expected