Skip to content

Commit

Permalink
darwintools: fix adhocsignature for universal2 machine (#2107)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelotduarte authored Oct 20, 2023
1 parent 435e401 commit 1515ce8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions cx_Freeze/darwintools.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ruff: noqa
from __future__ import annotations
import sysconfig

import os
import platform
import shutil
import stat
import subprocess
Expand Down Expand Up @@ -495,8 +495,9 @@ def changeLoadReference(


def applyAdHocSignature(fileName: str):
if platform.machine() != "arm64":
if sysconfig.get_platform().endswith("x86_64"):
return
# Apply for universal2 and arm64 machines
print("Applying AdHocSignature")
args = (
"codesign",
Expand Down
3 changes: 1 addition & 2 deletions cx_Freeze/freezer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from importlib import import_module
from importlib.util import MAGIC_NUMBER
from pathlib import Path
from sysconfig import get_config_var
from typing import Any
from zipfile import ZIP_DEFLATED, ZIP_STORED, PyZipFile, ZipInfo

Expand Down Expand Up @@ -457,7 +456,7 @@ def _validate_path(path: list[str | Path] | None = None) -> list[str]:
dynload = get_resource_file_path("bases", "lib-dynload", "")
if dynload and dynload.is_dir():
# add bases/lib-dynload to the finder path, if has modules
ext_suffix = get_config_var("EXT_SUFFIX")
ext_suffix = sysconfig.get_config_var("EXT_SUFFIX")
if len(list(dynload.glob(f"*{ext_suffix}"))) > 0:
index = 0
dest_shared = sysconfig.get_config_var("DESTSHARED")
Expand Down

0 comments on commit 1515ce8

Please sign in to comment.