Skip to content

macOS binaries should probably have deliberate OS min versionΒ #84

@marktsuchida

Description

@marktsuchida

This is a non-urgent technicality.

On macOS, every binary has a minimum supported OS version in its metadata ("load commands"). This can be inspected using vtool -show path/to/binary (vtool is part of Xcode or the Command Line Tools). Note that the output format is different for x86_64 (LC_VERSION_MIN_MACOSX/version) vs arm64 (LC_BUILD_VERSION/minos).

Jaunch 1.0.3 release binaries have the following values, which are probably perfectly fine:

Architecture Binary Min OS version
x64 launcher 10.12
arm64 launcher 11.0
x64 jaunch 11.0
arm64 launcher 11.0

For the launcher (C), these are currently set by the -target compiler option.
The C compiler also can set this value via -mmacos-version-min=<value> or the environment variable MACOSX_DEPLOYMENT_TARGET (provided that the version number is removed from the -target option argument, as in -target arm64-apple-macos). The default is quite high: I get minos 15.0 using SDK 15.5 (Sequoia).

For Kotlin, presumably 11.0 is the compiler's default. According to my testing, MACOSX_DEPLOYMENT_TARGET is not honored. Claude thinks it can be set in the Gradle file (complicated) or in konan.properties (osVersionMin.macos_x64=11.0, osVersionMin.macos_arm64=11.0), but I could not get either to work immediately.

It is possible to determine the minimum supported deployment target when building with the current (or given) macOS SDK: plutil -extract SupportedTargets.macosx.MinimumDeploymentTarget raw "$(xcrun --show-sdk-path --sdk macosx)/SDKSettings.plist". But Kotlin may not use the same SDK version or otherwise might have a different minimum deployment target.

Potential actions:

  • It might be worth setting the launcher's min version to 11.0 also for x64, given that the configurator requires 11.0 anyway.
  • It will be good to ensure that the min version is not set too high in future releases.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationos:macos

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions