Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#18409 closed defect (fixed)

zip-3.00: fails to build with ccache (Portfile patch included)

Reported by: aetherknight@… Owned by: mf2k (Frank Schima)
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: Cc:
Port: zip

Description

when running sudo port upgrade zip to upgrade to zip 3.00, I get the following output:

--->  Fetching zip
--->  Verifying checksum(s) for zip
--->  Extracting zip
--->  Configuring zip
--->  Building zip
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_zip/work/zip30" && nice -n 10 make generic -f unix/Makefile " returned error 2
Command output: eval make -f unix/Makefile zips `cat flags`
ccache -c -I. -DUNIX -O -DNO_PROTO -DNO_CONST -DNO_TIME_T -DNO_SIZE_T -DNO_OFF_T -DUIDGID_NOT_16BIT -DNO_RMDIR -DNO_STRCHR -DNO_STRRCHR -DNO_RENAME -DNO_MKTEMP -DNO_MKTIME -DNO_MKSTEMP -DZMEM -DNEED_MEMMOVE -DNEED_STRERROR -DNO_ERRNO -DNO_DIR -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -DNO_VALLOC zip.c
ccache: illegal option -- I
Cleaned cache
ccache, a compiler cache. Version 2.4
Copyright Andrew Tridgell, 2002

Usage:
        ccache [options]
        ccache compiler [compile options]
        compiler [compile options]    (via symbolic link)

Options:
-s                      show statistics summary
-z                      zero statistics
-c                      run a cache cleanup
-C                      clear the cache completely
-F <maxfiles>           set maximum files in cache
-M <maxsize>            set maximum size of cache (use G, M or K)
-h                      this help page
-V                      print version number
make[1]: *** [zip.o] Error 1
make: *** [generic] Error 2

Error: Unable to upgrade port: 1

I tracked this down to some missing quotes in the Portfile. Basically, a line of the Portfile did not put quotes around the CC variable, causing something to see only the first word of CC as being in the variable. See the attached patch for the change.

Attachments (1)

zip-3.00-portfile.patch (333 bytes) - added by aetherknight@… 15 years ago.
puts escaped quotes around the escaped dereference of CC to preserve the variable in the actual command called

Download all attachments as: .zip

Change History (7)

Changed 15 years ago by aetherknight@…

Attachment: zip-3.00-portfile.patch added

puts escaped quotes around the escaped dereference of CC to preserve the variable in the actual command called

comment:1 Changed 15 years ago by mf2k (Frank Schima)

zip builds just fine for me without this patch. What OS X and Xcode versions are you running? I'm on 10.5.6 intel and Xcode 3.1.2.

comment:2 Changed 15 years ago by aetherknight@…

I'm running Mac OS X 10.4.11, with Xcode 2.5. I have ccache support enabled in MacPorts, which is what caused the problem.

sudo port -dv upgrade zip output:

DEBUG: Found port in file:///opt/local/var/macports/sources/rsync.macports.org/release/ports/archivers/zip
DEBUG: epoch: in tree: 0 installed: 0
DEBUG: zip 3.00_0 exists in the ports tree
DEBUG: zip 2.32_0 is installed
DEBUG: variants to install 
DEBUG: available variants are : universal
DEBUG: new portvariants: without_ofx + without_quotes + cscope + without_hbci + ipv6 + pcre +
DEBUG: Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/release/ports/archivers/zip
DEBUG: setting option os.universal_supported to yes
DEBUG: org.macports.load registered provides 'load', a pre-existing procedure. Target override will not be provided
DEBUG: org.macports.distfiles registered provides 'distfiles', a pre-existing procedure. Target override will not be provided
DEBUG: universal variant already exists, so not adding the default one
DEBUG: Requested variant without_quotes is not provided by port zip.
DEBUG: Requested variant without_ofx is not provided by port zip.
DEBUG: Requested variant darwin is not provided by port zip.
DEBUG: Requested variant ipv6 is not provided by port zip.
DEBUG: Requested variant without_hbci is not provided by port zip.
DEBUG: Requested variant cscope is not provided by port zip.
DEBUG: Requested variant i386 is not provided by port zip.
DEBUG: Requested variant pcre is not provided by port zip.
DEBUG: Requested variant macosx is not provided by port zip.
DEBUG: Executing org.macports.main (zip)
--->  Fetching zip
DEBUG: Executing org.macports.fetch (zip)
--->  Verifying checksum(s) for zip
DEBUG: Executing org.macports.checksum (zip)
--->  Checksumming zip30.tgz
DEBUG: Correct (md5) checksum for zip30.tgz
DEBUG: Correct (sha1) checksum for zip30.tgz
DEBUG: Correct (rmd160) checksum for zip30.tgz
--->  Extracting zip
DEBUG: Executing org.macports.extract (zip)
--->  Extracting zip30.tgz
DEBUG: setting option extract.args to /opt/local/var/macports/distfiles/zip/zip30.tgz
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.4'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_zip/work" && gzip -dc /opt/local/var/macports/distfiles/zip/zip30.tgz | /usr/bin/gnutar --no-same-owner -xf -'
DEBUG: Executing org.macports.patch (zip)
--->  Configuring zip
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing org.macports.configure (zip)
DEBUG: Environment: CFLAGS='-pipe -O2' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-pipe -O2' MACOSX_DEPLOYMENT_TARGET='10.4' CPP='ccache /usr/bin/cpp-4.0' CXX='ccache /usr/bin/g++-4.0' F90FLAGS='-pipe -O2' LDFLAGS='-L/opt/local/lib' FCFLAGS='-pipe -O2' OBJC='ccache /usr/bin/gcc-4.0' INSTALL='/usr/bin/install -c' OBJCFLAGS='-pipe -O2' FFLAGS='-pipe -O2' CC='ccache /usr/bin/gcc-4.0'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_zip/work/zip30" && make CC=${CC} flags -f unix/Makefile'
make: Nothing to be done for `/usr/bin/gcc-4.0'.
sh unix/configure "ccache" "-I. -DUNIX " ""
Check C compiler type (optimization options)
  Other-unknown C (-O)
Check bzip2 support
  Check for bzip2 in bzip2 directory
  Check if OS already has bzip2 library installed
-- Either bzlib.h or libbz2.a not found - no bzip2
Check for the C preprocessor
Check if we can use asm code
Check for ANSI options
Check for prototypes
Check the handling of const
Check for time_t
Check for size_t
Check for off_t
Check size of UIDs and GIDs
(Now zip stores variable size UIDs/GIDs using a new extra field.  This
 tests if this OS uses 16-bit UIDs/GIDs and so if the old 16-bit storage
 should also be used for backward compatibility.)
-- UID/GID test failed on compile - disabling old 16-bit UID/GID support
Check for Large File Support
-- no Large File Support
Check for wide char support
-- no Unicode support
Check for gcc no-builtin flag
Check for rmdir
Check for strchr
Check for strrchr
Check for rename
Check for mktemp
Check for mktime
Check for mkstemp
Check for memset
Check for memmove
Check for strerror
Check for errno declaration
Check for directory libraries
Check for readlink
Check for directory include file
Check for nonexistent include files
Check for term I/O include file
Check for valloc
Check for /usr/local/bin and /usr/local/man
Check for OS-specific flags
Check for symbolic links
--->  Building zip
DEBUG: Executing org.macports.build (zip)
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.4'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_zip/work/zip30" && nice -n 10 make generic -f unix/Makefile'
eval make -f unix/Makefile zips `cat flags`
ccache -c -I. -DUNIX -O -DNO_PROTO -DNO_CONST -DNO_TIME_T -DNO_SIZE_T -DNO_OFF_T -DUIDGID_NOT_16BIT -DNO_RMDIR -DNO_STRCHR -DNO_STRRCHR -DNO_RENAME -DNO_MKTEMP -DNO_MKTIME -DNO_MKSTEMP -DZMEM -DNEED_MEMMOVE -DNEED_STRERROR -DNO_ERRNO -DNO_DIR -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -DNO_VALLOC zip.c
ccache: illegal option -- I
Cleaned cache
ccache, a compiler cache. Version 2.4
Copyright Andrew Tridgell, 2002

Usage:
        ccache [options]
        ccache compiler [compile options]
        compiler [compile options]    (via symbolic link)

Options:
-s                      show statistics summary
-z                      zero statistics
-c                      run a cache cleanup
-C                      clear the cache completely
-F <maxfiles>           set maximum files in cache
-M <maxsize>            set maximum size of cache (use G, M or K)
-h                      this help page
-V                      print version number
make[1]: *** [zip.o] Error 1
make: *** [generic] Error 2
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_zip/work/zip30" && nice -n 10 make generic -f unix/Makefile " returned error 2
Command output: eval make -f unix/Makefile zips `cat flags`
ccache -c -I. -DUNIX -O -DNO_PROTO -DNO_CONST -DNO_TIME_T -DNO_SIZE_T -DNO_OFF_T -DUIDGID_NOT_16BIT -DNO_RMDIR -DNO_STRCHR -DNO_STRRCHR -DNO_RENAME -DNO_MKTEMP -DNO_MKTIME -DNO_MKSTEMP -DZMEM -DNEED_MEMMOVE -DNEED_STRERROR -DNO_ERRNO -DNO_DIR -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -DNO_VALLOC zip.c
ccache: illegal option -- I
Cleaned cache
ccache, a compiler cache. Version 2.4
Copyright Andrew Tridgell, 2002

Usage:
        ccache [options]
        ccache compiler [compile options]
        compiler [compile options]    (via symbolic link)

Options:
-s                      show statistics summary
-z                      zero statistics
-c                      run a cache cleanup
-C                      clear the cache completely
-F <maxfiles>           set maximum files in cache
-M <maxsize>            set maximum size of cache (use G, M or K)
-h                      this help page
-V                      print version number
make[1]: *** [zip.o] Error 1
make: *** [generic] Error 2

Warning: the following items did not execute (for zip): org.macports.destroot org.macports.build
DEBUG: invalid command name "::ui_init"
    while executing
"::ui_init $priority $prefix $channels $message"
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 $body"
Error: Unable to upgrade port: 1

In the Portfile, the

configure.pre_args      CC=\${CC} flags \
	                                        ${args}

lines modify the shell command run during the configure phase to be:

DEBUG: Assembled command: ... make CC=${CC} flags -f unix/Makefile

which does not properly preserve the original CC variable:

make: Nothing to be done for `/usr/bin/gcc-4.0'.
sh unix/configure "ccache" "-I. -DUNIX " ""
Check C compiler type (optimization options)
  Other-unknown C (-O)
...

My patch fixes this by putting quotes around the $CC variable in order to preserve the space between ccache and the actual compiler.

comment:3 Changed 15 years ago by aetherknight@…

Oh, and the CC variable as set by port for the configure phase:

DEBUG: Environment: ... CC='ccache /usr/bin/gcc-4.0'

comment:4 Changed 15 years ago by mf2k (Frank Schima)

Keywords: zip removed
Owner: changed from macports-tickets@… to macsforever2000@…
Status: newassigned

comment:5 Changed 15 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: assignedclosed

Committed revision r46581. Thanks!

comment:6 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.