https://kotlinlang.org logo
Title
s

Sebastian Kürten

04/08/2023, 10:30 AM
I'm finally working on macOS support for pinpit and got it working to build ZIP distributables for my example apps using my snapshot builds. One thing I'm wondering about is the restriction to have the major version for macOS app versions be > 1.0.0. I found the PR that introduced this (https://github.com/JetBrains/compose-multiplatform/pull/405) but haven't found any reference to why this specific restriction has been introduced. I haven't found any docs on Apple's side that confirms this is necessary either. What I found though is these docs about CFBundleVersion which even mention 0.0.0 as an example. I also built a test app using a version number such as 0.1.0 and had no problem extracting it from Test.zip to Test.app using Finder and installing it to my Applications folder. Is it an app store restriction maybe?
a

Alexander Maryanovsky

04/08/2023, 12:13 PM
I think it was a limitation on an earlier version of Mac OS X. It may have been removed.
s

Sebastian Kürten

04/09/2023, 8:37 AM
I just checked,
jpackage
also enforces the major version to be non-zero. It's in https://github.com/openjdk/jdk/blob/master/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/CFBundleVersion.java#L49 currently and I can trace it back to the first version of jpackage where it got introduced in Dec 5, 2019: https://github.com/openjdk/jdk/commit/264573c9ce730ed421725b8986db4e3eb5124c47#diff-5d2a110b25ab685e0230c5e57e00[…]86ad8f71978a5d96870922feec7afR143 I don't see a reference though. Ironically, the first version of https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleversion stored in the Web Archive is from Dec 29, 2019 and that old version also doesn't mention any limitation.
Oh, wow, that check was actually introduced into the old
javafxpackager
back in 2014 from where it was copied to `jpackage`: https://github.com/openjdk/jfx/commit/f69af4823512ba400d99fedf29d91a755263dab9#diff-4056aa3d2d740d12c8d354eb556c[…]30aedb7785c7743ed6215a08d8bc0R342