On 5 Feb 2021, at 08:33, Allan Odgaard via TextMate <textmate@lists.macromates.com> wrote:

Ah… I did not explicitly specify minimum OS version at link time, only at compile time. I have pushed a new build that should fix this.

Great that you found the issue. Are you using the `-mmacosx-version-min` flag or the `MACOSX_DEPLOYMENT_TARGET` environment variable? The environment variable is read both by the compiler and linker.

Btw: What command/tool do you use to inspect this?

otool -l <binary/object file>

You’re looking for two load commands: LC_BUILD_VERSION and LC_VERSION_MIN_MACOSX. Only one will be present in any given binary. Which one, depends on the minimum deployment versions the binary was compiled for.

For universal binaries it will by default look at the binary matching the native target. You can use `-arch` flag to specify which architecture you want to look at.

Perhaps you could add a sanity check that verifies that the specified deployment version matches what’s actually in the binary.

Yes, I have had to do that in the past, but when you use an old version of Xcode, you cannot use new features, for example, you need a fairly recent version to build for M1 macs.

Yeah, exactly.

Technically yes, you can build for 10.4. I have however run into some practical problems. Most recently TextMate would link against a (system) library that did not exist on older versions of macOS. I think it was a bug in the SDK. I also recently had a problem with the preferences window (and the cross-fade when switching between tabs), when building on 10.15 and running on 10.14, it would look broken, but building on 10.14 worked fine.

Aha, even when building using the same SDK as on 10.14?

So some subtly changed AppKit behavior based on SDK version: In some cases this is expected, but generally behavior should remain the same on OS versions older than the SDK version, but it has not always been my experience.

I see, that’s unfortunate. I’m not as familiar with the Apple specific libraries as with the Posix libraries.

I wonder what would happen if the binary did not have any of these load commands or if the version of the SDK was changed in the load command after the binary was built.

-- 
/Jacob Carlborg