diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b73ab3c..c782610 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ permissions: contents: write env: - version: m132-a00c390e98-1 + version: m138-9e6b5bff162-1 jobs: macos: @@ -174,7 +174,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} windows: - runs-on: windows-2019 + runs-on: windows-2022 strategy: matrix: build_type: [Debug, Release] diff --git a/README.md b/README.md index a16c7d8..c69679d 100644 --- a/README.md +++ b/README.md @@ -15,18 +15,20 @@ Prebuilt binaries can be found [in releases](https://github.com/JetBrains/skia-p ## Building locally +Note: Better check build.yml for the detailed command for your machine + ```sh -python3 script/checkout.py --version m126-6fd3120c1b +python3 script/checkout.py --version m138-9e6b5bff162 python3 script/build.py -python3 script/archive.py --version m126-6fd3120c1b +python3 script/archive.py --version m138-9e6b5bff162 ``` To build a debug build: ```sh -python3 script/checkout.py --version m126-6fd3120c1b +python3 script/checkout.py --version m138-9e6b5bff162 python3 script/build.py --build-type Debug -python3 script/archive.py --version m126-6fd3120c1b --build-type Debug +python3 script/archive.py --version m138-9e6b5bff162 --build-type Debug ``` ### Windows-specific diff --git a/script/checkout.py b/script/checkout.py index 6566313..c10ae7b 100755 --- a/script/checkout.py +++ b/script/checkout.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 -import common, os, re, subprocess, sys +import common, os, re, subprocess, sys, time def checkout_skia(commit): # Clone Skia @@ -21,6 +21,30 @@ def checkout_skia(commit): print("> Checking out", commit) subprocess.check_call(["git", "-c", "advice.detachedHead=false", "checkout", commit]) +def git_sync_with_retries(max_retries=3, backoff_seconds=5): + attempt = 0 + while True: + try: + print("> Running tools/git-sync-deps (attempt {}/{})".format(attempt+1, max_retries+1)) + # On Windows we need to disable HTTPS verify + if common.host() == 'windows': + env = os.environ.copy() + env['PYTHONHTTPSVERIFY'] = '0' + subprocess.check_call([sys.executable, "tools/git-sync-deps"], env=env) + else: + subprocess.check_call([sys.executable, "tools/git-sync-deps"]) + print("Success") + break + except subprocess.CalledProcessError as e: + attempt += 1 + if attempt > max_retries: + print("All {} retries failed. Giving up.".format(max_retries)) + raise + else: + wait = backoff_seconds * attempt + print(f"Failed (exit {e.returncode}), retrying in {wait}s…") + time.sleep(wait) + def main(): os.chdir(os.path.join(os.path.dirname(__file__), os.pardir)) @@ -40,12 +64,8 @@ def main(): # git deps print("> Running tools/git-sync-deps") - if 'windows' == common.host(): - env = os.environ.copy() - env['PYTHONHTTPSVERIFY']='0' - subprocess.check_call(["python3", "tools/git-sync-deps"], env=env) - else: - subprocess.check_call(["python3", "tools/git-sync-deps"]) + # Trying to avoid 429 HTTP Error from Google repos + git_sync_with_retries() # fetch ninja print("> Fetching ninja")