Skip to content

Commit

Permalink
Revert " Fix mac os arch with platform.mac_ver() (#2454)"
Browse files Browse the repository at this point in the history
This reverts commit b5d9014.
  • Loading branch information
zanieb committed Mar 14, 2024
1 parent ad274ae commit 06ef9b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
1 change: 0 additions & 1 deletion crates/platform-tags/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ pub enum Arch {
Armv7L,
Powerpc64Le,
Powerpc64,
#[serde(alias = "i386")]
X86,
#[serde(alias = "amd64")]
X86_64,
Expand Down
23 changes: 7 additions & 16 deletions crates/uv-interpreter/python/get_interpreter_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
The script will exit with status 0 on known error that are turned into rust errors.
"""

import sys

import json
import os
import platform
import struct
import sys
import sysconfig


Expand Down Expand Up @@ -453,20 +451,13 @@ def get_operating_system_and_architecture():
"name": "windows",
}
elif operating_system == "macosx":
# Apparently, Mac OS is reporting i386 sometimes in sysconfig.get_platform even
# though that's not a thing anymore.
# https://github.com/astral-sh/uv/issues/2450
version, _, architecture = platform.mac_ver()

# https://github.com/pypa/packaging/blob/cc938f984bbbe43c5734b9656c9837ab3a28191f/src/packaging/tags.py#L356-L363
is_32bit = struct.calcsize("P") == 4
if is_32bit:
if architecture.startswith("ppc"):
architecture = "ppc"
# GitHub Actions python seems to be doing this.
if architecture == "universal2":
if platform.processor() == "arm":
architecture = "aarch64"
else:
architecture = "i386"

version = version.split(".")
architecture = platform.processor()
version = platform.mac_ver()[0].split(".")
operating_system = {
"name": "macos",
"major": int(version[0]),
Expand Down

0 comments on commit 06ef9b5

Please sign in to comment.