Opened 5 years ago

#60322 assigned defect

libtorrent-rasterbar: build fails when ccache is enabled

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc:
Port: libtorrent-rasterbar

Description

When the use of ccache is enabled in MacPorts (configureccache yes is set in macports.conf, the ccache port is installed, etc.), MacPorts will set CC to a value containing a space, such as ccache /usr/bin/clang.

A patch was recently added to fix another problem:

  • bindings/python/Makefile.am

    old new  
    3636if ENABLE_PYTHON_BINDING
    3737
    3838all-local:
    39         $(PYTHON) $(srcdir)/setup.py build
     39        CC=$(CC) $(PYTHON) $(srcdir)/setup.py build
    4040
    4141install-exec-local:
    4242        $(PYTHON) $(srcdir)/setup.py install @PYTHON_INSTALL_PARAMS@

These two facts result in a build error when ccache is enabled:

Making all in python
make[2]: Entering directory `/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-ryandesign-fork_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python'
CC=ccache /usr/bin/clang /opt/local/bin/python3.7 ./setup.py build
clang: error: no such file or directory: 'build'

If I fix the patch to quote CC like this:

  • bindings/python/Makefile.am

    old new  
    3636if ENABLE_PYTHON_BINDING
    3737
    3838all-local:
    39         $(PYTHON) $(srcdir)/setup.py build
     39        CC="$(CC)" $(PYTHON) $(srcdir)/setup.py build
    4040
    4141install-exec-local:
    4242        $(PYTHON) $(srcdir)/setup.py install @PYTHON_INSTALL_PARAMS@

then the build fails with a different strange error:

creating build/lib.macosx-10.13-x86_64-3.7
/usr/bin/clang++ /usr/bin/clang -bundle -undefined dynamic_lookup -L/opt/local/lib -Wl,-headerpad_max_install_names build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/alert.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/converters.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/create_torrent.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/datetime.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/entry.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/error_code.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/fingerprint.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/ip_filter.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/magnet_uri.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/module.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/peer_info.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/session.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/session_settings.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/sha1_hash.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/string.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/torrent_handle.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/torrent_info.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/torrent_status.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/utility.o build/temp.macosx-10.13-x86_64-3.7/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_net_libtorrent-rasterbar/libtorrent-rasterbar/work/arvidn-libtorrent-bc66605/bindings/python/src/version.o -L../../src/.libs -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -ltorrent-rasterbar -lboost_system-mt -lboost_system-mt -lboost_python37-mt -lssl -lcrypto -o build/lib.macosx-10.13-x86_64-3.7/libtorrent.cpython-37m-darwin.so -Wl,-headerpad_max_install_names -arch x86_64 -fvisibility=hidden -fvisibility-inlines-hidden
ld: can't link with a main executable file '/usr/bin/clang' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang++' failed with exit status 1

In other words, compiling succeeds, but linking fails because it's inexplicably trying to invoke /usr/bin/clang++ /usr/bin/clang. I haven't yet been able to figure out why this is so.

Change History (0)

Note: See TracTickets for help on using tickets.