Chocobo1 / qbittorent_msys2

Instructions to compile qBittorrent in MSYS2 environment
9 stars 3 forks source link

Failed to build 32-bit #8

Closed johnnyschneider closed 2 years ago

johnnyschneider commented 3 years ago

linking release/qbittorrent.exe C:/dev/msys/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lIconv::Iconv collect2.exe: error: ld returned 1 exit status make[2]: *** [Makefile.Release:1022: release/qbittorrent.exe] Error 1 make[2]: Leaving directory '/c/Users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src' make[1]: *** [Makefile:45: release] Error 2 make[1]: Leaving directory '/c/Users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src' make: *** [Makefile:50: sub-src-make_first] Error 2 ==> ERROR: A failure occurred in build(). Aborting... made it this far. I have the iconv libraries installed... it's been a while since I've done C/++ development, I'm a little bit lost at how to debug this point. Please help. Thanks!

lmorand commented 3 years ago

This has already been answered here. Have you tried that?

johnnyschneider commented 3 years ago

I had not tried that. I made it farther than last time, but this time it failed to build citing an absence of qmake. However, "qmake -v" returns 3.1 and QT version 5.15.2

lmorand commented 3 years ago

How are you creating the package? You should start an MSYS shell (not MinGW) and use makepkg-mingw (not just makepkg).

johnnyschneider commented 3 years ago

Hmmm. So it turns out it did build, but in a compressed package. No problem there. However, in the build process it ends up trying to rebuild it.... Hard to explain. See the log and comment pretty far down the log. In any event, it does not necessarily fail to build, but the bug was very confusing.

$ makepkg-mingw -f --skippgpcheck --noconfirm --skipinteg --skipchecksums --nocheck --nodeps --noextract --holdver
==> Making package: mingw-w64-qbittorrent-git r10744.d21fdb754-1 (Thu Jan  7 15:21:35 2021)
==> WARNING: Skipping dependency checks.
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
configure: loading site script /etc/config.site
checking for x86_64-w64-mingw32-gcc... x86_64-w64-mingw32-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether x86_64-w64-mingw32-gcc accepts -g... yes
checking for x86_64-w64-mingw32-gcc option to enable C11 features... none needed
checking whether x86_64-w64-mingw32-gcc understands -c and -o together... yes
checking for x86_64-w64-mingw32-g++... x86_64-w64-mingw32-g++
checking whether the compiler supports GNU C++... yes
checking whether x86_64-w64-mingw32-g++ accepts -g... yes
checking for x86_64-w64-mingw32-g++ option to enable C++11 features... none needed
checking for a sed that does not truncate output... /usr/bin/sed
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of x86_64-w64-mingw32-gcc... none
checking dependency style of x86_64-w64-mingw32-g++... none
checking whether OS is FreeBSD... no
checking whether OS is macOS... no
checking for x86_64-w64-mingw32-pkg-config... /mingw64/bin/x86_64-w64-mingw32-pkg-config
checking pkg-config is at least version 0.23... yes
checking whether to enable the Debug build... no
checking whether to enable the stacktrace feature... no
checking whether to enable the GUI... yes
checking whether to install the systemd service file... no
checking whether to enable the WebUI... yes
checking for Qt5 qmake >= 5.9.5... C:/dev/msys/mingw64/bin/qmake
checking for Qt5Svg... yes
checking whether QtDBus should be enabled... yes
checking for Qt5DBus >= 5.9.5... found
checking for boostlib >= 1.65 (106500)... yes
configure: Boost CXXFLAGS: ""
configure: Boost LDFLAGS: ""
checking whether the Boost::System library is available... yes
checking for exit in -lboost_system-mt... yes
configure: Boost.System LIB: "-lboost_system-mt"
checking for libtorrent... yes
checking for openssl... yes
checking for zlib... yes
checking if compiler defaults to C++17 or later mode... no
checking if compiler supports C++17... yes
checking if C++17 is disabled by the set compiler flags... no
configure: WARNING: C++17 mode is now force enabled. The C++ mode should match the mode that other libraries were built with, otherwise you'll likely get linking errors.
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating conf.pri
config.status: executing depfiles commands
configure: Running qmake to generate the makefile...
Reading C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src/src.pro
Project MESSAGE: Project is built in RELEASE mode.
Project MESSAGE: Disabling debug output.
Project MESSAGE: Project is built in RELEASE mode.
Project MESSAGE: Disabling debug output.
Project MESSAGE: Project is built in RELEASE mode.
Project MESSAGE: Disabling debug output.
WARNING: Failure to find: debug/qbittorrent_mingw_res.o

configure: Good, the configure finished.

cd src/ && ( test -e Makefile || C:/dev/msys/mingw64/bin/qmake.exe -o Makefile C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src/src.pro QMAKE_LRELEASE= ) && make -f Makefile
make[1]: Entering directory '/c/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src'
make -f Makefile.Release
make[2]: Entering directory '/c/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src'
make[2]: Nothing to be done for 'first'.
make[2]: Leaving directory '/c/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src'
make[1]: Leaving directory '/c/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src'
==> Starting package()...
cd src/ && ( test -e Makefile || C:/dev/msys/mingw64/bin/qmake.exe -o Makefile C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src/src.pro QMAKE_LRELEASE= ) && make -f Makefile install
make[1]: Entering directory '/c/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src'
make -f Makefile.Release install
make[2]: Entering directory '/c/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src'
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/doc/qbittorrent.1 /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/man/man1/qbittorrent.1
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/org.qbittorrent.qBittorrent.desktop /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/applications/org.qbittorrent.qBittorrent.desktop
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/org.qbittorrent.qBittorrent.appdata.xml /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/metainfo/org.qbittorrent.qBittorrent.appdata.xml
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/16x16/apps/qbittorrent.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/16x16/apps/qbittorrent.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/22x22/apps/qbittorrent.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/22x22/apps/qbittorrent.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/24x24/apps/qbittorrent.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/24x24/apps/qbittorrent.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/32x32/apps/qbittorrent.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/32x32/apps/qbittorrent.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/36x36/apps/qbittorrent.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/36x36/apps/qbittorrent.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/48x48/apps/qbittorrent.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/48x48/apps/qbittorrent.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/64x64/apps/qbittorrent.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/64x64/apps/qbittorrent.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/72x72/apps/qbittorrent.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/72x72/apps/qbittorrent.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/96x96/apps/qbittorrent.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/96x96/apps/qbittorrent.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/128x128/apps/qbittorrent.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/128x128/apps/qbittorrent.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/192x192/apps/qbittorrent.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/192x192/apps/qbittorrent.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/16x16/status/qbittorrent-tray.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/16x16/status/qbittorrent-tray.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/22x22/status/qbittorrent-tray.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/22x22/status/qbittorrent-tray.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/24x24/status/qbittorrent-tray.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/24x24/status/qbittorrent-tray.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/32x32/status/qbittorrent-tray.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/32x32/status/qbittorrent-tray.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/36x36/status/qbittorrent-tray.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/36x36/status/qbittorrent-tray.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/48x48/status/qbittorrent-tray.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/48x48/status/qbittorrent-tray.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/64x64/status/qbittorrent-tray.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/64x64/status/qbittorrent-tray.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/72x72/status/qbittorrent-tray.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/72x72/status/qbittorrent-tray.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/96x96/status/qbittorrent-tray.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/96x96/status/qbittorrent-tray.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/128x128/status/qbittorrent-tray.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/128x128/status/qbittorrent-tray.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/192x192/status/qbittorrent-tray.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/192x192/status/qbittorrent-tray.png
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src/icons/qbittorrent-tray.svg /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/scalable/status/qbittorrent-tray.svg
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/dist/unix/menuicons/128x128/apps/qbittorrent.png /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/pixmaps/qbittorrent.png
cp -f release/qbittorrent.exe /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/bin/qbittorrent.exe
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src/icons/qbittorrent-tray-dark.svg /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/scalable/status/qbittorrent-tray-dark.svg
C:/dev/msys/mingw64/bin/qmake.exe -install qinstall C:/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src/icons/qbittorrent-tray-light.svg /c/users/Johnathan/Documents/Repos/qb2/pkg/mingw-w64-x86_64-qbittorrent-git/mingw64/share/icons/hicolor/scalable/status/qbittorrent-tray-light.svg
make[2]: Leaving directory '/c/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src'
make[1]: Leaving directory '/c/users/Johnathan/Documents/Repos/qb2/src/qbittorrent/src'
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "mingw-w64-x86_64-qbittorrent-git"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Finished making: mingw-w64-qbittorrent-git r10744.d21fdb754-1 (Thu Jan  7 15:22:27 2021) # <----- why does it repeat?
==> Making package: mingw-w64-qbittorrent-git r10744.d21fdb754-1 (Thu Jan  7 15:22:34 2021)
==> WARNING: Skipping dependency checks.
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
configure: loading site script /etc/config.site
checking for i686-w64-mingw32-gcc... i686-w64-mingw32-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether i686-w64-mingw32-gcc accepts -g... yes
checking for i686-w64-mingw32-gcc option to enable C11 features... none needed
checking whether i686-w64-mingw32-gcc understands -c and -o together... yes
checking for i686-w64-mingw32-g++... i686-w64-mingw32-g++
checking whether the compiler supports GNU C++... yes
checking whether i686-w64-mingw32-g++ accepts -g... yes
checking for i686-w64-mingw32-g++ option to enable C++11 features... none needed
checking for a sed that does not truncate output... /usr/bin/sed
checking build system type... i686-w64-mingw32
checking host system type... i686-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of i686-w64-mingw32-gcc... none
checking dependency style of i686-w64-mingw32-g++... none
checking whether OS is FreeBSD... no
checking whether OS is macOS... no
checking for i686-w64-mingw32-pkg-config... /mingw32/bin/i686-w64-mingw32-pkg-config
checking pkg-config is at least version 0.23... yes
checking whether to enable the Debug build... no
checking whether to enable the stacktrace feature... no
checking whether to enable the GUI... yes
checking whether to install the systemd service file... no
checking whether to enable the WebUI... yes
checking for Qt5 qmake >= 5.9.5... not found
configure: error: Could not find qmake
==> ERROR: A failure occurred in build().
    Aborting...
lmorand commented 3 years ago

Well, that is indeed very strange. It does not happen on my end, though, so maybe there is some issue with your installation or something like that. In any case, the package is being built properly now, right?

johnnyschneider commented 3 years ago

Correct, it does indeed build and execute properly (well, as far as I could tell by clicking around in the app for a few seconds).

johnnyschneider commented 3 years ago

Hey, just wanted to follow up - I can successfully reproduce the bug (where it attempts to rebuild after finishing building) in Windows Sandbox. So although it could be a bug in MSYS, it's not a bug in my system specifically. That said, my guess is that it's something that's unintentionally being executed twice in the PKGBUILD file. I don't know very much about PKGBUILD files (or C++ development, beyond the basic syntax. I'm learning on the fly here) but I'll try and get to the bottom of it tomorrow.

johnnyschneider commented 3 years ago

Hey! I figured out the issue. As seen here, https://www.msys2.org/wiki/Creating-Packages/#build-package makepkg-mingw is a wrapper that calls both the 64 bit build and the 32 bit build. So, I have both discovered a bug and discovered some documentation that should be added to the build instructions. Documentation aspect first - the build command needs "MINGW_INSTALLS=mingw64" or "MINGW_INSTALLS=mingw32" for 64 bit and 32 bit builds. So for example, the command I used to build the 64 bit application looks like so "MINGW_INSTALLS=mingw64 makepkg-mingw -f --skippgpcheck --noconfirm --skipinteg --skipchecksums --nocheck --nodeps --noextract --holdver". Also, I have discovered that the 32 bit build process does not work on my end, and is reproducible in Windows Sandbox.

lmorand commented 3 years ago

Ohh I totally forgot that I have that set in my .bash_profile, since I always build for x86_64; my bad.

Also, at what point exactly does it fail when building for 32 bit? If it's the same error as before it may be that you don't have the required dependencies to build with MinGW32 and --nodeps is preventing pacman from installing them before building.

johnnyschneider commented 3 years ago

Same error as before. I'll run without nodeps

johnnyschneider commented 3 years ago

@lmorand Build success! Perhaps I'm just a noob and this isn't really necessary for most people, but do you think we could add documentation suggesting to run it without --nodeps so that users can see the names of the packages that they dont have installed? I would not have known what strings to put into pacman -S without that.

lmorand commented 3 years ago

Actually, the readme file in this repo prompts you to use --syncdeps, which is the opposite of --nodeps, so anyone following those instructions should be fine as long as the PKGBUILD gets updated to deal automatically with the iconv issue you had in the first place. What is not stated there is the use of MINGW_INSTALLS.

I'll open a PR later, but feel free to do it yourself if you prefer.

Chocobo1 commented 2 years ago

CI verified 32-bit is building now.