diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 126a599..4bfa5ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,8 @@ jobs: arch: arm64 - os: macos-latest arch: x86_64 + - os: ubuntu-latest + arch: aarch64 - os: ubuntu-latest arch: i686 - os: ubuntu-latest diff --git a/scripts/build-openssl.py b/scripts/build-openssl.py index 444ea31..19068c0 100644 --- a/scripts/build-openssl.py +++ b/scripts/build-openssl.py @@ -14,9 +14,10 @@ patch_dir = os.path.abspath("patches") source_dir = os.path.abspath("source") -for d in [build_dir, dest_dir]: - if os.path.exists(d): - shutil.rmtree(d) +# parallelize build, except when running in qemu +make_args = [] +if platform.machine() != "aarch64": + make_args.append("-j") def get_platform(): @@ -59,9 +60,8 @@ def extract(package, url, *, strip_components=1): def run(cmd, *, env=None): sys.stdout.write(f"- Running: {cmd}\n") - subprocess.run( - cmd, check=True, env=env, stderr=sys.stderr.buffer, stdout=sys.stdout.buffer - ) + sys.stdout.flush() + subprocess.run(cmd, check=True, env=env) configure_args = [] @@ -73,9 +73,13 @@ def run(cmd, *, env=None): configure_args = ["darwin64-arm64"] output_tarball = os.path.join(output_dir, f"openssl-{get_platform()}.tar.gz") +for d in [build_dir, dest_dir]: + if os.path.exists(d): + shutil.rmtree(d) for d in [build_dir, output_dir, source_dir]: if not os.path.exists(d): os.mkdir(d) + if not os.path.exists(output_tarball): os.chdir(build_dir)