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: stop bundling FFMPEG with Chromium #3806

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
23 changes: 1 addition & 22 deletions browser_patches/chromium/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@ rm -rf output
mkdir -p output
cd output

BUILD_NUMBER=$(head -1 ../BUILD_NUMBER)
# Support BUILD_NUMBER in the form of <CRREV>.<GENERATION>
# This will allow us to bump generation to produce new builds.
CRREV="${BUILD_NUMBER%.*}"
CRREV=$(head -1 ../BUILD_NUMBER)

CHROMIUM_URL=""
CHROMIUM_FOLDER_NAME=""
CHROMIUM_FILES_TO_REMOVE=()

FFMPEG_VERSION="4.3.1"
FFMPEG_URL=""
FFMPEG_BIN_PATH=""

PLATFORM="$1"
if [[ -z "${PLATFORM}" ]]; then
CURRENT_HOST_OS="$(uname)"
Expand All @@ -41,24 +34,16 @@ if [[ "${PLATFORM}" == "--win32" ]]; then
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Win/${CRREV}/chrome-win.zip"
CHROMIUM_FOLDER_NAME="chrome-win"
CHROMIUM_FILES_TO_REMOVE+=("chrome-win/interactive_ui_tests.exe")
FFMPEG_URL="https://playwright2.blob.core.windows.net/builds/ffmpeg/${FFMPEG_VERSION}/ffmpeg-win32.zip"
FFMPEG_BIN_PATH="ffmpeg.exe"
elif [[ "${PLATFORM}" == "--win64" ]]; then
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/${CRREV}/chrome-win.zip"
CHROMIUM_FOLDER_NAME="chrome-win"
CHROMIUM_FILES_TO_REMOVE+=("chrome-win/interactive_ui_tests.exe")
FFMPEG_URL="https://playwright2.blob.core.windows.net/builds/ffmpeg/${FFMPEG_VERSION}/ffmpeg-win64.zip"
FFMPEG_BIN_PATH="ffmpeg.exe"
elif [[ "${PLATFORM}" == "--mac" ]]; then
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Mac/${CRREV}/chrome-mac.zip"
CHROMIUM_FOLDER_NAME="chrome-mac"
FFMPEG_URL="https://playwright2.blob.core.windows.net/builds/ffmpeg/${FFMPEG_VERSION}/ffmpeg-mac.zip"
FFMPEG_BIN_PATH="ffmpeg"
elif [[ "${PLATFORM}" == "--linux" ]]; then
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/${CRREV}/chrome-linux.zip"
CHROMIUM_FOLDER_NAME="chrome-linux"
# Even though we could bundle ffmpeg on Linux (2.5MB zipped), we
# prefer rely on system-installed ffmpeg instead.
else
echo "ERROR: unknown platform to build: $1"
exit 1
Expand All @@ -72,10 +57,4 @@ for file in ${CHROMIUM_FILES_TO_REMOVE[@]}; do
rm -f "${file}"
done

if [[ -n "${FFMPEG_URL}" ]]; then
curl --output ffmpeg-upstream.zip "${FFMPEG_URL}"
unzip ffmpeg-upstream.zip
cp "$FFMPEG_BIN_PATH" "${CHROMIUM_FOLDER_NAME}"
fi

zip --symlinks -r build.zip "${CHROMIUM_FOLDER_NAME}"
2 changes: 1 addition & 1 deletion src/install/browserFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function getDownloadUrl(browserName: BrowserName, revision: number, platform: Br
}

function revisionURL(browser: BrowserDescriptor, platform = browserPaths.hostPlatform): string {
const revision = parseFloat(browser.revision);
const revision = parseInt(browser.revision, 10);
const serverHost = getDownloadHost(browser.name, revision);
const urlTemplate = getDownloadUrl(browser.name, revision, platform);
assert(urlTemplate, `ERROR: Playwright does not support ${browser.name} on ${platform}`);
Expand Down
2 changes: 1 addition & 1 deletion src/install/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function validateCache(packagePath: string, browsersPath: string, linksDir
const browsersToDownload = await readBrowsersToDownload(linkTarget);
for (const browser of browsersToDownload) {
const usedBrowserPath = browserPaths.browserDirectory(browsersPath, browser);
const browserRevision = parseFloat(browser.revision);
const browserRevision = parseInt(browser.revision, 10);
// Old browser installations don't have marker file.
const shouldHaveMarkerFile = (browser.name === 'chromium' && browserRevision >= 786218) ||
(browser.name === 'firefox' && browserRevision >= 1128) ||
Expand Down