devops: fix Chromium archiving logic (#9940)
Upstream Chromium changed the way they configure browser bundles; this patch moves us from relying upon `FILES.cfg` onto `//infra/archive_config/*` configs. Fixes #9936
This commit is contained in:
Родитель
0221f1a4e0
Коммит
567e80eef7
|
@ -62,15 +62,15 @@ function archive_compiled_chromium() {
|
|||
|
||||
if [[ $1 == "--compile-mac"* ]]; then
|
||||
CHROMIUM_FOLDER_NAME="chrome-mac"
|
||||
CHROMIUM_FILES_TO_ARCHIVE=("Chromium.app")
|
||||
IFS=$'\n' CHROMIUM_FILES_TO_ARCHIVE=($(node "${SCRIPT_PATH}/compute_files_to_archive.js" "${CR_CHECKOUT_PATH}/src/infra/archive_config/mac-archive-rel.json"))
|
||||
unset IFS
|
||||
elif [[ $1 == "--compile-linux"* ]]; then
|
||||
CHROMIUM_FOLDER_NAME="chrome-linux"
|
||||
# Run python script and convert output to array.
|
||||
IFS=$'\n' CHROMIUM_FILES_TO_ARCHIVE=($(python "${SCRIPT_PATH}/compute_files_to_archive.py" 64bit "${CR_CHECKOUT_PATH}/src/chrome/tools/build/linux/FILES.cfg"))
|
||||
IFS=$'\n' CHROMIUM_FILES_TO_ARCHIVE=($(node "${SCRIPT_PATH}/compute_files_to_archive.js" "${CR_CHECKOUT_PATH}/src/infra/archive_config/linux-archive-rel.json"))
|
||||
unset IFS
|
||||
elif [[ $1 == "--compile-win64" ]]; then
|
||||
CHROMIUM_FOLDER_NAME="chrome-win"
|
||||
IFS=$'\n\r' CHROMIUM_FILES_TO_ARCHIVE=($(python "${SCRIPT_PATH}/compute_files_to_archive.py" 64bit "${CR_CHECKOUT_PATH}/src/chrome/tools/build/win/FILES.cfg"))
|
||||
IFS=$'\n\r' CHROMIUM_FILES_TO_ARCHIVE=($(node "${SCRIPT_PATH}/compute_files_to_archive.js" "${CR_CHECKOUT_PATH}/src/infra/archive_config/win-archive-rel.json"))
|
||||
unset IFS
|
||||
else
|
||||
echo "ERROR: unknown command, use --help for details"
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
// This script is supposed to be run with a path to either of the following configs from chromium checkout:
|
||||
// - infra/archive_config/mac-archive-rel.json
|
||||
// - infra/archive_config/linux-archive-rel.json
|
||||
// - infra/archive_config/win-archive-rel.json
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
const configs = JSON.parse(fs.readFileSync(process.argv[2], 'utf8')).archive_datas;
|
||||
const config = configs.find(config => config.gcs_path.includes('chrome-linux.zip') || config.gcs_path.includes('chrome-win.zip') || config.gcs_path.includes('chrome-mac.zip'));
|
||||
for (const file of config.files || [])
|
||||
console.log(file);
|
||||
for (const dir of config.dirs || [])
|
||||
console.log(dir);
|
|
@ -1,57 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
import json
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("ERROR: expected arch: 32bit or 64bit")
|
||||
sys.exit(1)
|
||||
|
||||
if str(sys.argv[1]) == "--help" or str(sys.argv[1]) == "-h":
|
||||
print("Usage: read_files.py [32bit|64bit] <files.cfg path>")
|
||||
sys.exit(1)
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
print("ERROR: expected FILE.cfg path")
|
||||
sys.exit(1)
|
||||
|
||||
exclude_list = [
|
||||
# Windows exclude list
|
||||
"chrome_child.dll",
|
||||
"gaia1_0.dll",
|
||||
"gcp_setup.exe",
|
||||
"icudt.dll",
|
||||
"interactive_ui_tests.exe",
|
||||
"*.manifest",
|
||||
# Linux exclude list
|
||||
"session",
|
||||
]
|
||||
|
||||
target_arch = sys.argv[1]
|
||||
file_name = sys.argv[2]
|
||||
|
||||
descriptors=[]
|
||||
if sys.version_info > (3, 0):
|
||||
exec(open(file_name).read())
|
||||
descriptors = FILES
|
||||
else:
|
||||
variables = {}
|
||||
execfile(file_name, variables)
|
||||
descriptors = variables['FILES']
|
||||
|
||||
def filter_descriptors(entry):
|
||||
if 'archive' in entry:
|
||||
return False
|
||||
if not 'buildtype' in entry:
|
||||
return False
|
||||
if not 'dev' in entry['buildtype']:
|
||||
return False
|
||||
if ('arch' in entry) and (entry['arch'] != target_arch):
|
||||
return False
|
||||
if entry['filename'] in exclude_list:
|
||||
return False
|
||||
return True
|
||||
|
||||
for entry in filter(filter_descriptors, descriptors):
|
||||
print(entry['filename'])
|
||||
|
Загрузка…
Ссылка в новой задаче