Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:
contents: write

env:
version: m132-a00c390e98-1
version: m138-9e6b5bff162-1

jobs:
macos:
Expand Down Expand Up @@ -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]
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 27 additions & 7 deletions script/checkout.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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))

Expand All @@ -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")
Expand Down