Opened 5 years ago

Closed 22 months ago

#59073 closed defect (fixed)

[mysql57] compile failure on 10.6.8 x86_64

Reported by: BjarneDMat Owned by: chrstphrchvz (Christopher Chavez)
Priority: Normal Milestone:
Component: ports Version:
Keywords: snowleopard Cc: chrstphrchvz (Christopher Chavez)
Port: mysql57

Description

version:1
:debug:sysinfo Mac OS X 10.6 (darwin/10.8.0) arch i386
:debug:sysinfo MacPorts 2.6.0
:debug:sysinfo Xcode 3.2.6
:debug:sysinfo SDK 10.6
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 10.6


[ 77%] Building CXX object
rapid/plugin/x/CMakeFiles/mysqlxtest.dir/generated/protobuf/mysqlx_notice.pb.cc.o
...
make[2]: *** No rule to make target
`archive_output_directory/libmysqlclient.a', needed by
`rapid/plugin/x/mysqlxtest'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 77%] Building CXX object
rapid/plugin/x/CMakeFiles/mysqlxtest.dir/generated/protobuf/mysqlx_resultset.pb.cc.o
...
make[2]: Leaving directory
`/macports/var/macports/build/.../mysql57/work/build'
make[1]: *** [rapid/plugin/x/CMakeFiles/mysqlxtest.dir/all] Error 2
make[1]: Leaving directory
`/macports/var/macports/build/.../mysql57/work/build'
make: *** [all] Error 2
make: Leaving directory
`/macports/var/macports/build/.../mysql57/work/build'
Command failed:  cd
"/macports/var/macports/build/.../mysql57/work/build" &&
/Developer/usr/bin/make -j2 -w all VERBOSE=ON
Exit code: 2
Error: Failed to build mysql57: command execution failed

main.log here : https://macports.mathiesen.info/logs/databases/mysql57/main.log

Change History (8)

comment:1 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Looks like the relevant error in the log is:

:info:build [ 52%] Linking C static library ../archive_output_directory/libmysqlclient.a
:info:build cd /macports/var/macports/build/_macports_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mysql57/mysql57/work/build/libmysql && /macports/bin/cmake -P CMakeFiles/mysqlclient.dir/cmake_clean_target.cmake
:info:build cd /macports/var/macports/build/_macports_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_databases_mysql57/mysql57/work/build/libmysql && /macports/bin/cmake -E cmake_link_script CMakeFiles/mysqlclient.dir/link.txt --verbose=ON
:info:build /macports/bin/ar qc ../archive_output_directory/libmysqlclient.a  CMakeFiles/mysqlclient.dir/__/archive_output_directory/mysqlclient_depends.c.o
:info:build /macports/bin/ranlib: file: ../archive_output_directory/libmysqlclient.a(mysqlclient_depends.c.o) has no symbols
:info:build /macports/bin/ranlib ../archive_output_directory/libmysqlclient.a
:info:build /macports/bin/ranlib: file: ../archive_output_directory/libmysqlclient.a(mysqlclient_depends.c.o) has no symbols
:info:build warning: /macports/bin/ranlib: warning for library: ../archive_output_directory/libmysqlclient.a the table of contents is empty (no object file members in the library define global symbols)
:info:build make[2]: *** No rule to make target `archive_output_directory/libmysqlclient.a', needed by `client/mysql_secure_installation'.  Stop.

But I'm not sure what to do about that.

comment:2 Changed 5 years ago by BjarneDMat

It's partly a libtool / cctools problem as described in https://trac.macports.org/ticket/59074

Partial workaround:

declare usrBin='/usr/bin'
declare devBin="/Developer${usrBin}"

while read -u 9 cctool 
do
    theTool=$( basename ${cctool} )
    echo ${theTool}
    for binDir in "${usrBin}" "${devBin}"
    do
        mv -n "${binDir}/${theTool}" "${binDir}/${theTool}.orig"
        rm "${binDir}/${theTool}"
        ln -h "${cctool}" "${binDir}/${theTool}"
    done
done 9< <( port contents cctools | fgrep /bin/ )

There're still issues :https://macports.mathiesen.info/logs/databases/mysql57/main.log2

Version 0, edited 5 years ago by BjarneDMat (next)

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

Keywords: snowleopard added

comment:4 Changed 2 years ago by kencu (Ken)

the correct fix is to stop mysql from forcing the old /usr/bin/libtool, for example:

--- cmake/merge_archives.cmake.in.orig	2021-12-20 15:38:08.000000000 -0800
+++ cmake/merge_archives.cmake.in	2021-12-20 15:38:41.000000000 -0800
@@ -106,7 +106,7 @@
 ELSEIF(APPLE)
   # libtool handles it for us
   EXECUTE_PROCESS(
-    COMMAND /usr/bin/libtool -static -o ${TARGET_LOC} ${LIB_LOCATIONS}
+    COMMAND libtool -static -o ${TARGET_LOC} ${LIB_LOCATIONS}
     )
 ELSEIF(LINUX)
   # First create a "thin" archive, then convert it to a normal one.

or some other more specific hardcoded patch-and-reinplace effort if you want to be really definitive about the libtool used.

comment:5 Changed 2 years ago by BjarneDMat

So, I should be able to do this :
port clean --all mysql57
port extract mysql57
cd $( port work mysql57 )
nano $( find . -name 'merge_archives.cmake.in' )
port -d -cuNp upgrade mysql57

???

When I do that, I still get the attempt 1 error from #64250

comment:6 in reply to:  4 Changed 22 months ago by chrstphrchvz (Christopher Chavez)

Replying to kencu:

the correct fix is to stop mysql from forcing the old /usr/bin/libtool, for example:

--- cmake/merge_archives.cmake.in.orig	2021-12-20 15:38:08.000000000 -0800
+++ cmake/merge_archives.cmake.in	2021-12-20 15:38:41.000000000 -0800
@@ -106,7 +106,7 @@
 ELSEIF(APPLE)
   # libtool handles it for us
   EXECUTE_PROCESS(
-    COMMAND /usr/bin/libtool -static -o ${TARGET_LOC} ${LIB_LOCATIONS}
+    COMMAND libtool -static -o ${TARGET_LOC} ${LIB_LOCATIONS}
     )
 ELSEIF(LINUX)
   # First create a "thin" archive, then convert it to a normal one.

or some other more specific hardcoded patch-and-reinplace effort if you want to be really definitive about the libtool used.

PR opened for this: https://github.com/macports/macports-ports/pull/15432

comment:7 Changed 22 months ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:8 Changed 22 months ago by chrstphrchvz (Christopher Chavez)

Owner: set to chrstphrchvz
Resolution: fixed
Status: newclosed

In 9d2497bfdd1aacd636cc32fa67e0e0a5e977c90b/macports-ports (master):

mysql57: allow newer libtool

Based on approach in mysql56
(and previously in mysql8)

Fixes: #59073

Note: See TracTickets for help on using tickets.