Skip to content
Tcl Source Code View Ticket
Login

View Ticket

[platform] OS identifier changed from 'macosx-x86_64' to 'macos-x86_64' in Tcl/Tk 9.0.3

Open15181c460701df7e1d9d5cd93fc10c1aafc85d21Created 210 days agoUpdated 210 days ago
Descriptionmarkdown2026-05-07 09:52:05

After upgrading to Tcl/Tk 9.0.3, I noticed a change in the value returned by the platform::generic command on macOS.

Previous behavior (Tcl/Tk 9.0.1):
% package require platform
% platform::generic
=> macosx-x86_64

Current behavior (Tcl/Tk 9.0.3):
% package require platform
% platform::generic
=> macos-x86_64

The 'x' has been dropped from 'macosx', changing it to 'macos'.

This is a breaking change for any code that relies on string matching against the platform identifier (e.g., switch statements, package lookup paths, or conditional compilation logic based on the OS name).

Could you please clarify:

  1. Was this change intentional? If so, what motivated it?
  2. Is there a migration guide or compatibility shim available for code that relied on the old identifier?
  3. Going forward, should users expect this kind of identifier change to happen across minor or patch versions? Is there a stability guarantee for values returned by platform::generic and platform::identify?

Thank you for your time.

oehharplain2026-05-07 10:10:35
Il looks like a typo with fatal consequences...
jan.nijtmanswiki2026-05-07 10:40:35

It was done on purpose in [this] commit, because Apple rebranded MacOS X to MacOS starting with Darwin 16. See https://en.wikipedia.org/wiki/Darwin_(operating_system). Because of this change, the minor version of "platform" was updated to 1.1.

Because there was another branding change later (MacOS version > 10) and because of backward compatibility, MacOS (X) 10.x is still named "macosx" while MacOS > 10 will be named "macos".

My suggestion would be to adapt the regexp, making the "x" option. I don't think Apple will do a rebrand again.

Sorry for the inconvenience, but it was not a typo :-(

anonymousmarkdown2026-05-07 10:57:01

ok, thanks for clarifying that, I’ll update my package accordingly.
This isn't related to Tcl, but in my Homebrew installation, some Tcl packages are affected,
here is the list:

  • critcl
  • tcllib2.0/nettool/nettool.tcl
  • tcllib2.0/practcl/practcl.tcl
apnadkarniplain2026-05-07 11:40:32
Too late now, but for future reference I don't think the platform::generic value should change just because of a marketing rebrand, particularly the "generic" value. It should reflect the expected system API. It doesn't (and didn't) change for Windows 2000 -> Windows XP->Windows Vista->Windows 7 etc
Log in (anonymous is fine) to add a comment.