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: support frequent minor releases of MacOS BigSur. #5016

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
27 changes: 9 additions & 18 deletions src/install/browserFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ function getDownloadUrl(browserName: BrowserName, revision: number, platform: Br
['mac10.13', '%s/chromium-browser-snapshots/Mac/%d/chrome-mac.zip'],
['mac10.14', '%s/chromium-browser-snapshots/Mac/%d/chrome-mac.zip'],
['mac10.15', '%s/chromium-browser-snapshots/Mac/%d/chrome-mac.zip'],
['mac11.0', '%s/chromium-browser-snapshots/Mac/%d/chrome-mac.zip'],
['mac11.1', '%s/chromium-browser-snapshots/Mac/%d/chrome-mac.zip'],
['mac11', '%s/chromium-browser-snapshots/Mac/%d/chrome-mac.zip'],
['win32', '%s/chromium-browser-snapshots/Win/%d/chrome-win.zip'],
['win64', '%s/chromium-browser-snapshots/Win_x64/%d/chrome-win.zip'],
]).get(platform) :
Expand All @@ -78,10 +77,8 @@ function getDownloadUrl(browserName: BrowserName, revision: number, platform: Br
['mac10.13', '%s/builds/chromium/%s/chromium-mac.zip'],
['mac10.14', '%s/builds/chromium/%s/chromium-mac.zip'],
['mac10.15', '%s/builds/chromium/%s/chromium-mac.zip'],
['mac11.0', '%s/builds/chromium/%s/chromium-mac.zip'],
['mac11.0-arm64', '%s/builds/chromium/%s/chromium-mac-arm64.zip'],
['mac11.1', '%s/builds/chromium/%s/chromium-mac.zip'],
['mac11.1-arm64', '%s/builds/chromium/%s/chromium-mac-arm64.zip'],
['mac11', '%s/builds/chromium/%s/chromium-mac.zip'],
['mac11-arm64', '%s/builds/chromium/%s/chromium-mac-arm64.zip'],
['win32', '%s/builds/chromium/%s/chromium-win32.zip'],
['win64', '%s/builds/chromium/%s/chromium-win64.zip'],
]).get(platform);
Expand All @@ -96,8 +93,7 @@ function getDownloadUrl(browserName: BrowserName, revision: number, platform: Br
['mac10.13', '%s/builds/firefox/%s/firefox-mac.zip'],
['mac10.14', '%s/builds/firefox/%s/firefox-mac.zip'],
['mac10.15', '%s/builds/firefox/%s/firefox-mac.zip'],
['mac11.0', '%s/builds/firefox/%s/firefox-mac.zip'],
['mac11.1', '%s/builds/firefox/%s/firefox-mac.zip'],
['mac11', '%s/builds/firefox/%s/firefox-mac.zip'],
['win32', '%s/builds/firefox/%s/firefox-win32.zip'],
['win64', '%s/builds/firefox/%s/firefox-win64.zip'],
]).get(platform) :
Expand All @@ -107,10 +103,8 @@ function getDownloadUrl(browserName: BrowserName, revision: number, platform: Br
['mac10.13', '%s/builds/firefox/%s/firefox-mac-10.14.zip'],
['mac10.14', '%s/builds/firefox/%s/firefox-mac-10.14.zip'],
['mac10.15', '%s/builds/firefox/%s/firefox-mac-10.14.zip'],
['mac11.0', '%s/builds/firefox/%s/firefox-mac-10.14.zip'],
['mac11.0-arm64', '%s/builds/firefox/%s/firefox-mac-10.14.zip'],
['mac11.1', '%s/builds/firefox/%s/firefox-mac-10.14.zip'],
['mac11.1-arm64', '%s/builds/firefox/%s/firefox-mac-10.14.zip'],
['mac11', '%s/builds/firefox/%s/firefox-mac-10.14.zip'],
Copy link
Contributor

Choose a reason for hiding this comment

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

This all looks like a mess...

['mac11-arm64', '%s/builds/firefox/%s/firefox-mac-10.14.zip'],
['win32', '%s/builds/firefox/%s/firefox-win32.zip'],
['win64', '%s/builds/firefox/%s/firefox-win64.zip'],
]).get(platform);
Expand All @@ -125,8 +119,7 @@ function getDownloadUrl(browserName: BrowserName, revision: number, platform: Br
['mac10.13', undefined],
['mac10.14', '%s/builds/webkit/%s/minibrowser-mac-10.14.zip'],
['mac10.15', '%s/builds/webkit/%s/minibrowser-mac-10.15.zip'],
['mac11.0', '%s/builds/webkit/%s/minibrowser-mac-10.15.zip'],
['mac11.1', '%s/builds/webkit/%s/minibrowser-mac-10.15.zip'],
['mac11', '%s/builds/webkit/%s/minibrowser-mac-10.15.zip'],
['win32', '%s/builds/webkit/%s/minibrowser-win64.zip'],
['win64', '%s/builds/webkit/%s/minibrowser-win64.zip'],
]).get(platform) :
Expand All @@ -136,10 +129,8 @@ function getDownloadUrl(browserName: BrowserName, revision: number, platform: Br
['mac10.13', undefined],
['mac10.14', '%s/builds/webkit/%s/webkit-mac-10.14.zip'],
['mac10.15', '%s/builds/webkit/%s/webkit-mac-10.15.zip'],
['mac11.0', '%s/builds/webkit/%s/webkit-mac-10.15.zip'],
['mac11.0-arm64', '%s/builds/webkit/%s/webkit-mac-11.0-arm64.zip'],
['mac11.1', '%s/builds/webkit/%s/webkit-mac-10.15.zip'],
['mac11.1-arm64', '%s/builds/webkit/%s/webkit-mac-11.0-arm64.zip'],
['mac11', '%s/builds/webkit/%s/webkit-mac-10.15.zip'],
['mac11-arm64', '%s/builds/webkit/%s/webkit-mac-11.0-arm64.zip'],
['win32', '%s/builds/webkit/%s/webkit-win64.zip'],
['win64', '%s/builds/webkit/%s/webkit-win64.zip'],
]).get(platform);
Expand Down
30 changes: 14 additions & 16 deletions src/utils/browserPaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { getUbuntuVersionSync } from './ubuntuVersion';
import { getFromENV } from './utils';

export type BrowserName = 'chromium'|'webkit'|'firefox';
export type BrowserPlatform = 'win32'|'win64'|'mac10.13'|'mac10.14'|'mac10.15'|'mac11.0'|'mac11.0-arm64'|'mac11.1'|'mac11.1-arm64'|'ubuntu18.04'|'ubuntu20.04';
export type BrowserPlatform = 'win32'|'win64'|'mac10.13'|'mac10.14'|'mac10.15'|'mac11'|'mac11-arm64'|'ubuntu18.04'|'ubuntu20.04';
export type BrowserDescriptor = {
name: BrowserName,
revision: string,
Expand All @@ -32,15 +32,19 @@ export type BrowserDescriptor = {
export const hostPlatform = ((): BrowserPlatform => {
const platform = os.platform();
if (platform === 'darwin') {
const macVersion = execSync('sw_vers -productVersion', {
const [major, minor] = execSync('sw_vers -productVersion', {
stdio: ['ignore', 'pipe', 'ignore']
}).toString('utf8').trim().split('.').slice(0, 2).join('.');
}).toString('utf8').trim().split('.').map(x => parseInt(x, 10));
let arm64 = false;
if (!macVersion.startsWith('10.')) {
// BigSur is the first version that might run on Apple Silicon.
if (major >= 11) {
arm64 = execSync('sysctl -in hw.optional.arm64', {
stdio: ['ignore', 'pipe', 'ignore']
}).toString().trim() === '1';
}
// We do not want to differentiate between minor big sur releases
// since they don't change core APIs so far.
const macVersion = major === 10 ? `${major}.${minor}` : `${major}`;
const archSuffix = arm64 ? '-arm64' : '';
return `mac${macVersion}${archSuffix}` as BrowserPlatform;
}
Expand Down Expand Up @@ -92,10 +96,8 @@ export function executablePath(browserPath: string, browser: BrowserDescriptor):
['mac10.13', ['chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium']],
['mac10.14', ['chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium']],
['mac10.15', ['chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium']],
['mac11.0', ['chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium']],
['mac11.0-arm64', ['chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium']],
['mac11.1', ['chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium']],
['mac11.1-arm64', ['chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium']],
['mac11', ['chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium']],
['mac11-arm64', ['chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium']],
['win32', ['chrome-win', 'chrome.exe']],
['win64', ['chrome-win', 'chrome.exe']],
]).get(hostPlatform);
Expand All @@ -108,10 +110,8 @@ export function executablePath(browserPath: string, browser: BrowserDescriptor):
['mac10.13', ['firefox', 'Nightly.app', 'Contents', 'MacOS', 'firefox']],
['mac10.14', ['firefox', 'Nightly.app', 'Contents', 'MacOS', 'firefox']],
['mac10.15', ['firefox', 'Nightly.app', 'Contents', 'MacOS', 'firefox']],
['mac11.0', ['firefox', 'Nightly.app', 'Contents', 'MacOS', 'firefox']],
['mac11.0-arm64', ['firefox', 'Nightly.app', 'Contents', 'MacOS', 'firefox']],
['mac11.1', ['firefox', 'Nightly.app', 'Contents', 'MacOS', 'firefox']],
['mac11.1-arm64', ['firefox', 'Nightly.app', 'Contents', 'MacOS', 'firefox']],
['mac11', ['firefox', 'Nightly.app', 'Contents', 'MacOS', 'firefox']],
['mac11-arm64', ['firefox', 'Nightly.app', 'Contents', 'MacOS', 'firefox']],
['win32', ['firefox', 'firefox.exe']],
['win64', ['firefox', 'firefox.exe']],
]).get(hostPlatform);
Expand All @@ -124,10 +124,8 @@ export function executablePath(browserPath: string, browser: BrowserDescriptor):
['mac10.13', undefined],
['mac10.14', ['pw_run.sh']],
['mac10.15', ['pw_run.sh']],
['mac11.0', ['pw_run.sh']],
['mac11.0-arm64', ['pw_run.sh']],
['mac11.1', ['pw_run.sh']],
['mac11.1-arm64', ['pw_run.sh']],
['mac11', ['pw_run.sh']],
['mac11-arm64', ['pw_run.sh']],
['win32', ['Playwright.exe']],
['win64', ['Playwright.exe']],
]).get(hostPlatform);
Expand Down