Skip to content
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

devops: start downloading webkit fork on Mac 10.14 #5837

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
{
"name": "webkit",
"revision": "1446",
"download": true
"download": true,
"revisionOverrides": {
"mac10.14": "1443"
}
},
{
"name": "ffmpeg",
Expand Down
18 changes: 15 additions & 3 deletions src/utils/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type BrowserDescriptor = {
name: BrowserName,
revision: string,
download: boolean,
browserDirectory: string,
};

const EXECUTABLE_PATHS = {
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need 'special' in the name, maybe drop it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to make sure it stands out. Otherwise, the name webkit-mac10.14-1234 is not eye-catching in any way, given that I'm on mac10.14

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 {
Expand Down