[MacPorts] #69526: R @4.3.3+aqua-gcc12+builtin_lapack+cairo+gcc13+openmp+tcltk-x11: error: unknown type name 'CFAttributedStringRef' (was: R-4.3.3 +aqua-gcc12+builtin_lapack+cairo+gcc13+openmp+tcltk-x11 fails to build with the latest CLT on Sonoma 14.4 x86_64; builds on aarch64)

MacPorts noreply at macports.org
Tue Mar 19 05:15:11 UTC 2024


#69526: R @4.3.3+aqua-gcc12+builtin_lapack+cairo+gcc13+openmp+tcltk-x11: error:
unknown type name 'CFAttributedStringRef'
---------------------+---------------------------
  Reporter:  AP1010  |      Owner:  kjellpk
      Type:  defect  |     Status:  assigned
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:  2.9.1
Resolution:          |   Keywords:  sonoma x86_64
      Port:  R       |
---------------------+---------------------------
Changes (by ryandesign):

 * keywords:  Sonoma 14.4, CLT 15.3 => sonoma x86_64


Comment:

 Replying to [comment:10 AP1010]:
 > This has something to do with the CLT. I downgraded the CLT to15.1. R
 builds happily. Upgraded to the latest 15.3 - build fails.

 It certainly wouldn't be the first problem attributable to 15.3.

 The error in the log is:

 {{{
 /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h:138:5:
 error: unknown type name 'CFAttributedStringRef'; did you mean
 'CFMutableStringRef'?
     CFAttributedStringRef attrString ) CT_AVAILABLE(macos(10.5), ios(3.2),
 watchos(2.0), tvos(9.0));
     ^
 }}}

 According to Apple documentation
 [https://developer.apple.com/documentation/corefoundation/cfattributedstringref
 CFAttributedStringRef] was introduced in Mac OS X 10.4 and is not
 deprecated so it should still be there if the correct header is being
 included. Since it's CoreText that's trying to use this type, you'd think
 CoreText would include that header. As far as I can tell, it does.
 <CoreText/CTLine.h> includes <CoreFoundation/CoreFoundation.h>, which
 includes <CoreFoundation/CFAttributedString.h>*, which is where the
 `CFAttributedStringRef` `typedef` is.

 *This is not new in 15.3 but the inclusion of CFAttributedString.h is
 guarded:

 {{{#!c
 #if (TARGET_OS_OSX || TARGET_OS_IPHONE || TARGET_OS_WIN32 || 0)
 #include <CoreFoundation/CFAttributedString.h>
 #endif
 }}}

 I wonder if `TARGET_OS_OSX` is not getting set. They should be defined by
 <TargetConditionals.h> which <CoreFoundation/CoreFoundation.h> does
 include.

 <TargetConditionals.h> has changed significantly between the Xcode 15.1
 (macOS 14.2) version and the Xcode 15.3 (macOS 14.4) version. I imagine
 the intention was just to clean up the code and not change the behavior
 but maybe a mistake was made. I'll attach both versions if you want to
 examine the diff.

 I don't have a machine with Xcode 15.3 in front of me but you might try
 printing out whether `TARGET_OS_OSX` is defined and what value it is
 defined to in this R file to see if we're looking in the right area.

-- 
Ticket URL: <https://trac.macports.org/ticket/69526#comment:16>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list