chromium: resolve ref to rev for blink version string (#358997)
This commit is contained in:
commit
8586e0559f
@ -379,7 +379,7 @@ let
|
||||
postPatch = lib.optionalString (!isElectron) ''
|
||||
ln -s ${./files/gclient_args.gni} build/config/gclient_args.gni
|
||||
|
||||
echo 'LASTCHANGE=${upstream-info.DEPS."src".rev}-refs/heads/master@{#0}' > build/util/LASTCHANGE
|
||||
echo 'LASTCHANGE=${upstream-info.DEPS."src".rev}-refs/tags/${version}@{#0}' > build/util/LASTCHANGE
|
||||
echo "$SOURCE_DATE_EPOCH" > build/util/LASTCHANGE.committime
|
||||
|
||||
cat << EOF > gpu/config/gpu_lists_version.h
|
||||
|
@ -19,7 +19,7 @@
|
||||
"DEPS": {
|
||||
"src": {
|
||||
"url": "https://chromium.googlesource.com/chromium/src.git",
|
||||
"rev": "131.0.6778.85",
|
||||
"rev": "3d81e41b6f3ac8bcae63b32e8145c9eb0cd60a2d",
|
||||
"hash": "sha256-fREToEHVbTD0IVGx/sn7csSju4BYajWZ+LDCiKWV4cI=",
|
||||
"recompress": true
|
||||
},
|
||||
@ -785,7 +785,7 @@
|
||||
"DEPS": {
|
||||
"src": {
|
||||
"url": "https://chromium.googlesource.com/chromium/src.git",
|
||||
"rev": "131.0.6778.85",
|
||||
"rev": "3d81e41b6f3ac8bcae63b32e8145c9eb0cd60a2d",
|
||||
"hash": "sha256-fREToEHVbTD0IVGx/sn7csSju4BYajWZ+LDCiKWV4cI=",
|
||||
"recompress": true
|
||||
},
|
||||
|
@ -50,6 +50,8 @@ for (const attr_path of Object.keys(lockfile)) {
|
||||
// unconditionally remove ungoogled-chromium's epoch/sub-version (e.g. 130.0.6723.116-1 -> 130.0.6723.116)
|
||||
const version_chromium = version_upstream.split('-')[0]
|
||||
|
||||
const chromium_rev = await chromium_resolve_tag_to_rev(version_chromium)
|
||||
|
||||
lockfile[attr_path] = {
|
||||
version: version_chromium,
|
||||
chromedriver: !ungoogled ? await fetch_chromedriver_binaries(version_chromium) : undefined,
|
||||
@ -62,20 +64,20 @@ for (const attr_path of Object.keys(lockfile)) {
|
||||
DEPS: {},
|
||||
}
|
||||
|
||||
const depot_tools = await fetch_depot_tools(version_chromium, lockfile_initial[attr_path].deps.depot_tools)
|
||||
const depot_tools = await fetch_depot_tools(chromium_rev, lockfile_initial[attr_path].deps.depot_tools)
|
||||
lockfile[attr_path].deps.depot_tools = {
|
||||
rev: depot_tools.rev,
|
||||
hash: depot_tools.hash,
|
||||
}
|
||||
|
||||
const gn = await fetch_gn(version_chromium, lockfile_initial[attr_path].deps.gn)
|
||||
const gn = await fetch_gn(chromium_rev, lockfile_initial[attr_path].deps.gn)
|
||||
lockfile[attr_path].deps.gn = {
|
||||
rev: gn.rev,
|
||||
hash: gn.hash,
|
||||
}
|
||||
|
||||
// DEPS update loop
|
||||
lockfile[attr_path].DEPS = await resolve_DEPS(depot_tools.out, version_chromium)
|
||||
lockfile[attr_path].DEPS = await resolve_DEPS(depot_tools.out, chromium_rev)
|
||||
for (const [path, value] of Object.entries(lockfile[attr_path].DEPS)) {
|
||||
delete value.fetcher
|
||||
delete value.postFetch
|
||||
@ -147,6 +149,14 @@ async function fetch_chromedriver_binaries(chromium_version) {
|
||||
}
|
||||
|
||||
|
||||
async function chromium_resolve_tag_to_rev(tag) {
|
||||
const url = `https://chromium.googlesource.com/chromium/src/+/refs/tags/${tag}?format=json`
|
||||
const response = await (await fetch(url)).text()
|
||||
const json = JSON.parse(response.replace(`)]}'\n`, ''))
|
||||
return json.commit
|
||||
}
|
||||
|
||||
|
||||
async function resolve_DEPS(depot_tools_checkout, chromium_rev) {
|
||||
const { stdout } = await $`./depot_tools.py ${depot_tools_checkout} ${chromium_rev}`
|
||||
const deps = JSON.parse(stdout)
|
||||
|
Loading…
Reference in New Issue
Block a user