Proper value for os.arch on Apple Silicon

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Proper value for os.arch on Apple Silicon

ryandesign2
Administrator
Now that Apple has announced that Macs will have ARM processors [1], what is the proper value for ${os.arch} on such systems?

MacPorts base currently knows two values of ${os.arch}: "powerpc" is used on all 32-bit and 64-bit PowerPC systems while "i386" is used on all 32-bit and 64-bit Intel systems.

I'm not necessarily asking what value MacPorts currently prints for this variable on an Apple Silicon Developer Transition Kit machine, but rather what value it should print. We may need add code to MacPorts base to make this happen, just as there is already code to produce the two existing values:


    # set up platform info variables
    set os_arch $tcl_platform(machine)
    if {$os_arch eq "Power Macintosh"} {set os_arch "powerpc"}
    if {$os_arch eq "i586" || $os_arch eq "i686" || $os_arch eq "x86_64"} {set os_arch "i386"}


Should it be "arm"?

Whatever we choose will impact how ports are written so we need to make a choice and then stick to it.

I also need to know so that I can modify mprsyncup to start generating a portindex on our server for such systems.


[1] https://www.apple.com/newsroom/2020/06/apple-announces-mac-transition-to-apple-silicon/

Reply | Threaded
Open this post in threaded view
|

Re: Proper value for os.arch on Apple Silicon

vincent habchi-2
Ryan,

> Now that Apple has announced that Macs will have ARM processors [1], what is the proper value for ${os.arch} on such systems?

It should be noted that, apparently (I didn’t follow the keynote), the Apple staff never referred to the new arch as “ARM”, but used “Apple silicon”.

So why not simply adopt the name “apple”?

Vincent

Reply | Threaded
Open this post in threaded view
|

Re: Proper value for os.arch on Apple Silicon

Joshua Root-8
In reply to this post by ryandesign2
On 2020-6-23 14:50 , Ryan Schmidt wrote:
> Now that Apple has announced that Macs will have ARM processors [1], what is the proper value for ${os.arch} on such systems?
>
> MacPorts base currently knows two values of ${os.arch}: "powerpc" is used on all 32-bit and 64-bit PowerPC systems while "i386" is used on all 32-bit and 64-bit Intel systems.
>
> I'm not necessarily asking what value MacPorts currently prints for this variable on an Apple Silicon Developer Transition Kit machine, but rather what value it should print.
The value of os.arch is intended to match `uname -p`.

- Josh
Reply | Threaded
Open this post in threaded view
|

Re: Proper value for os.arch on Apple Silicon

Joshua Root-8
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>
Reply | Threaded
Open this post in threaded view
|

Re: Proper value for os.arch on Apple Silicon

ryandesign2
Administrator
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.

Reply | Threaded
Open this post in threaded view
|

Re: Proper value for os.arch on Apple Silicon

Joshua Root-8
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
Reply | Threaded
Open this post in threaded view
|

Re: Proper value for os.arch on Apple Silicon

Karan Sheth via macports-dev
In reply to this post by ryandesign2
It is arm64.

> On Jun 22, 2020, at 9:50 PM, Ryan Schmidt <[hidden email]> wrote:
>
> Now that Apple has announced that Macs will have ARM processors [1], what is the proper value for ${os.arch} on such systems?
>
> MacPorts base currently knows two values of ${os.arch}: "powerpc" is used on all 32-bit and 64-bit PowerPC systems while "i386" is used on all 32-bit and 64-bit Intel systems.
>
> I'm not necessarily asking what value MacPorts currently prints for this variable on an Apple Silicon Developer Transition Kit machine, but rather what value it should print. We may need add code to MacPorts base to make this happen, just as there is already code to produce the two existing values:
>
>
>    # set up platform info variables
>    set os_arch $tcl_platform(machine)
>    if {$os_arch eq "Power Macintosh"} {set os_arch "powerpc"}
>    if {$os_arch eq "i586" || $os_arch eq "i686" || $os_arch eq "x86_64"} {set os_arch "i386"}
>
>
> Should it be "arm"?
>
> Whatever we choose will impact how ports are written so we need to make a choice and then stick to it.
>
> I also need to know so that I can modify mprsyncup to start generating a portindex on our server for such systems.
>
>
> [1] https://www.apple.com/newsroom/2020/06/apple-announces-mac-transition-to-apple-silicon/
>

Reply | Threaded
Open this post in threaded view
|

Re: Proper value for os.arch on Apple Silicon

Joshua Root-8
Do you mean arm64 is what `uname -p` prints, or what
$tcl_platform(machine) contains, or both?

On 2020-6-24 08:48 , Jeremy Sequoia via macports-dev wrote:

> It is arm64.
>
>> On Jun 22, 2020, at 9:50 PM, Ryan Schmidt <[hidden email]> wrote:
>>
>> Now that Apple has announced that Macs will have ARM processors [1], what is the proper value for ${os.arch} on such systems?
>>
>> MacPorts base currently knows two values of ${os.arch}: "powerpc" is used on all 32-bit and 64-bit PowerPC systems while "i386" is used on all 32-bit and 64-bit Intel systems.
>>
>> I'm not necessarily asking what value MacPorts currently prints for this variable on an Apple Silicon Developer Transition Kit machine, but rather what value it should print. We may need add code to MacPorts base to make this happen, just as there is already code to produce the two existing values:
>>
>>
>>    # set up platform info variables
>>    set os_arch $tcl_platform(machine)
>>    if {$os_arch eq "Power Macintosh"} {set os_arch "powerpc"}
>>    if {$os_arch eq "i586" || $os_arch eq "i686" || $os_arch eq "x86_64"} {set os_arch "i386"}
>>
>>
>> Should it be "arm"?
>>
>> Whatever we choose will impact how ports are written so we need to make a choice and then stick to it.
>>
>> I also need to know so that I can modify mprsyncup to start generating a portindex on our server for such systems.
>>
>>
>> [1] https://www.apple.com/newsroom/2020/06/apple-announces-mac-transition-to-apple-silicon/
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Proper value for os.arch on Apple Silicon

Karan Sheth via macports-dev
os.arch is arm64

(16:39:32 Tue Jun 23 2020 jeremy@airbear ttys000 arm64)
[617] ~ $ uname -m
arm64

(16:39:33 Tue Jun 23 2020 jeremy@airbear ttys000 arm64)
[618] ~ $ uname -p
arm

> On Jun 23, 2020, at 4:33 PM, Joshua Root <[hidden email]> wrote:
>
> Do you mean arm64 is what `uname -p` prints, or what
> $tcl_platform(machine) contains, or both?
>
> On 2020-6-24 08:48 , Jeremy Sequoia via macports-dev wrote:
>> It is arm64.
>>
>>> On Jun 22, 2020, at 9:50 PM, Ryan Schmidt <[hidden email]> wrote:
>>>
>>> Now that Apple has announced that Macs will have ARM processors [1], what is the proper value for ${os.arch} on such systems?
>>>
>>> MacPorts base currently knows two values of ${os.arch}: "powerpc" is used on all 32-bit and 64-bit PowerPC systems while "i386" is used on all 32-bit and 64-bit Intel systems.
>>>
>>> I'm not necessarily asking what value MacPorts currently prints for this variable on an Apple Silicon Developer Transition Kit machine, but rather what value it should print. We may need add code to MacPorts base to make this happen, just as there is already code to produce the two existing values:
>>>
>>>
>>>   # set up platform info variables
>>>   set os_arch $tcl_platform(machine)
>>>   if {$os_arch eq "Power Macintosh"} {set os_arch "powerpc"}
>>>   if {$os_arch eq "i586" || $os_arch eq "i686" || $os_arch eq "x86_64"} {set os_arch "i386"}
>>>
>>>
>>> Should it be "arm"?
>>>
>>> Whatever we choose will impact how ports are written so we need to make a choice and then stick to it.
>>>
>>> I also need to know so that I can modify mprsyncup to start generating a portindex on our server for such systems.
>>>
>>>
>>> [1] https://www.apple.com/newsroom/2020/06/apple-announces-mac-transition-to-apple-silicon/
>>>
>>
>