Skip to content

Commit

Permalink
bootloader & building: macOS: always use Darwin-64bit directory
Browse files Browse the repository at this point in the history
On macOS, avoid appending -arm suffix to bootloader directory if
we are on arm64 (M1) platform. So instead of Darwin-64bit-arm,
we always use Darwin-64bit. Applies both to bootloader's wscript
as well as frozen application assembly pipeline (or rather,
PyInstaller.PLATFORM).

This is because we now build universal2 bootloaders, so there is
no need for two arch-specific locations. Furthermore, using -arm
suffix for bootloader directory would prevent M1 users from using
pre-compiled bootloaders from git tree (unless we saved one copy
in each location) and in binary wheels (unless we split wheels
into x86_64 and arm64 one).

Overall, considering the current design of x86_64/arm64 support,
it makes more sense to unify the bootloader directory for macOS.
  • Loading branch information
rokm committed Jun 2, 2021
1 parent 87713eb commit 660a2e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions PyInstaller/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@


PLATFORM = compat.system + '-' + compat.architecture
# Include machine name in path to bootloader for some machines.
# e.g. 'arm'
if compat.machine:
# Include machine name in path to bootloader for some machines (e.g., 'arm').
# Explicitly avoid doing this on macOS, where we keep universal2 bootloaders
# in Darwin-64bit folder regardless of whether we are on x86_64 or arm64.
if compat.machine and not compat.is_darwin:
PLATFORM += '-' + compat.machine
2 changes: 1 addition & 1 deletion bootloader/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ def build(ctx):
ctx.env.PYI_SYSTEM + "-" + ctx.env.PYI_ARCH)
install_path = os.path.normpath(install_path)

if machine():
if machine() and ctx.env.DEST_OS != 'darwin':
install_path += '-' + machine()

if not ctx.env.LIB_Z:
Expand Down

0 comments on commit 660a2e3

Please sign in to comment.