From 50b1205fb704f714201b7b3fe98bf1b076979671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeremy=20Lain=C3=A9?= Date: Fri, 11 Feb 2022 00:32:25 +0100 Subject: [PATCH] Try to build aarch64 wheels again --- .github/workflows/build.yml | 2 ++ scripts/build-openssl.py | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) 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)