Created
September 30, 2026 20:26
-
-
Save dbernheisel/c8a5c1bb61a0db9643f9b9a695f3d50b to your computer and use it in GitHub Desktop.
Build Old Chromedriver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # usage: build.sh <version> <sha> | |
| set -euxo pipefail | |
| V=$1; SHA=$2 | |
| mkdir -p /work/$V && cd /work/$V | |
| cat > .gclient <<G | |
| solutions = [{"name": "src", "url": "https://chromium.googlesource.com/chromium/src.git", | |
| "managed": False, "deps_file": "DEPS", "custom_deps": {"src/third_party/devtools-node-modules": None, "src/chrome/browser/resources/media_router/extension/src": None}, "custom_vars": {"checkout_nacl": False}}] | |
| target_os = ["linux"] | |
| target_cpu = ["arm64"] | |
| G | |
| [ -d src/.git ] || git init src | |
| git -C src remote get-url origin >/dev/null 2>&1 || git -C src remote add origin https://chromium.googlesource.com/chromium/src.git | |
| git -C src cat-file -e $SHA^{commit} 2>/dev/null || git -C src fetch --depth 1 origin $SHA | |
| git -C src checkout -q $SHA | |
| for attempt in $(seq 1 40); do | |
| if gclient sync --nohooks --no-history --shallow -j8 2>&1 | tee /tmp/sync.log; then break; fi | |
| missing=$(grep -oE "git checkout --quiet [0-9a-f]{40}' returned non-zero exit status 128 in [^ ]+" /tmp/sync.log | sed -E "s/git checkout --quiet ([0-9a-f]{40})' .* in (.+)/\\2 \\1/" | sort -u) | |
| [ -n "$missing" ] || exit 1 | |
| echo "$missing" | while read dir sha; do git -C "$dir" fetch origin "$sha"; done | |
| done | |
| cd src | |
| python build/linux/sysroot_scripts/install-sysroot.py --arch=amd64 | |
| python build/linux/sysroot_scripts/install-sysroot.py --arch=arm64 | |
| python tools/clang/scripts/update.py | |
| python third_party/binutils/download.py | |
| python build/util/lastchange.py -o build/util/LASTCHANGE | |
| python build/util/lastchange.py -m GPU_LISTS_VERSION --revision-id-only --header gpu/config/gpu_lists_version.h | |
| python build/util/lastchange.py -m SKIA_COMMIT_HASH -s third_party/skia --header skia/ext/skia_commit_hash.h | |
| download_from_google_storage --no_resume --platform=linux* --no_auth --bucket chromium-gn -s buildtools/linux64/gn.sha1 | |
| gn gen out/arm64 --args='target_os="linux" target_cpu="arm64" is_debug=false is_component_build=false symbol_level=0 enable_nacl=false treat_warnings_as_errors=false use_gnome_keyring=false use_lld=true' | |
| ninja -C out/arm64 chromedriver | |
| file out/arm64/chromedriver | |
| mkdir -p /work/out && cp -f out/arm64/chromedriver /work/out/chromedriver-$V && cd /work/out && rm -f chromedriver && cp -f chromedriver-$V chromedriver && zip -j chromedriver-v$V-linux-arm64.zip chromedriver && rm -f chromedriver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu:18.04 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git curl ca-certificates python python-setuptools lsb-release pkg-config \ | |
| xz-utils bzip2 file build-essential zip unzip sudo locales libxml2 && rm -rf /var/lib/apt/lists/* | |
| RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /depot_tools && \ | |
| cd /depot_tools && git checkout $(git rev-list -n1 --before=2018-11-20 origin/main 2>/dev/null || git rev-list -n1 --before=2018-11-20 origin/master) | |
| ENV PATH=/depot_tools:$PATH DEPOT_TOOLS_UPDATE=0 VPYTHON_BYPASS="manually managed python not supported by chrome operations" | |
| WORKDIR /work |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment