From 732852abb8f06c422348376be0c91bc9d9d12322 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 15 Oct 2021 22:46:53 +1000 Subject: [PATCH 1/6] switch to node 16.x for macOS aarch64 support --- defs.bzl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/defs.bzl b/defs.bzl index f191d5e99..5823be4bf 100644 --- a/defs.bzl +++ b/defs.bzl @@ -49,7 +49,10 @@ def setup_deps(): python_runtime = "@python//:python", ) - node_repositories(package_json = ["@ankidesktop//:package.json"]) + node_repositories( + package_json = ["@ankidesktop//:package.json"], + node_version = "16.10.0", + ) yarn_install( name = "npm", From 6f4b76ef0139fe0fb05f8b6c291bd8a22a0b52f5 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 15 Oct 2021 23:20:43 +1000 Subject: [PATCH 2/6] use x86 binaries for clang format/protobuf on Mac --- platforms/BUILD.bazel | 8 ++++++++ proto/clang_format.bzl | 1 + proto/protobuf.bzl | 1 + 3 files changed, 10 insertions(+) diff --git a/platforms/BUILD.bazel b/platforms/BUILD.bazel index 57e1d7557..044afa5c0 100644 --- a/platforms/BUILD.bazel +++ b/platforms/BUILD.bazel @@ -16,6 +16,14 @@ config_setting( ], ) +config_setting( + name = "macos_arm64", + constraint_values = [ + "@platforms//os:macos", + "@platforms//cpu:aarch64", + ], +) + config_setting( name = "linux_x86_64", constraint_values = [ diff --git a/proto/clang_format.bzl b/proto/clang_format.bzl index 164fcb8b1..a7a9ade37 100644 --- a/proto/clang_format.bzl +++ b/proto/clang_format.bzl @@ -15,6 +15,7 @@ alias( name = "clang_format", actual = select({ "@ankidesktop//platforms:windows_x86_64": "@clang_format_windows_x86_64//:clang-format.exe", + "@ankidesktop//platforms:macos_arm64": "@clang_format_macos_x86_64//:clang-format", "@ankidesktop//platforms:macos_x86_64": "@clang_format_macos_x86_64//:clang-format", "@ankidesktop//platforms:linux_x86_64": "@clang_format_linux_x86_64//:clang-format", }), diff --git a/proto/protobuf.bzl b/proto/protobuf.bzl index 2e42c5511..b0391cd0d 100644 --- a/proto/protobuf.bzl +++ b/proto/protobuf.bzl @@ -13,6 +13,7 @@ alias( name = "protoc", actual = select({ "@ankidesktop//platforms:windows_x86_64": "@protoc_bin_windows//:bin/protoc.exe", + "@ankidesktop//platforms:macos_arm64": "@protoc_bin_macos//:bin/protoc", "@ankidesktop//platforms:macos_x86_64": "@protoc_bin_macos//:bin/protoc", "@ankidesktop//platforms:linux_x86_64": "@protoc_bin_linux_x86_64//:bin/protoc", "@ankidesktop//platforms:linux_arm64": "@protoc_bin_linux_arm64//:bin/protoc" From 7797f885531cf5ab2c70f3d11c19265e465d2114 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 15 Oct 2021 23:28:10 +1000 Subject: [PATCH 3/6] add aarch64-apple to Rust targets --- Cargo.toml | 1 + cargo/BUILD.reqwest.native.bazel | 1 + cargo/remote/BUILD.ahash-0.7.4.bazel | 2 ++ cargo/remote/BUILD.atty-0.2.14.bazel | 1 + cargo/remote/BUILD.coarsetime-0.1.19.bazel | 1 + cargo/remote/BUILD.dirs-sys-next-0.1.2.bazel | 1 + cargo/remote/BUILD.getrandom-0.1.16.bazel | 2 ++ cargo/remote/BUILD.getrandom-0.2.3.bazel | 1 + cargo/remote/BUILD.hyper-0.14.13.bazel | 1 + cargo/remote/BUILD.mio-0.7.13.bazel | 1 + cargo/remote/BUILD.native-tls-0.2.8.bazel | 2 ++ cargo/remote/BUILD.num-format-0.4.0.bazel | 1 + cargo/remote/BUILD.parking_lot_core-0.8.5.bazel | 2 ++ cargo/remote/BUILD.rand-0.7.3.bazel | 1 + cargo/remote/BUILD.rand-0.8.4.bazel | 1 + cargo/remote/BUILD.reqwest-0.11.3.bazel | 1 + cargo/remote/BUILD.ring-0.16.20.bazel | 2 ++ cargo/remote/BUILD.rustls-native-certs-0.5.0.bazel | 1 + cargo/remote/BUILD.socket2-0.4.2.bazel | 1 + cargo/remote/BUILD.tempfile-3.2.0.bazel | 1 + cargo/remote/BUILD.tokio-1.12.0.bazel | 2 ++ cargo/remote/BUILD.tokio-native-tls-0.3.0.bazel | 1 + cargo/remote/BUILD.utime-0.3.1.bazel | 1 + pylib/rsbridge/BUILD.bazel | 1 + 24 files changed, 30 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 72c942848..953c9bd5c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,6 +25,7 @@ targets = [ "x86_64-apple-ios", "x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu", + "aarch64-apple-darwin", "aarch64-apple-ios", "aarch64-unknown-linux-gnu", ] diff --git a/cargo/BUILD.reqwest.native.bazel b/cargo/BUILD.reqwest.native.bazel index 44adf7219..7e4630b41 100644 --- a/cargo/BUILD.reqwest.native.bazel +++ b/cargo/BUILD.reqwest.native.bazel @@ -88,6 +88,7 @@ rust_library( ] + selects.with_or({ # cfg(not(target_arch = "wasm32")) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.ahash-0.7.4.bazel b/cargo/remote/BUILD.ahash-0.7.4.bazel index 78126fe7a..7e829634a 100644 --- a/cargo/remote/BUILD.ahash-0.7.4.bazel +++ b/cargo/remote/BUILD.ahash-0.7.4.bazel @@ -60,6 +60,7 @@ cargo_build_script( ] + selects.with_or({ # cfg(any(target_os = "linux", target_os = "android", target_os = "windows", target_os = "macos", target_os = "ios", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd", target_os = "dragonfly", target_os = "solaris", target_os = "illumos", target_os = "fuchsia", target_os = "redox", target_os = "cloudabi", target_os = "haiku", target_os = "vxworks", target_os = "emscripten", target_os = "wasi")) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", @@ -101,6 +102,7 @@ rust_library( ] + selects.with_or({ # cfg(any(target_os = "linux", target_os = "android", target_os = "windows", target_os = "macos", target_os = "ios", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd", target_os = "dragonfly", target_os = "solaris", target_os = "illumos", target_os = "fuchsia", target_os = "redox", target_os = "cloudabi", target_os = "haiku", target_os = "vxworks", target_os = "emscripten", target_os = "wasi")) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.atty-0.2.14.bazel b/cargo/remote/BUILD.atty-0.2.14.bazel index 1fc983494..81afc0d6a 100644 --- a/cargo/remote/BUILD.atty-0.2.14.bazel +++ b/cargo/remote/BUILD.atty-0.2.14.bazel @@ -56,6 +56,7 @@ rust_library( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.coarsetime-0.1.19.bazel b/cargo/remote/BUILD.coarsetime-0.1.19.bazel index 9e09e37d6..de8204749 100644 --- a/cargo/remote/BUILD.coarsetime-0.1.19.bazel +++ b/cargo/remote/BUILD.coarsetime-0.1.19.bazel @@ -55,6 +55,7 @@ rust_library( ] + selects.with_or({ # cfg(not(target_os = "wasi")) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.dirs-sys-next-0.1.2.bazel b/cargo/remote/BUILD.dirs-sys-next-0.1.2.bazel index 1f71a0256..fb0945f5b 100644 --- a/cargo/remote/BUILD.dirs-sys-next-0.1.2.bazel +++ b/cargo/remote/BUILD.dirs-sys-next-0.1.2.bazel @@ -54,6 +54,7 @@ rust_library( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.getrandom-0.1.16.bazel b/cargo/remote/BUILD.getrandom-0.1.16.bazel index 8e1b3d7a3..e8516e82c 100644 --- a/cargo/remote/BUILD.getrandom-0.1.16.bazel +++ b/cargo/remote/BUILD.getrandom-0.1.16.bazel @@ -60,6 +60,7 @@ cargo_build_script( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", @@ -100,6 +101,7 @@ rust_library( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.getrandom-0.2.3.bazel b/cargo/remote/BUILD.getrandom-0.2.3.bazel index 66e6eb178..520f8af59 100644 --- a/cargo/remote/BUILD.getrandom-0.2.3.bazel +++ b/cargo/remote/BUILD.getrandom-0.2.3.bazel @@ -58,6 +58,7 @@ rust_library( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.hyper-0.14.13.bazel b/cargo/remote/BUILD.hyper-0.14.13.bazel index a79bc2b0a..c4b72a490 100644 --- a/cargo/remote/BUILD.hyper-0.14.13.bazel +++ b/cargo/remote/BUILD.hyper-0.14.13.bazel @@ -122,6 +122,7 @@ rust_library( ] + selects.with_or({ # cfg(any(target_os = "linux", target_os = "macos")) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", diff --git a/cargo/remote/BUILD.mio-0.7.13.bazel b/cargo/remote/BUILD.mio-0.7.13.bazel index 11556abbe..09b2e9937 100644 --- a/cargo/remote/BUILD.mio-0.7.13.bazel +++ b/cargo/remote/BUILD.mio-0.7.13.bazel @@ -67,6 +67,7 @@ rust_library( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.native-tls-0.2.8.bazel b/cargo/remote/BUILD.native-tls-0.2.8.bazel index 2b7105dec..21dc9cc2b 100644 --- a/cargo/remote/BUILD.native-tls-0.2.8.bazel +++ b/cargo/remote/BUILD.native-tls-0.2.8.bazel @@ -59,6 +59,7 @@ cargo_build_script( ] + selects.with_or({ # cfg(any(target_os = "macos", target_os = "ios")) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:x86_64-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-ios", @@ -114,6 +115,7 @@ rust_library( ] + selects.with_or({ # cfg(any(target_os = "macos", target_os = "ios")) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:x86_64-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-ios", diff --git a/cargo/remote/BUILD.num-format-0.4.0.bazel b/cargo/remote/BUILD.num-format-0.4.0.bazel index 45483a0fc..5017c04e9 100644 --- a/cargo/remote/BUILD.num-format-0.4.0.bazel +++ b/cargo/remote/BUILD.num-format-0.4.0.bazel @@ -58,6 +58,7 @@ rust_library( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.parking_lot_core-0.8.5.bazel b/cargo/remote/BUILD.parking_lot_core-0.8.5.bazel index 397f20aff..4afd86a6a 100644 --- a/cargo/remote/BUILD.parking_lot_core-0.8.5.bazel +++ b/cargo/remote/BUILD.parking_lot_core-0.8.5.bazel @@ -59,6 +59,7 @@ cargo_build_script( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", @@ -105,6 +106,7 @@ rust_library( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.rand-0.7.3.bazel b/cargo/remote/BUILD.rand-0.7.3.bazel index 4fd937fa3..3488447a2 100644 --- a/cargo/remote/BUILD.rand-0.7.3.bazel +++ b/cargo/remote/BUILD.rand-0.7.3.bazel @@ -79,6 +79,7 @@ rust_library( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.rand-0.8.4.bazel b/cargo/remote/BUILD.rand-0.8.4.bazel index 038786cb0..c114eb96a 100644 --- a/cargo/remote/BUILD.rand-0.8.4.bazel +++ b/cargo/remote/BUILD.rand-0.8.4.bazel @@ -65,6 +65,7 @@ rust_library( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.reqwest-0.11.3.bazel b/cargo/remote/BUILD.reqwest-0.11.3.bazel index cf9390dd8..570395de6 100644 --- a/cargo/remote/BUILD.reqwest-0.11.3.bazel +++ b/cargo/remote/BUILD.reqwest-0.11.3.bazel @@ -98,6 +98,7 @@ rust_library( ] + selects.with_or({ # cfg(not(target_arch = "wasm32")) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.ring-0.16.20.bazel b/cargo/remote/BUILD.ring-0.16.20.bazel index 9739a6806..34e72b119 100644 --- a/cargo/remote/BUILD.ring-0.16.20.bazel +++ b/cargo/remote/BUILD.ring-0.16.20.bazel @@ -84,6 +84,7 @@ cargo_build_script( }) + selects.with_or({ # cfg(any(unix, windows)) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", @@ -156,6 +157,7 @@ rust_library( }) + selects.with_or({ # cfg(any(unix, windows)) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.rustls-native-certs-0.5.0.bazel b/cargo/remote/BUILD.rustls-native-certs-0.5.0.bazel index 24e94c417..7778db4b6 100644 --- a/cargo/remote/BUILD.rustls-native-certs-0.5.0.bazel +++ b/cargo/remote/BUILD.rustls-native-certs-0.5.0.bazel @@ -70,6 +70,7 @@ rust_library( }) + selects.with_or({ # cfg(target_os = "macos") ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-darwin", ): [ "@raze__security_framework__2_4_2//:security_framework", diff --git a/cargo/remote/BUILD.socket2-0.4.2.bazel b/cargo/remote/BUILD.socket2-0.4.2.bazel index 2f9e05336..57d1c2025 100644 --- a/cargo/remote/BUILD.socket2-0.4.2.bazel +++ b/cargo/remote/BUILD.socket2-0.4.2.bazel @@ -54,6 +54,7 @@ rust_library( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.tempfile-3.2.0.bazel b/cargo/remote/BUILD.tempfile-3.2.0.bazel index c9b97850f..332d3b879 100644 --- a/cargo/remote/BUILD.tempfile-3.2.0.bazel +++ b/cargo/remote/BUILD.tempfile-3.2.0.bazel @@ -57,6 +57,7 @@ rust_library( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.tokio-1.12.0.bazel b/cargo/remote/BUILD.tokio-1.12.0.bazel index 5fb933b39..df07b1090 100644 --- a/cargo/remote/BUILD.tokio-1.12.0.bazel +++ b/cargo/remote/BUILD.tokio-1.12.0.bazel @@ -76,6 +76,7 @@ cargo_build_script( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", @@ -143,6 +144,7 @@ rust_library( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/cargo/remote/BUILD.tokio-native-tls-0.3.0.bazel b/cargo/remote/BUILD.tokio-native-tls-0.3.0.bazel index 1984b91ac..d11597fca 100644 --- a/cargo/remote/BUILD.tokio-native-tls-0.3.0.bazel +++ b/cargo/remote/BUILD.tokio-native-tls-0.3.0.bazel @@ -68,6 +68,7 @@ rust_library( }) + selects.with_or({ # cfg(any(target_os = "macos", target_os = "ios")) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:x86_64-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-ios", diff --git a/cargo/remote/BUILD.utime-0.3.1.bazel b/cargo/remote/BUILD.utime-0.3.1.bazel index 0b75bc3bd..7d844b9eb 100644 --- a/cargo/remote/BUILD.utime-0.3.1.bazel +++ b/cargo/remote/BUILD.utime-0.3.1.bazel @@ -54,6 +54,7 @@ rust_library( ] + selects.with_or({ # cfg(unix) ( + "@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", diff --git a/pylib/rsbridge/BUILD.bazel b/pylib/rsbridge/BUILD.bazel index b3579abae..a1c1019c0 100644 --- a/pylib/rsbridge/BUILD.bazel +++ b/pylib/rsbridge/BUILD.bazel @@ -21,6 +21,7 @@ rust_library( rustc_flags = selects.with_or({ ( "@rules_rust//rust/platform:x86_64-apple-darwin", + "@rules_rust//rust/platform:aarch64-apple-darwin", ): [ "-Clink-arg=-undefined", "-Clink-arg=dynamic_lookup", From 3d1c2cb8413f48104349cde3c4aa34f7db46c3b3 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 16 Oct 2021 09:58:31 +1000 Subject: [PATCH 4/6] roll back regex due to unsigned wheel --- pip/requirements.in | 4 ++++ pip/requirements.txt | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pip/requirements.in b/pip/requirements.in index 5483149eb..d364223ab 100644 --- a/pip/requirements.in +++ b/pip/requirements.in @@ -30,6 +30,10 @@ types-protobuf types-requests types-waitress +# transitive dependency of black; pinned due to broken wheel +# https://bitbucket.org/mrabarnett/mrab-regex/issues/399/missing-wheel-for-macosx-and-the-new-m1 +regex==2021.9.30 + # windows only psutil; sys.platform == "win32" pywin32; sys.platform == "win32" diff --git a/pip/requirements.txt b/pip/requirements.txt index b50f128de..44f65b4c1 100644 --- a/pip/requirements.txt +++ b/pip/requirements.txt @@ -113,8 +113,10 @@ pytoml==0.1.21 # via compare-locales pywin32==302 ; sys_platform == "win32" # via -r requirements.in -regex==2021.10.8 - # via black +regex==2021.9.30 + # via + # -r requirements.in + # black requests==2.26.0 # via -r requirements.in send2trash==1.8.0 From e577bd12b85876a9a34c5e0ab8d6c8c56a789d2d Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 16 Oct 2021 13:19:37 +1000 Subject: [PATCH 5/6] work around pyqt6.2.0's incorrect architecture label --- pip/pyqt6/install_pyqt6.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pip/pyqt6/install_pyqt6.py b/pip/pyqt6/install_pyqt6.py index 343bbc63c..4b9761eb2 100644 --- a/pip/pyqt6/install_pyqt6.py +++ b/pip/pyqt6/install_pyqt6.py @@ -8,6 +8,7 @@ import re import shutil import subprocess import sys +import platform from pip._internal.commands import create_command @@ -104,6 +105,14 @@ def main(): # install package in subfolder folder = os.path.join(base, "temp") pip_args = [] + if sys.platform.startswith("darwin") and platform.machine() == "arm64": + if name in ("pyqt6-qt6", "pyqt6-webengine-qt6"): + # pyqt messed up the architecture tags + pip_args.extend( + [ + "--platform=macosx_10_14_arm64", + "--only-binary=:all:", + ]) install_package(with_version, folder, pip_args) # merge into parent merge_files(base, folder) From d39e7be4510767e47ce66bdaa1cb74bb686eedf1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 16 Oct 2021 16:39:36 +1000 Subject: [PATCH 6/6] fix qtwebengineprocess failing to load on darwin-aarch64 --- pip/pyqt6/install_pyqt6.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pip/pyqt6/install_pyqt6.py b/pip/pyqt6/install_pyqt6.py index 4b9761eb2..de7a841e4 100644 --- a/pip/pyqt6/install_pyqt6.py +++ b/pip/pyqt6/install_pyqt6.py @@ -72,6 +72,10 @@ def merge_files(root, source): else: shutil.copy2(source_path, target_path) +def fix_webengine_codesigning(base: str): + "Fix a codesigning issue in the 6.2.0 release." + path = os.path.join(base, "PyQt6/Qt6/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess") + subprocess.run(["codesign", "-s", "-", path], check=True) def main(): base = sys.argv[1] @@ -101,11 +105,13 @@ def main(): ("pyqt6-sip", "pyqt6_sip==13.1.0"), ] + arm_darwin = sys.platform.startswith("darwin") and platform.machine() == "arm64" + for (name, with_version) in packages: # install package in subfolder folder = os.path.join(base, "temp") pip_args = [] - if sys.platform.startswith("darwin") and platform.machine() == "arm64": + if arm_darwin: if name in ("pyqt6-qt6", "pyqt6-webengine-qt6"): # pyqt messed up the architecture tags pip_args.extend( @@ -121,6 +127,9 @@ def main(): with open(os.path.join(base, "__init__.py"), "w") as file: file.write("__path__ = __import__('pkgutil').extend_path(__path__, __name__)") + if arm_darwin: + fix_webengine_codesigning(base) + # add missing py.typed file with open(os.path.join(base, "py.typed"), "w") as file: pass