Tcl Source Code

View Ticket
Login
Ticket UUID: 503c4c6f56b5a45d7e3acc5bef792943bbee8d58
Title: Compiled code fails to run on older macos
Type: Bug Created on: 2023-05-24 16:21:40
Submitter: jal_frezie Assigned to: jan.nijtmans
Subsystem: 52. Portability Support Severity: Severe
Priority: 5 Medium Last modified: 2023-06-13 09:17:04
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2023-06-13 09:17:04
Version: 8.6.13 MacOS
Description:
If you build TclTk from source on MacOS 12.3 and specify -mmacosx-version-min=10.13" it should produce a framework that can run on older MacOS versions. But trying it on 10.15 I got

dyld: Library not loaded: /System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers

It seems that a workaround might be to hide that framework when compiling TclTk so the build process falls back on something else...
User Comments:
jal_frezie added on 2023-05-24 16:48:44:
The problem of course being that system integrity protection does not allow you to hide a system framework even as root

chrstphrchvz added on 2023-06-07 02:32:37:

Ideally this ticket belongs in the Tk issue tracker, since usage of UniformTypeIdentifiers is entirely in Tk Aqua, not Tcl.

The changes relevant to this issue were part of the monterey_deprecations branch. If I understand https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html#//apple_ref/doc/uid/20002378-107026 correctly, then the problem is because even though any usage of UniformTypeIdentifiers functions was put in if (@available(macOS 11.0, *)) {…} blocks, in https://core.tcl-lang.org/tk/info/9b50c66a1c94 the framework itself was not weakly linked to. The attached patch may fix the issue. “Hiding” the framework during build should not be desirable nor necessary.


fvogel added on 2023-06-08 17:22:29:

Committed by Jan here [4094492b].


jan.nijtmans added on 2023-06-13 09:17:04:

Now committed. If more is needed to make this fully functional, please re-open this ticket (or - better - create a new Tk ticket). I think it should work as-is now.


Attachments: