Proper value for os.arch on Apple Silicon

Joshua Root jmr at macports.org
Tue Jun 23 09:04:36 UTC 2020


On 2020-6-23 17:14 , Ryan Schmidt wrote:
> On Jun 23, 2020, at 01:44, Joshua Root wrote:
> 
>> On 2020-6-23 16:36 , Joshua Root wrote:
>>> The value of os.arch is intended to match `uname -p`.
>>
>> And assuming macOS 11 hasn't changed uname in this respect, it looks
>> like it should be "arm". [1]
>>
>> - Josh
>>
>> [1]
>> <https://opensource.apple.com/source/shell_cmds/shell_cmds-207.40.1/uname/uname.c.auto.html>
> 
> 
> Ok great. Then we just need to figure out what $tcl_platform(machine) is on ARM.

Hopefully someone with access to a dev kit will provide that. It doesn't
seem to be possible to glean it from the currently public sources.

Gory details: Tcl sets that variable to the machine value returned by
uname(3), which gets it from sysctl(3) called with
name={CTL_HW,HW_MACHINE}. That seems to ultimately get it from some
Platform Expert code that either is not open source or I failed to find
(things got a little interesting deep in IOKit).

- Josh


More information about the macports-dev mailing list