From ae460f01fcfdf582ba8ed1a7f2b4a966343e0d5f Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Wed, 17 Mar 2021 09:34:09 -0700 Subject: [PATCH] devops: start downloading webkit fork on Mac 10.14 (#5837) References #5833 --- browsers.json | 5 ++++- src/utils/registry.ts | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/browsers.json b/browsers.json index 4ce76261c9eb2..0e3d278e4033c 100644 --- a/browsers.json +++ b/browsers.json @@ -14,7 +14,10 @@ { "name": "webkit", "revision": "1446", - "download": true + "download": true, + "revisionOverrides": { + "mac10.14": "1443" + } }, { "name": "ffmpeg", diff --git a/src/utils/registry.ts b/src/utils/registry.ts index 437ca44a867c8..8590784a8a580 100644 --- a/src/utils/registry.ts +++ b/src/utils/registry.ts @@ -31,6 +31,7 @@ type BrowserDescriptor = { name: BrowserName, revision: string, download: boolean, + browserDirectory: string, }; const EXECUTABLE_PATHS = { @@ -107,7 +108,7 @@ const DOWNLOAD_URLS = { 'ubuntu18.04': '%s/builds/webkit/%s/webkit-ubuntu-18.04.zip', 'ubuntu20.04': '%s/builds/webkit/%s/webkit-ubuntu-20.04.zip', 'mac10.13': undefined, - 'mac10.14': '%s/builds/webkit/%s/webkit-mac-10.14.zip', + 'mac10.14': '%s/builds/deprecated-webkit-mac-10.14/%s/deprecated-webkit-mac-10.14.zip', 'mac10.15': '%s/builds/webkit/%s/webkit-mac-10.15.zip', 'mac11': '%s/builds/webkit/%s/webkit-mac-10.15.zip', 'mac11-arm64': '%s/builds/webkit/%s/webkit-mac-11.0-arm64.zip', @@ -203,13 +204,24 @@ export class Registry { constructor(packagePath: string) { const browsersJSON = JSON.parse(fs.readFileSync(path.join(packagePath, 'browsers.json'), 'utf8')); - this._descriptors = browsersJSON['browsers']; + this._descriptors = browsersJSON['browsers'].map((obj: any) => { + const name = obj.name; + const revisionOverride = (obj.revisionOverrides || {})[hostPlatform]; + const revision = revisionOverride || obj.revision; + const browserDirectory = revisionOverride ? `${name}-${hostPlatform}-special-${revision}` : `${name}-${revision}`; + return { + name, + revision, + download: obj.download, + browserDirectory, + }; + }); } browserDirectory(browserName: BrowserName): string { const browser = this._descriptors.find(browser => browser.name === browserName); assert(browser, `ERROR: Playwright does not support ${browserName}`); - return path.join(registryDirectory, `${browser.name}-${browser.revision}`); + return path.join(registryDirectory, browser.browserDirectory); } revision(browserName: BrowserName): number {