[MacPorts] #44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop.
#44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. --------------------------+----------------------------- Reporter: ryandesign@… | Owner: matt.cottrell@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Keywords: | Port: arb --------------------------+----------------------------- arb 6.0 failed to build on the Snow Leopard (10.6) buildslave (using Xcode's gcc 4.2): {{{ ---> Building arb DEBUG: Executing org.macports.build (arb) DEBUG: Environment: ARBHOME='/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378' CC_PRINT_OPTIONS='YES' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/.CC_PRINT_OPTIONS' CPATH='/opt/local/include' LIBRARY_PATH='/opt/local/lib' MACOSX_DEPLOYMENT_TARGET='10.6' PATH='/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378/bin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' PREFIX='/opt/local' DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378" && /usr/bin/make -j8 -w all CXX=/usr/bin/g++-4.2 CC=/usr/bin/gcc-4.2' DEBUG: Executing command line: cd "/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378" && /usr/bin/make -j8 -w all CXX=/usr/bin/g++-4.2 CC=/usr/bin/gcc-4.2 Problems detecting compiler type: dumpedVersion='4.2.1 ' detailedVersion='i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ' make: Entering directory `/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378' Makefile:116: *** failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. make: Leaving directory `/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378' Command failed: cd "/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378" && /usr/bin/make -j8 -w all CXX=/usr/bin/g++-4.2 CC=/usr/bin/gcc-4.2 Exit code: 2 Error: org.macports.build for port arb returned: command execution failed DEBUG: Error code: CHILDSTATUS 83776 2 DEBUG: Backtrace: command execution failed while executing "system -nice 0 $fullcmdstring" ("eval" body line 1) invoked from within "eval system $notty $nice \$fullcmdstring" invoked from within "command_exec build" (procedure "portbuild::build_main" line 8) invoked from within "portbuild::build_main org.macports.build" ("eval" body line 1) invoked from within "eval $procedure $targetname" Warning: targets not executed for arb: org.macports.activate org.macports.build org.macports.destroot org.macports.install Please see the log file for port arb for details: /opt/local/var/macports/logs/_opt_mports_dports_science_arb/arb/main.log To report a bug, follow the instructions in the guide: http://guide.macports.org/#project.tickets Error: Processing of port arb failed }}} And on the Mountain Lion (10.8) buildbot (using Xcode's clang): {{{ ---> Building arb DEBUG: Executing org.macports.build (arb) DEBUG: Environment: ARBHOME='/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378' CC_PRINT_OPTIONS='YES' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/.CC_PRINT_OPTIONS' CPATH='/opt/local/include' LIBRARY_PATH='/opt/local/lib' MACOSX_DEPLOYMENT_TARGET='10.8' PATH='/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378/bin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' PREFIX='/opt/local' DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378" && /usr/bin/make -j8 -w all CXX=/usr/bin/clang++ CC=/usr/bin/clang' DEBUG: Executing command line: cd "/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378" && /usr/bin/make -j8 -w all CXX=/usr/bin/clang++ CC=/usr/bin/clang Problems detecting compiler type: dumpedVersion='4.2.1 ' detailedVersion='Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn) Target: x86_64-apple-darwin12.5.0 Thread model: posix ' make: Entering directory `/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378' Makefile:116: *** failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. make: Leaving directory `/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378' Command failed: cd "/opt/local/var/macports/build/_opt_mports_dports_science_arb/arb/work/arbsrc_12378" && /usr/bin/make -j8 -w all CXX=/usr/bin/clang++ CC=/usr/bin/clang Exit code: 2 Error: org.macports.build for port arb returned: command execution failed DEBUG: Error code: CHILDSTATUS 27300 2 DEBUG: Backtrace: command execution failed while executing "system -nice 0 $fullcmdstring" ("eval" body line 1) invoked from within "eval system $notty $nice \$fullcmdstring" invoked from within "command_exec build" (procedure "portbuild::build_main" line 8) invoked from within "portbuild::build_main org.macports.build" ("eval" body line 1) invoked from within "eval $procedure $targetname" Warning: targets not executed for arb: org.macports.activate org.macports.build org.macports.destroot org.macports.install Please see the log file for port arb for details: /opt/local/var/macports/logs/_opt_mports_dports_science_arb/arb/main.log To report a bug, follow the instructions in the guide: http://guide.macports.org/#project.tickets Error: Processing of port arb failed }}} It succeeded on the Mavericks (10.9) buildslave (using Xcode clang). -- Ticket URL: <https://trac.macports.org/ticket/44367> MacPorts <http://www.macports.org/> Ports system for OS X
#44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. ---------------------------+----------------------------- Reporter: ryandesign@… | Owner: matt.cottrell@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: arb | ---------------------------+----------------------------- Comment (by matt.cottrell@…): Strange, arb 6 builds for me on Mountain Lion (10.8.4). -- Ticket URL: <https://trac.macports.org/ticket/44367#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. ---------------------------+----------------------------- Reporter: ryandesign@… | Owner: matt.cottrell@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: arb | ---------------------------+----------------------------- Comment (by ryandesign@…): What version of Xcode and clang do you have on your Mountain Lion machine? The buildbot is using "`Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)`" which according to XcodeVersionInfo is from Xcode 4.5.1 or 4.5.2. -- Ticket URL: <https://trac.macports.org/ticket/44367#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. ---------------------------+----------------------------- Reporter: ryandesign@… | Owner: matt.cottrell@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: arb | ---------------------------+----------------------------- Comment (by ryandesign@…): The problem seems to be this line of SOURCE_TOOLS/arb_compiler_version.pl: {{{ if ($detailedVersion =~ /apple.*llvm.*clang/oi) { $detectedCompiler = 'clang'; } }}} It assumes `clang --version` will contain output matching `/apple.*llvm.*clang/oi` but it was only in Xcode 4.6 that Apple changed the output from "`Apple clang`" to "`Apple LLVM`" so the above line will fail on earlier versions of clang from Xcode versions 3.2.3 through 4.5.x inclusive. This entire method of attempting to detect clang is really bad, though. A better way would be to just check the return value of: {{{ $CC -dM -E -x c /dev/null | grep -q __clang__ }}} `0` means it's clang, `1` means it isn't. -- Ticket URL: <https://trac.macports.org/ticket/44367#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. ---------------------------+----------------------------- Reporter: ryandesign@… | Owner: matt.cottrell@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: arb | ---------------------------+----------------------------- Comment (by matt.cottrell@…): Replying to [comment:2 ryandesign@…]:
What version of Xcode and clang do you have on your Mountain Lion machine? The buildbot is using "`Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)`" which according to XcodeVersionInfo is from Xcode 4.5.1 or 4.5.2.
Looks like I am using Xcode 5.0 on my Mountain Lion Machine {{{ cottrell% xcodebuild -version Xcode 5.0 Build version 5A1413 }}} -- Ticket URL: <https://trac.macports.org/ticket/44367#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. ---------------------------+----------------------------- Reporter: ryandesign@… | Owner: matt.cottrell@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: arb | ---------------------------+----------------------------- Comment (by matt.cottrell@…): Replying to [comment:3 ryandesign@…]:
The problem seems to be this line of SOURCE_TOOLS/arb_compiler_version.pl:
{{{ if ($detailedVersion =~ /apple.*llvm.*clang/oi) { $detectedCompiler = 'clang'; } }}}
It assumes `clang --version` will contain output matching `/apple.*llvm.*clang/oi` but it was only in Xcode 4.6 that Apple changed the output from "`Apple clang`" to "`Apple LLVM`" so the above line will fail on earlier versions of clang from Xcode versions 3.2.3 through 4.5.x inclusive.
This entire method of attempting to detect clang is really bad, though. A better way would be to just check the return value of:
{{{ $CC -dM -E -x c /dev/null | grep -q __clang__ }}}
`0` means it's clang, `1` means it isn't.
Thanks, I'll bring this up with the upstream developers of arb. -- Ticket URL: <https://trac.macports.org/ticket/44367#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. ---------------------------+----------------------------- Reporter: ryandesign@… | Owner: matt.cottrell@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: arb | ---------------------------+----------------------------- Comment (by matt.cottrell@…): I do not have a machine with the OS X version and Xcode that was causing this build failure on the buildslave. Could someone else test the patch (arb-PATCH-arb_compiler_version.pl.diff) that I uploaded? It uses the approach suggested by Ryan. {{{ $CC -dM -E -x c /dev/null | grep -q __clang__ }}} Thanks -- Ticket URL: <https://trac.macports.org/ticket/44367#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. ---------------------------+--------------------------------- Reporter: ryandesign@… | Owner: matt.cottrell@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: fixed | Keywords: haspatch maintainer Port: arb | ---------------------------+--------------------------------- Changes (by ryandesign@…): * keywords: => haspatch maintainer * status: new => closed * resolution: => fixed Comment: Committed in r123099. -- Ticket URL: <https://trac.macports.org/ticket/44367#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. ---------------------------+--------------------------------- Reporter: ryandesign@… | Owner: matt.cottrell@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: haspatch maintainer Port: arb | ---------------------------+--------------------------------- Changes (by ryandesign@…): * status: closed => reopened * resolution: fixed => Comment: The attachment, which got committed above, only added the above detection to the existing script, thus fixing some older versions of clang, but it did not remove the other now-unnecessary checks from the script, nor fix the detection of the version of gcc present on Snow Leopard. The attached revised patch, based on my testing, correctly detects all versions of gcc and clang and should be used instead. -- Ticket URL: <https://trac.macports.org/ticket/44367#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. ---------------------------+--------------------------------- Reporter: ryandesign@… | Owner: matt.cottrell@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: haspatch maintainer Port: arb | ---------------------------+--------------------------------- Comment (by ryandesign@…): This patch causes clang versions to be detected correctly, instead of always being detected as the GCC compatibility version "4.2.1" as before. This therefore causes the build to now fail with clang, as in: {{{ Compiler version check: - Your compiler is 'clang' version '3.4.2' This version is not in the list of supported clang-versions: * 4.2.1 - You may either .. - add your version to ALLOWED_clang_VERSIONS in the Makefile and try it out or - switch to one of the allowed versions (see arb_README_gcc.txt for installing a different version of gcc) }}} Trying to whitelist each working compiler version seems like a never- ending exercise in futility. How about just assuming that all versions of clang will work, until you find one that actually doesn't work. Also, it's silly to advise the user how to install "a different version of gcc" when the user's compiler is clang not gcc. -- Ticket URL: <https://trac.macports.org/ticket/44367#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
#44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. ---------------------------+--------------------------------- Reporter: ryandesign@… | Owner: matt.cottrell@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: haspatch maintainer Port: arb | ---------------------------+--------------------------------- Comment (by ryandesign@…): Correcting the compiler version detection has exposed further bugs in how the Makefile handles compiler versions. For example, if the first digit of the compiler version is not "4", it assumes the compiler must have the capabilities of gcc 4.8 or greater. This is obviously wrong; one only needs to consider what would happen when using gcc 3.3 for example. And now that clang versions are being detected correctly, they now hit this problem as well, since clang versions are currently at 3.x. The attached Makefile patch should fix this, and with the patch from #44545, arb now builds for me on Snow Leopard. May I commit these changes? -- Ticket URL: <https://trac.macports.org/ticket/44367#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
#44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. ---------------------------+--------------------------------- Reporter: ryandesign@… | Owner: matt.cottrell@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: haspatch maintainer Port: arb | ---------------------------+--------------------------------- Comment (by matt.cottrell@…): Yes, Ryan. Please commit these changes. Thanks for untangling this mess for me. -- Ticket URL: <https://trac.macports.org/ticket/44367#comment:11> MacPorts <http://www.macports.org/> Ports system for OS X
#44367: arb @6.0: failed to detect COMPILER_NAME (got 'unknown', expected 'clang' or 'gcc'). Stop. ---------------------------+--------------------------------- Reporter: ryandesign@… | Owner: matt.cottrell@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: fixed | Keywords: haspatch maintainer Port: arb | ---------------------------+--------------------------------- Changes (by ryandesign@…): * status: reopened => closed * resolution: => fixed Comment: r123121 -- Ticket URL: <https://trac.macports.org/ticket/44367#comment:12> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts