From 22f54c2c01562b4d5563a920b51f0aebb6a6e125 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 21 Oct 2022 21:13:02 +1000 Subject: [PATCH] Protobuf now ships with a macOS arm64 wheel --- qt/bundle/build.py | 14 ++------------ repos.bzl | 10 ---------- tools/bundle | 2 -- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/qt/bundle/build.py b/qt/bundle/build.py index 72627ef97..686ce6671 100644 --- a/qt/bundle/build.py +++ b/qt/bundle/build.py @@ -35,7 +35,6 @@ cargo_target = output_root / f"target-{platform.machine()}" artifacts = output_root / "artifacts" pyo3_config = output_root / "pyo3-build-config-file.txt" pyoxidizer_folder = bazel_external / "pyoxidizer" -arm64_protobuf_wheel = bazel_external / "protobuf_wheel_mac_arm64" pyoxidizer_binary = cargo_target / "release" / with_exe_extension("pyoxidizer") for path in dist_folder.glob("*.zst"): @@ -64,7 +63,7 @@ elif sys.platform.startswith("darwin"): else: pyqt5_folder_name = "pyqt514" os.environ["TARGET"] = "x86_64-apple-darwin" - os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.13" + os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.14" else: is_lin = True if platform.machine() == "x86_64": @@ -133,17 +132,8 @@ def install_wheels_into_venv(): buf = f.read() with open(constraints, "w") as f: extracted = re.findall("^(\S+==\S+) ", buf, flags=re.M) - extracted = [ - line for line in extracted if not arm64_mac or "protobuf" not in line - ] + extracted = [line for line in extracted if "protobuf" not in line] f.write("\n".join(extracted)) - # pypi protobuf lacks C extension on darwin-arm64, so we have to use a version - # we built ourselves - if arm64_mac: - wheels = glob.glob(str(arm64_protobuf_wheel / "*.whl")) - subprocess.run( - [pip, "install", "--upgrade", "-c", constraints, *wheels], check=True - ) # install wheels and upgrade any deps wheels = glob.glob(str(workspace / ".bazel" / "out" / "dist" / "*.whl")) subprocess.run( diff --git a/repos.bzl b/repos.bzl index 7a784196a..0b45a64bc 100644 --- a/repos.bzl +++ b/repos.bzl @@ -194,16 +194,6 @@ exports_files(["l10n.toml"]) sha256 = "0815a601baba05e03bc36b568cdc2332b1cf4aa17125fc33c69de125f8dd687f", ) - maybe( - http_archive, - name = "protobuf_wheel_mac_arm64", - build_file_content = " ", - urls = [ - "https://github.com/ankitects/anki-bundle-extras/releases/download/anki-2022-02-09/protobuf-wheel-mac-arm64.tar", - ], - sha256 = "401d1cd6d949af463b3945f0d5dc887185b27fa5478cb6847bf94f680ea797b4", - ) - maybe( http_archive, name = "audio_mac_amd64", diff --git a/tools/bundle b/tools/bundle index 54f372103..ecbb169f8 100755 --- a/tools/bundle +++ b/tools/bundle @@ -27,8 +27,6 @@ if [[ "$OSTYPE" == "darwin"* ]]; then else bazel query @audio_mac_arm64//:* > /dev/null bazel query @pyqt6.4_mac_bundle_arm64//:* > /dev/null - bazel query @protobuf_wheel_mac_arm64//:* > /dev/null - fi else bazel query @pyqt515//:* > /dev/null