Opened 2 years ago

Closed 2 years ago

#65632 closed defect (worksforme)

having xcrun call clang-14 doesn't work on macOS 10.7

Reported by: catap (Kirill A. Korinsky) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: cjones051073 (Chris Jones), kencu (Ken)
Port: clang-14 llvm-14

Description

I've installed clang-14 to macOS 10.7 as port install clang-14. An attempt to compile trivial program:

#include <iostream>
using namespace std;
int main() {
   cout << "Hello, World!" << endl;
   return 0;
}

fails as:

2022-08-07 23:27:22.779 xcodebuild[4172:807] [MT] DVTAssertions: ASSERTION FAILURE in /SourceCache/DVTFoundation/DVTFoundation-1195/Framework/Classes/FilePaths/DVTFilePath.m:364
Details:  fsrep is absolute (starts with /) ('/opt/local/libexec/llvm-14/bin/clang++') parentPath must be nil but it is not ('<DVTFilePath:0x401bb9e80:'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin'>')
Object:   <DVTFilePath>
Method:   +_filePathForParent:fileSystemRepresentation:length:allowCreation:
Thread:   <NSThread: 0x40010a220>{name = (null), num = 1}
Hints: None
Backtrace:
  0  0x000000010e6ca77f -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in DVTFoundation)
  1  0x000000010e6ca5d5 _DVTAssertionFailureHandler (in DVTFoundation)
  2  0x000000010e6500d7 +[DVTFilePath _filePathForParent:fileSystemRepresentation:length:allowCreation:] (in DVTFoundation)
  3  0x000000010e64fde1 +[DVTFilePath _filePathForParent:pathString:] (in DVTFoundation)
  4  0x000000010e68209e -[DVTSearchPath pathForFileWithRelativePathString:] (in DVTFoundation)
  5  0x000000010f5e4ce6 -[Xcode3SDK absolutePathToBinaryNamed:error:] (in DevToolsCore)
  6  0x000000010ed1cb07 -[Xcode3CommandLineBuildTool _printPathToBinaryAndExit] (in Xcode3Core)
  7  0x000000010ed1df9e -[Xcode3CommandLineBuildTool run] (in Xcode3Core)
  8  0x000000010e647db6 (in xcodebuild)
  9  0x000000010e647c2c (in xcodebuild)
 10  0x0000000000000005
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild fails with 6 - Device not configured

thus, an attempt to simple run clang++-mp-14 fails:

macos-lion:tmp catap$ clang++-mp-14
2022-08-07 23:29:23.656 xcodebuild[4188:807] [MT] DVTAssertions: ASSERTION FAILURE in /SourceCache/DVTFoundation/DVTFoundation-1195/Framework/Classes/FilePaths/DVTFilePath.m:364
Details:  fsrep is absolute (starts with /) ('/opt/local/libexec/llvm-14/bin/clang++') parentPath must be nil but it is not ('<DVTFilePath:0x400eb16a0:'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin'>')
Object:   <DVTFilePath>
Method:   +_filePathForParent:fileSystemRepresentation:length:allowCreation:
Thread:   <NSThread: 0x40010a220>{name = (null), num = 1}
Hints: None
Backtrace:
  0  0x0000000101a0777f -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in DVTFoundation)
  1  0x0000000101a075d5 _DVTAssertionFailureHandler (in DVTFoundation)
  2  0x000000010198d0d7 +[DVTFilePath _filePathForParent:fileSystemRepresentation:length:allowCreation:] (in DVTFoundation)
  3  0x000000010198cde1 +[DVTFilePath _filePathForParent:pathString:] (in DVTFoundation)
  4  0x00000001019bf09e -[DVTSearchPath pathForFileWithRelativePathString:] (in DVTFoundation)
  5  0x0000000102926ce6 -[Xcode3SDK absolutePathToBinaryNamed:error:] (in DevToolsCore)
  6  0x0000000102057b07 -[Xcode3CommandLineBuildTool _printPathToBinaryAndExit] (in Xcode3Core)
  7  0x0000000102058f9e -[Xcode3CommandLineBuildTool run] (in Xcode3Core)
  8  0x000000010197fdb6 (in xcodebuild)
  9  0x000000010197fc2c (in xcodebuild)
 10  0x0000000000000005
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild fails with 6 - Device not configured
macos-lion:tmp catap$ 

Change History (23)

comment:1 Changed 2 years ago by kencu (Ken)

I guess you have it installed with "+Assertions" enabled? I'm not sure anyone else has ever done that on 10.7.

The assertion is straightforward enough -- but not a big issue I think if it works still. You have a fully represented path, but you are running it from a non-nil parent path. What happens if you install the normal, non-assertions version?

https://packages.macports.org/clang-14/clang-14-14.0.6_0+analyzer+defaultlibcxx+libstdcxx.darwin_11.x86_64.tbz2

by the way, don't bother reporting this upstream. They don't support 10.7 any longer, and MacPorts has 100 patches + legacysupport to make newer clangs work on 10.7 anyway -- they will laugh you out of town :>

comment:2 Changed 2 years ago by kencu (Ken)

or is this xcodebuild that is asserting?

comment:3 Changed 2 years ago by catap (Kirill A. Korinsky)

Ken, I've installed the normal version from packages.macports.org :(

All another clang are working fine on this machine.

comment:4 Changed 2 years ago by kencu (Ken)

OK. Well, I've never seen this, but I wonder if it is coming from this:

https://github.com/macports/macports-ports/blob/master/lang/llvm-14/files/llvm-bin

what happens if you just do this?

/usr/bin/xcrun /opt/local/libexec/llvm-14/bin/clang++ hello.cxx

comment:5 Changed 2 years ago by catap (Kirill A. Korinsky)

comment:6 Changed 2 years ago by kencu (Ken)

and this works?

/usr/bin/xcrun /opt/local/libexec/llvm-13/bin/clang++ hello.cxx

if so, truly weird….

comment:7 Changed 2 years ago by catap (Kirill A. Korinsky)

Yes, any clang works except of 14 :(

comment:8 Changed 2 years ago by kencu (Ken)

but this exact statement works?

/usr/bin/xcrun /opt/local/libexec/llvm-13/bin/clang++ hello.cxx

and this one does not???

/usr/bin/xcrun /opt/local/libexec/llvm-14/bin/clang++ hello.cxx

comment:9 Changed 2 years ago by catap (Kirill A. Korinsky)

Ken, yes, you're correct.

comment:10 Changed 2 years ago by kencu (Ken)

if that is the case, there is no fix. the number 14 is just evil :)

comment:11 Changed 2 years ago by catap (Kirill A. Korinsky)

I've surprised that not 13!

comment:12 Changed 2 years ago by kencu (Ken)

i presume if you leave xcrun out, it works fine??

comment:13 Changed 2 years ago by catap (Kirill A. Korinsky)

yes, and clang-11 / clang-13 works fine...

comment:14 Changed 2 years ago by kencu (Ken)

/opt/local/libexec/llvm-14/bin/clang++ hello.cxx

works great?

comment:15 Changed 2 years ago by kencu (Ken)

Summary: clang-14 doesn't work on macOS 10.7having xcrun call clang-14 doesn't work on macOS 10.7

comment:16 Changed 2 years ago by catap (Kirill A. Korinsky)

Summary: having xcrun call clang-14 doesn't work on macOS 10.7clang-14 doesn't work on macOS 10.7

Nope, it hasn't work with the same reason.

comment:17 Changed 2 years ago by catap (Kirill A. Korinsky)

Summary: clang-14 doesn't work on macOS 10.7having xcrun call clang-14 doesn't work on macOS 10.7

comment:18 in reply to:  16 Changed 2 years ago by kencu (Ken)

Replying to catap:

Nope, it hasn't work with the same reason.

please show me exact error calling clang-14 directly

comment:19 Changed 2 years ago by kencu (Ken)

/opt/local/libexec/llvm-14/bin/clang++ hello.cxx

comment:20 Changed 2 years ago by catap (Kirill A. Korinsky)

Hey, I was complely wrong. You was right and issue is running llvm-14/clang-14 via /usr/bin/xcrun; without it it works fine. With it => doesn't work.

comment:21 Changed 2 years ago by catap (Kirill A. Korinsky)

Ken, can I ask you to close the issue because removing Xcode, reboot machine and installing 4.6.3 solves the issue.

comment:22 Changed 2 years ago by kencu (Ken)

oh, hey, that is great.

as much as we try to smooth them out, there remain some interesting wrinkles in how these (especially older) systems work !

comment:23 Changed 2 years ago by kencu (Ken)

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.