Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#43289 closed defect (invalid)

OSX Mavericks upgrade causes darcs build to fail

Reported by: rene.sugar@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc:
Port: darcs

Description

An upgrade to OS X Mavericks causes build of darcs to fail. This problem also causes several other Haskell components to fail to build.

You get an error about not being able to find <sys/cdefs.h>.

The solution is to reinstall the XCode command-line tools.

http://stackoverflow.com/questions/19649421/something-odd-happened-to-c-11-in-mavericks

“OSX Mavericks upgrade will wipe out a number of XCode installation directories. In order to restore them, you need to reinstall the XCode command-line tools.

xcode-select --install”

“Problem Hotlist” could mention “xcode-select —install” solution or “port” could check if "/usr/include/sys/cdefs.h" is not found on OS X Mavericks and remind user to reinstall XCode command-line tools.

Portion of build log showing the error:

:info:build [  1 of 183] Compiling URL.Request      ( src/URL/Request.hs, dist/build/URL/Request.p_o )
:info:build 
:info:build In file included from /opt/local/lib/ghc-7.6.3/include/Stg.h:65:0:
:info:build     0,
:info:build                      from /opt/local/lib/ghc-7.6.3/include/Rts.h:30,
:info:build                      from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_darcs/darcs/work/.tmp/ghc70426_0/ghc70426_0.c:2:
:info:build 
:info:build /opt/local/lib/gcc48/gcc/x86_64-apple-darwin13/4.8.2/include-fixed/math.h:45:23:
:info:build      fatal error: sys/cdefs.h: No such file or directory
:info:build      #include <sys/cdefs.h>
:info:build                            ^
:info:build compilation terminated.
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_darcs/darcs/work/darcs-2.8.4" && runhaskell Setup build -v 
:info:build Exit code: 1
:error:build org.macports.build for port darcs returned: command execution failed
:debug:build Error code: CHILDSTATUS 70047 1
:debug:build Backtrace: command execution failed

Change History (3)

comment:1 in reply to:  description Changed 11 years ago by neverpanic (Clemens Lang)

Keywords: xcode removed
Resolution: invalid
Status: newclosed
Type: enhancementdefect

Replying to rene.sugar@…:

“port” could check if "/usr/include/sys/cdefs.h" is not found on OS X Mavericks and remind user to reinstall XCode command-line tools.

And it'll do exactly that starting with 2.3.

MacPorts requires the Command Line Tools – trying to run MacPorts without the command line tools is an unsupported configuration, and many ports will fail to build without them. There's not much we can do about that except what has already been done and will be released in 2.3.

comment:2 Changed 11 years ago by rene.sugar@…

The OS X Mavericks upgrade doesn't remove the XCode command-line binaries but some of the include files are missing.

The build of darcs would have failed a lot earlier if the XCode command-line tools were removed by Apple's upgrade process but that is not what happened.

comment:3 Changed 11 years ago by neverpanic (Clemens Lang)

It doesn't remove the binaries, because those aren't even provided by the command line tools package. In fact, Mavericks is what installs the binaries in the first place:

$ pkgutil --file-info /usr/bin/clang
volume: /
path: /usr/bin/clang

pkgid: com.apple.pkg.Essentials
pkg-version: 10.9.0.1.1.1306847324
install-time: 1382488923
uid: 0
gid: 0
mode: 755

/usr/bin/clang (and its siblings) are only shims into the xcode-select mechanism that will happily use these tools from Xcode if installed. MacPorts 2.3 will however correctly deal with this situation and not mistake these files for a complete command line tools installation, but instead check for /Library/Developer/CommandLineTools/usr/bin/make:

$ pkgutil --file-info /Library/Developer/CommandLineTools/usr/bin/make
volume: /
path: /Library/Developer/CommandLineTools/usr/bin/make

pkgid: com.apple.pkg.CLTools_Executables
pkg-version: 5.1.0.0.1.1393561416
install-time: 1394566188
uid: 0
gid: 80
mode: 755

and warn if that's missing.

Note: See TracTickets for help on using tickets.