Bug 964681 - cmake broken under MinGW
Summary: cmake broken under MinGW
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: mingw-filesystem
Version: 18
Hardware: i686
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Erik van Pienbroek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-19 13:38 UTC by Steve
Modified: 2013-05-20 22:50 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-05-20 22:50:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Patch to fix MinGW cmake toolchain configuration (878 bytes, patch)
2013-05-19 13:38 UTC, Steve
no flags Details | Diff
Test case (6.18 KB, application/x-bzip2)
2013-05-19 14:12 UTC, Steve
no flags Details

Description Steve 2013-05-19 13:38:48 UTC
Created attachment 750043 [details]
Patch to fix MinGW cmake toolchain configuration

While building packages with MinGW, I discovered that it was searching the host's cmake configuration while cross-compiling for the Win32 target!  There are two problems.

One is that /usr/share/mingw/Toolchain-mingw{32,64}.cmake both need an extra line, to tell cmake not to search for packages in the host's cmake configuration.  Enclosed is a patch to apply in the SOURCES directory, after mingw-filesystem-97-1.fc18.src.rpm has been installed there.

The other is that there is no MinGW cmake configuration.  I've created a source RPM with the necessary information.  You can find it at https://www.box.com/s/iao568wpeuqnghfr8k29 .

Comment 1 Erik van Pienbroek 2013-05-19 13:54:43 UTC
Thanks for your contribution!

Would you also be able to provide a small testcase? (A small shell script and a CMakeLists.txt file would be sufficient) which we can use to make sure the updated behaviour is correct?

Such a testcase can then be added to our testsuite ( http://fedoraproject.org/wiki/MinGW/Testsuite ) so we can make sure no regressions happen in this area in future versions of mingw-filesystem.

Comment 2 Steve 2013-05-19 14:12:05 UTC
Created attachment 750047 [details]
Test case

All I can offer is the way I discovered the problem.  Enclosed are the two extra files needed to build phonon for MinGW.  Grab the latest phonon source RPM from the Fedora yum repos, install it, then unpack this archive to your rpmbuild directory.  Make sure you have pulseaudio-libs-devel installed too, so that the unpatched MinGW build system will accidentally find it.

You'll see that building the MinGW phonon finds PulseAudio, but then can't find any of the actual information that goes along with it, and thus fails.

Once the MinGW build system is patched, and mingw{32,64}-cmake is installed, the MinGW phonon build should succeed.

Comment 3 Steve 2013-05-19 14:14:33 UTC
Other than that, creating a testcase is kind of difficult -- you'd have to have a situation where you've got a devel package installed on the host but not in MinGW.

Comment 4 Erik van Pienbroek 2013-05-19 14:46:59 UTC
(In reply to comment #3)
> Other than that, creating a testcase is kind of difficult -- you'd have to
> have a situation where you've got a devel package installed on the host but
> not in MinGW.

These kind of situations can be enforced in our testsuite, that shouldn't be a problem. I'm taking a look at your testcase right now

Comment 5 Erik van Pienbroek 2013-05-19 15:00:41 UTC
I just tried to reproduce the issue using the mingw-phonon package you attached in comment 2, but it seems to build just fine here:

$ rpm -qa | grep pulseaudio | sort
alsa-plugins-pulseaudio-1.0.27-1.fc19.x86_64
kde-settings-pulseaudio-19-20.fc19.noarch
pulseaudio-3.0-7.fc19.x86_64
pulseaudio-gdm-hooks-3.0-7.fc19.x86_64
pulseaudio-libs-3.0-7.fc19.i686
pulseaudio-libs-3.0-7.fc19.x86_64
pulseaudio-libs-devel-3.0-7.fc19.x86_64
pulseaudio-libs-glib2-3.0-7.fc19.x86_64
pulseaudio-module-bluetooth-3.0-7.fc19.x86_64
pulseaudio-module-x11-3.0-7.fc19.x86_64
pulseaudio-utils-3.0-7.fc19.x86_64
wine-pulseaudio-1.5.29-1.fc19.i686
wine-pulseaudio-1.5.29-1.fc19.x86_64

$ rpm -qa | grep cmake
cmake-2.8.10.2-5.fc19.x86_64

$ rpm -qa | grep mingw | grep filesystem
mingw32-filesystem-98-1.fc20.noarch
mingw64-filesystem-98-1.fc20.noarch
mingw-filesystem-base-98-1.fc20.noarch

$ rpmbuild -ba mingw-phonon.spec
fout: Failed build dependencies:
	mingw32-kde-filesystem is needed by mingw-phonon-4.6.0-6.fc19.noarch
	mingw64-kde-filesystem is needed by mingw-phonon-4.6.0-6.fc19.noarch

$ rpmbuild -ba mingw-phonon.spec --nodeps
<snip>
+ /usr/bin/cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr/i686-w64-mingw32/sys-root/mingw -DCMAKE_INSTALL_LIBDIR:PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib -DINCLUDE_INSTALL_DIR:PATH=/usr/i686-w64-mingw32/sys-root/mingw/include -DLIB_INSTALL_DIR:PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib -DSYSCONF_INSTALL_DIR:PATH=/usr/i686-w64-mingw32/sys-root/mingw/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/i686-w64-mingw32/sys-root/mingw/share -DCMAKE_SKIP_RPATH:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/Toolchain-mingw32.cmake -DPHONON_BUILD_TESTS:BOOL=ON -DPHONON_INSTALL_QT_EXTENSIONS_INTO_SYSTEM_QT:BOOL=ON -DHOST_PREFIX_PATH:STRING=/usr/bin -DHOST_PACKAGE_PATH:STRING=/usr/lib64/automoc4 .. ..
-- The C compiler identification is GNU 4.8.0
-- The CXX compiler identification is GNU 4.8.0
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- !!!!! Tests have been removed and need to be redone !!!!!
-- Building tests.
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt-Version 4.8.4 (using /usr/i686-w64-mingw32/bin/qmake-qt4)
-- Found Automoc4: /usr/bin/automoc4
-- Performing Test HAVE_FPIE_SUPPORT
-- Performing Test HAVE_FPIE_SUPPORT - Failed
-- Performing Test __KDE_HAVE_W_OVERLOADED_VIRTUAL
-- Performing Test __KDE_HAVE_W_OVERLOADED_VIRTUAL - Success
-- Performing Test __KDE_HAVE_GCC_VISIBILITY
-- Performing Test __KDE_HAVE_GCC_VISIBILITY - Success
-- Could NOT find PulseAudio

Comment 6 Steve 2013-05-19 16:26:31 UTC
With my changes reverted, and even with mingw{32,64}-kde-filesystem removed, I get this at the end:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
PULSEAUDIO_INCLUDE_DIR
   used as include directory in directory /data/rpmbuild/BUILD/phonon-4.6.0/phonon
   used as include directory in directory /data/rpmbuild/BUILD/phonon-4.6.0/phonon
PULSEAUDIO_LIBRARY
    linked by target "phonon" in directory /data/rpmbuild/BUILD/phonon-4.6.0/phonon
PULSEAUDIO_MAINLOOP_LIBRARY
    linked by target "phonon" in directory /data/rpmbuild/BUILD/phonon-4.6.0/phonon

Maybe you also need to have glib2-devel, mingw32-glib2, and mingw64-glib2 installed?

Comment 7 Erik van Pienbroek 2013-05-19 16:28:00 UTC
I've already got glib2-devel, mingw32-glib2 and mingw64-glib2 installed.
Perhaps it's because I'm already on f19 (with the mingw packages from rawhide) ?

Comment 8 Steve 2013-05-19 16:40:56 UTC
Evidently so...I just did "koji build --scratch --arch-override=i386 f19 SRPMS/mingw-phonon-4.6.0-6.fc18.src.rpm" and it succeeded.

See http://koji.fedoraproject.org/koji/taskinfo?taskID=5398145 to verify the success.

I just looked at mingw-filesystem-97-3.fc19.src.rpm, and its SOURCES/Toolchain-mingw* don't have a "SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)".

Possible upstream bug fix to cmake, then?  I'm lost.

Comment 9 Steve 2013-05-19 16:53:07 UTC
Argh, now I'm completely lost... "koji build --scratch f18 --arch-override=i386 SRPMS/mingw-phonon-4.6.0-6.fc18.src.rpm" just succeeded!

See http://koji.fedoraproject.org/koji/taskinfo?taskID=5398279 to share in my confusion.

Did I get a bad upgrade with fedup?  I just moved from FC17 to FC18 a few weeks ago.

Yesterday I was having some other odd problems with cmake, and out of desperation, I did "yum reinstall cmake", but it didn't help.

Comment 10 Steve 2013-05-20 22:50:54 UTC
Well, that's just plain icky...I went through all the fun of re-installing my operating system, and this bug simply vanished.  I can build mingw-phonon without any problems now.

I saved my old system partition; once I get the new partition fleshed out, I'll diff them and see if I can spot where the old one went wrong.

I'll close this bug.  Sorry to waste your time.


Note You need to log in before you can comment on or make changes to this bug.