Opened 14 years ago

Closed 14 years ago

#25320 closed defect (fixed)

qt4-mac mysql variant doesn't build mysql driver

Reported by: mac.ports.fishspit@… Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 1.9.0
Keywords: Cc: bjoern.ricks@…, emanuel@…
Port: qt4-mac

Description

Attempting to install the mysql variant of qt4-mac (4.6.3), it compiles but doesn't include the mysql driver. It appears to fail during the qt configuration when it can't find the mysql header file;

port -d build qt4-mac +mysql 2>&1 |tee build.out |grep -i mysql      
DEBUG: Executing variant mysql provides mysql                                             
DEBUG: mysql5 5.1.47_0 exists in the ports tree
DEBUG: mysql5 5.1.47_0  is the latest installed
DEBUG: mysql5 5.1.47_0  is active
DEBUG: Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/release/ports/databases/mysql5
DEBUG: No need to upgrade! mysql5 5.1.47_0 >= mysql5 5.1.47_0
DEBUG: Searching for dependency: mysql5
DEBUG: Found Dependency: receipt exists for mysql5
MySQL (thread-safe) auto-detection... ()
/usr/bin/g++-4.2 -c -pipe -arch i386 -O2 -Wall -W  -I../../../mkspecs/macx-g++ -I. -o mysql.o ../mysql/mysql.cpp
../mysql/mysql.cpp:42:19: error: mysql.h: No such file or directory
gmake: *** [mysql.o] Error 1
MySQL (thread-safe) disabled.
MySQL (thread-unsafe) auto-detection... ()
/usr/bin/g++-4.2 -c -pipe -arch i386 -O2 -Wall -W  -I../../../mkspecs/macx-g++ -I. -o mysql.o mysql.cpp
mysql.cpp:42:19: error: mysql.h: No such file or directory
gmake: *** [mysql.o] Error 1
MySQL (thread-unsafe) disabled.

I noticed this with 4.6.2_2, and it also occuring with 4.6.3. I think it worked correctly in 4.6.1, but I'm not sure exactly when it stopped because I still haven't gotten akonadi to work for kde 4.4 so I have been sticking with 4.3.5 in mean time.

Attachments (3)

build.out (144.1 KB) - added by mac.ports.fishspit@… 14 years ago.
debug output from building qt4-mac 4.6.3
build.2.out (740.7 KB) - added by mac.ports.fishspit@… 14 years ago.
debug output after applying Portfile diff
qt4-mac-Portfile.diff (3.2 KB) - added by michaelld (Michael Dickens) 14 years ago.
Patch for qt4-mac 4.6.3_0 Portfile that uses compiler.cpath and compiler.library_path.

Download all attachments as: .zip

Change History (22)

comment:1 Changed 14 years ago by michaelld (Michael Dickens)

Can you attach the whole 'build.out' file?

Changed 14 years ago by mac.ports.fishspit@…

Attachment: build.out added

debug output from building qt4-mac 4.6.3

comment:2 Changed 14 years ago by jmroot (Joshua Root)

Port: qt4-mac added

Please remember to fill in the Port field.

comment:3 Changed 14 years ago by michaelld (Michael Dickens)

Owner: changed from macports-tickets@… to michaelld@…

The CPATH environment variable isn't getting created correctly -- it does not include the path to the mysql.h header file. I think 'configure' has options for both the compiler header search path, and the linker library search path. I'll see if I can get those to work since this method isn't and using those methods should be more robust.

comment:4 Changed 14 years ago by michaelld (Michael Dickens)

Looks like this is a 'port' issue.

If I modify the Portfile to print out debugging info during "pre-configure", I can show that (edited slightly for wikiformatting):

[snip]
DEBUG: Executing proc-pre-org.macports.configure-configure-0
cpath = /opt/local/include /opt/local/include/mysql5/mysql
configure.env befor = 
configure.env after =
    CPATH=/opt/local/include:/opt/local/include/mysql5/mysql
    LIBRARY_PATH=/opt/local/lib:/opt/local/lib/mysql5/mysql
DEBUG: Executing org.macports.configure (qt4-mac)
DEBUG: Environment:
    CPATH='/opt/local/include'
    LIBRARY_PATH='/opt/local/lib'
    MACOSX_DEPLOYMENT_TARGET='10.5'
    [snip]

So, it looks like "configure.env" is being set correctly during the "pre-configure" stage, but then the CPATH and LIBRARY_PATH are being truncated before the "configure" command is issued.

comment:5 Changed 14 years ago by michaelld (Michael Dickens)

I'm trying out some Portfile mods that go back to using -I<PATH> during configure instead of CPATH=<PATH> as an environment variable (ditto for -L and LIBRARY_PATH). So far (maybe 1/10 of the way compiling), it seems to be working (using the +mysql variant). I will post again once I know more, if it works or not.

The qt4-mac Portfile states "CPATH is used instead of -I to avoid conflicts with other ports" and references tickets #15219 and #18723. I know of no difference between the use of CPATH=<PATH> versus -I<PATH>, except possibly that CPATH comes first or last in the search depending on the compiler. Can someone enlighten me as to the difference?

comment:6 Changed 14 years ago by mac.ports.fishspit@…

It's my understanding that -I takes precedence in the order over the environment variable. Maybe this is a bug in port, I notice the version was just bumped up today.

comment:7 Changed 14 years ago by michaelld (Michael Dickens)

The bump was just a version update, nothing more or less. I think the issue was introduced into 'port' itself a while back, but I can't prove that definitively.

Can try out the attached patch for the qt4-mac Portfile? It works with the +mysql variant for me, but then my MacPorts install will be different from yours.

It looks like Qt 4.6 series has changes in the way it compiles such that the issues of ticket #15219 are no longer valid (i.e., I can compile with those ports installed, and everything compiles just fine). I can't say more about ticket #18723, since the only "plugin.h" that's installed is via mysql5 ... if there were another one installed into ${prefix}/include then there would be an issue since it's included first in the header search path. But, that would be an issue no matter is using CPATH or -I.

comment:8 Changed 14 years ago by mac.ports.fishspit@…

I've applied the patch and building now, it seems to have gotten through the configure stage successfully, so that's a good sign. I can confirm if it completes successfully in the morning.

comment:9 Changed 14 years ago by mac.ports.fishspit@…

Looks like it failed to completely build, maybe a conflicting util.h, I'll attach the full debug output.

In file included from cpp/cppextractimages.cpp:46:
/opt/local/include/utils.h: In function 'char* copystring(const char*)':
/opt/local/include/utils.h:90: error: invalid conversion from 'void*' to 'char*'
/opt/local/include/utils.h: In function 'char* catstring(char*, const char*)':
/opt/local/include/utils.h:100: error: invalid conversion from 'void*' to 'char*'
/opt/local/include/utils.h:102: error: invalid conversion from 'void*' to 'char*'
In file included from ../../../include/QtCore/qtextcodec.h:1,
                 from ../../../include/QtCore/QTextCodec:1,
                 from cpp/cppextractimages.cpp:51:
../../../include/QtCore/../../src/corelib/codecs/qtextcodec.h: At global scope:
../../../include/QtCore/../../src/corelib/codecs/qtextcodec.h:175: warning: 'QCoreXmlStreamWriter' is already a friend of 'QTextEncoder'
make[1]: *** [.obj/release-shared/cppextractimages.o] Error 1
make: *** [sub-uic-make_default-ordered] Error 2
shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_aqua_qt4-mac/work/qt-everywhere-opensource-src-4.6.3" && /usr/bin/make first " returned error 2
Error: Target org.macports.build returned: shell command failed
DEBUG: Backtrace: shell command failed
    while executing
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
Warning: the following items did not execute (for qt4-mac): org.macports.activate org.macports.build org.macports.destroot org.macports.install
Log for qt4-mac is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_aqua_qt4-mac/main.log
Error: Status 1 encountered during processing.

Changed 14 years ago by mac.ports.fishspit@…

Attachment: build.2.out added

debug output after applying Portfile diff

comment:10 Changed 14 years ago by michaelld (Michael Dickens)

The issue you just encountered is yet another C-header include path conflict. What does "port provides /opt/local/include/utils.h" return?

We've been discussing the CPATH versus C_INCLUDE_PATH versus -isystem versus -I on the MacPorts dev list (just a few emails, but that's enough), and I think my change to use -I isn't the correct solution: search ordering is -I, built-in-to-compiler, CPATH, -isystem, and then C_INCLUDE_PATH. So the search order for most ports should always be internal first (to the port), then the rest of the search order. Hence, the correct place to put in header search paths is generally CPATH.

I think the correct thing to do is fix 'port' as per ticket #25321, so I'll push that agenda -- that's not my area of expertise. I'll post a reply once this port works again, per that ticket.

comment:11 Changed 14 years ago by mac.ports.fishspit@…

# port provides /opt/local/include/utils.h 
/opt/local/include/utils.h is provided by: cdparanoia

Thanks for looking into the port issue, I'll try deactivating cdparanoia and building again.

comment:12 Changed 14 years ago by michaelld (Michael Dickens)

Sounds good. I'll also add 'cdparanoia' to the list of conflicting ports, just in case.

comment:13 Changed 14 years ago by michaelld (Michael Dickens)

I'm attaching a new Portfile diff (replacing the old one, so, diff relative to the original Portfile). Can you test it up through build only ("sudo port -d build qt4-mac +mysql")? Some part of destroot or post-destroot won't work yet, but if you can verify that the rest of it works then that will help me out. Thanks!

Changed 14 years ago by michaelld (Michael Dickens)

Attachment: qt4-mac-Portfile.diff added

Patch for qt4-mac 4.6.3_0 Portfile that uses compiler.cpath and compiler.library_path.

comment:14 Changed 14 years ago by mac.ports.fishspit@…

After disabling cdparanoia, the build got past the util.h error but then ran into another error later. I'll try to rebuild again after applying the latest Portfile diff.

comment:15 Changed 14 years ago by michaelld (Michael Dickens)

OK; remember that this Portfile diff is only good through 'build'; I'm working on the mods for the rest (though 'install') over the weekend, but it might be a couple of days to get them done (you know, family time and all :).

comment:16 Changed 14 years ago by mac.ports.fishspit@…

Thanks, It appears to have build successfully with the latest diff to the Portfile. Enjoy the rest of your weekend!

comment:17 Changed 14 years ago by bjoern.ricks@…

Cc: bjoern.ricks@… added

Cc Me!

comment:18 Changed 14 years ago by emanuel@…

Cc: emanuel@… added

Cc Me!

comment:19 Changed 14 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

Fixed in r69277 .

Note: See TracTickets for help on using tickets.