Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#33287 closed defect (invalid)

zlib: can't build with Xcode 4.3

Reported by: webmaster@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: mkhalil.sarah@…, zstefan@…, scanner85@…
Port: zlib

Description

Hi,

I just bought a new MacBook Air with Mac OS Lion running (v10.7.3). I have installed XCode, xcode-select -version shows v2307, and also installed MacPorts. Then I ran the selfupdate command to update the port tree.

When I try to install apache2, the build fails when building the zlib dependency. Below is the output:

$ sudo port install -d zlib
--->  Fetching archive for zlib
--->  Attempting to fetch zlib-1.2.6_0.darwin_11.x86_64.tbz2 from http://packages.macports.org/zlib
--->  Fetching zlib
--->  Verifying checksum(s) for zlib
--->  Extracting zlib
--->  Applying patches to zlib
--->  Configuring zlib
--->  Building zlib
Error: Target org.macports.build returned: shell command failed (see log for details)
Log for zlib is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_zlib/zlib/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

The zlib log file says:

tail -f /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_zlib/zlib/main.log
:info:build shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_zlib/zlib/work/zlib-1.2.6" && /usr/bin/make -j4 -w all " returned error 2
:error:build Target org.macports.build returned: shell command failed (see log for details)
:debug:build Backtrace: shell command failed (see log for details)
    while executing
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
:info:build Warning: the following items did not execute (for zlib): org.macports.activate org.macports.build org.macports.destroot org.macports.install
:notice:build Log for zlib is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_zlib/zlib/main.log

Any hints for helping me please?

Change History (15)

comment:1 Changed 12 years ago by webmaster@…

Cc: webmaster@… added

Cc Me!

comment:2 Changed 12 years ago by webmaster@…

Cc: webmaster@… removed

Cc Me!

comment:3 Changed 12 years ago by mkhalil.sarah@…

Cc: mkhalil.sarah@… added

Cc Me!

comment:4 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign removed
Keywords: zlib removed
Owner: changed from macports-tickets@… to ryandesign@…
Port: zlib added

None of the output you showed is helpful for determining what happened. Attach the main.log file.

What version of Xcode are you using? If 4.3, I recommend you downgrade to 4.2.1 until we have time to fix various things in MacPorts that make it currently problematic to use 4.3.

comment:5 Changed 12 years ago by mkhalil.sarah@…

Hi,

I had Xcode version 4.3, so I downgraded to 4.2.1 and the problem still occurs.

The mail log says that:

"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
:info:build Warning: the following items did not execute (for zlib): org.macports.activate org.macports.build org.macports.destroot org.macports.install
:error:build Failed to install zlib
:debug:build could not read "/opt/local/lib/pkgconfig/apr-util-1.pc": no such file or directory
    while executing
"file type $file"
:notice:build Log for zlib is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_zlib/zlib/main.log

Any ideas? (I use Mac OS X 10.7.3 by the way)

comment:6 in reply to:  5 Changed 12 years ago by mkhalil.sarah@…

*main.log, not mail, sorry.

comment:7 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

I have a feeling the real error is earlier than that in the main.log. But probably the problem is you did not clean after downgrading Xcode. Try:

sudo port clean zlib

Then try again.

comment:8 in reply to:  7 Changed 12 years ago by mkhalil.sarah@…

It works perfectly! Thank you very much :)

comment:9 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: wontfix
Status: newclosed
Summary: Can't build zlib portzlib: can't build with Xcode 4.3

Great, glad you got it working.

comment:10 Changed 12 years ago by zstefan@…

Resolution: wontfix
Status: closedreopened

I have a similar problem, but sudo port clean zlib / didnt work in my case How to downgrade to xcode 4.2.3?

thats the main.log

..........:~ ........$ sudo port install ImageMagick
Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
--->  Computing dependencies for ImageMagick
--->  Dependencies to be installed: bzip2 expat fontconfig freetype zlib libiconv gperf fontconfig ghostscript autoconf help2man gettext ncurses ncursesw p5.12-locale-gettext perl5.12 gdbm m4 perl5 perl5 perl5 perl5 autoconf automake jbig2dec xz jpeg lcms2 tiff libidn libpaper libpng libtool pkgconfig glib2 libffi xorg-libXext xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-libXau xorg-xproto xorg-libXdmcp xorg-libxcb python27 db46 libedit openssl python_select sqlite3 python27 xorg-libpthread-stubs xorg-xcb-proto libxml2 libxml2 xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXt xorg-libsm xorg-libice liblzma urw-fonts webp
--->  Fetching archive for bzip2
--->  Attempting to fetch bzip2-1.0.6_0.darwin_11.x86_64.tbz2 from http://packages.macports.org/bzip2
--->  Fetching bzip2
--->  Attempting to fetch bzip2-1.0.6.tar.gz from http://lil.fr.distfiles.macports.org/bzip2
--->  Verifying checksum(s) for bzip2
--->  Extracting bzip2
--->  Applying patches to bzip2
--->  Configuring bzip2
--->  Building bzip2
--->  Staging bzip2 into destroot
--->  Installing bzip2 @1.0.6_0
--->  Activating bzip2 @1.0.6_0
--->  Cleaning bzip2
--->  Fetching archive for expat
--->  Attempting to fetch expat-2.0.1_1.darwin_11.x86_64.tbz2 from http://packages.macports.org/expat
--->  Fetching expat
--->  Attempting to fetch expat-2.0.1.tar.gz from http://ignum.dl.sourceforge.net/project/expat/expat/2.0.1
--->  Verifying checksum(s) for expat
--->  Extracting expat
--->  Configuring expat
--->  Building expat
--->  Staging expat into destroot
--->  Installing expat @2.0.1_1
--->  Activating expat @2.0.1_1
--->  Cleaning expat
--->  Fetching archive for zlib
--->  Attempting to fetch zlib-1.2.6_0.darwin_11.x86_64.tbz2 from http://packages.macports.org/zlib
--->  Fetching zlib
--->  Attempting to fetch zlib-1.2.6.tar.bz2 from http://lil.fr.distfiles.macports.org/zlib
--->  Verifying checksum(s) for zlib
--->  Extracting zlib
Error: Couldn't determine your Xcode version (from '/usr/bin/xcodebuild -version').
Error: 
Error: If you have not installed Xcode, install it now; see:
Error: http://guide.macports.org/chunked/installing.xcode.html
Error: 
Error: Target org.macports.extract returned: unable to find Xcode
Error: Failed to install zlib
Log for zlib is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_zlib/zlib/main.log
Error: The following dependencies were not installed: fontconfig freetype zlib libiconv gperf fontconfig ghostscript autoconf help2man gettext ncurses ncursesw p5.12-locale-gettext perl5.12 gdbm m4 perl5 perl5 perl5 perl5 autoconf automake jbig2dec xz jpeg lcms2 tiff libidn libpaper libpng libtool pkgconfig glib2 libffi xorg-libXext xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-libXau xorg-xproto xorg-libXdmcp xorg-libxcb python27 db46 libedit openssl python_select sqlite3 python27 xorg-libpthread-stubs xorg-xcb-proto libxml2 libxml2 xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXt xorg-libsm xorg-libice liblzma urw-fonts webp
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

comment:11 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: zstefan@… added
Resolution: invalid
Status: reopenedclosed

Uninstall Xcode 4.3, following whatever instructions Apple provides to do that. Then install Xcode 4.2.1. If you no longer have the Xcode 4.2.1 installer, download it from http://connect.apple.com

comment:12 in reply to:  description Changed 12 years ago by sholaykabab@…

Do this:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

comment:13 Changed 12 years ago by drkp (Dan Ports)

Xcode 4.3 should work with MacPorts 2.0.4; make sure you have that installed (and follow any instructions it gives you about running xcode-select if necessary).

comment:14 in reply to:  13 ; Changed 12 years ago by scanner85@…

For install zlib I seting xcode-select & adding symlink:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer 
cd  /Applications/Xcode.app/Contents/Developer/usr/bin/
ln -s llvm-gcc-4.2 clang
sudo port install -d zlib

And all OK.

May be better set CC=gcc for environment.


Xcode 4.3
MacPorts 2.0.3

comment:15 in reply to:  14 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: scanner85@… added

Replying to scanner85@…:

For install zlib I seting xcode-select & adding symlink:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer 
cd  /Applications/Xcode.app/Contents/Developer/usr/bin/
ln -s llvm-gcc-4.2 clang
sudo port install -d zlib

Please remove the symlink you created. It does not belong there.

May be better set CC=gcc for environment.

No: On Xcode 4.0 and 4.1 we default to llvm-gcc-4.2. On Xcode 4.2 and up we default to clang. On Xcode 4.2 and up gcc isn't even installed anymore. Individual ports might override that as needed, but to my knowledge, zlib does not need to do so.

This ticket is done; please do not write in it anymore. If you have further questions about how to use MacPorts, please write to the macports-users mailing list.

Note: See TracTickets for help on using tickets.