Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build 1.10.0 #3613

Closed
jubalh opened this issue Mar 11, 2023 · 17 comments
Closed

Unable to build 1.10.0 #3613

jubalh opened this issue Mar 11, 2023 · 17 comments
Labels
bug Broken behavior.

Comments

@jubalh
Copy link
Contributor

jubalh commented Mar 11, 2023

I fail to build the latest 1.10.0 release with Qt6.

Note:
The readme still lists Qt5 deps only. Are the build instructions up to date? The release notes sound like Qt6 should be default now.

You can see my build recipe here: https://build.opensuse.org/package/view_file/games:tools/tiled/tiled.spec?expand=1
And the result here: https://build.opensuse.org/package/live_build_log/games:tools/tiled/openSUSE_Tumbleweed/x86_64

I get a various errors like:

[   74s] + qbs setup-toolchains --detect
[   74s] Trying to detect gcc...
[   74s] Profile 'x86_64-suse-linux-gcc-12' created for '/usr/bin/x86_64-suse-linux-gcc-12'.
[   74s] Trying to detect clang...
[   74s] No clang toolchains found.
[   74s] Trying to detect IAR toolchains...
[   74s] No IAR toolchains found.
[   74s] Trying to detect KEIL toolchains...
[   74s] No KEIL toolchains found.
[   74s] Trying to detect SDCC toolchains...
[   74s] No SDCC toolchains found.
[   74s] Trying to detect COSMIC toolchains...
[   74s] No COSMIC toolchains found.
[   74s] Trying to detect DMC toolchains...
[   74s] No DMC toolchains found.
[   74s] Trying to detect WATCOM toolchains...
[   74s] No WATCOM toolchains found.
[   74s] Making profile 'x86_64-suse-linux-gcc-12' the default.
[   74s] + qbs qbs.installPrefix:/usr projects.Tiled.useRPaths:false
[   74s] Build graph does not yet exist for configuration 'default'. Starting from scratch.
[   74s] Resolving project for configuration default
[   75s] Detecting Qt installations...
[   75s] WARNING: Could not find any qmake executables in PATH. Either make sure a qmake executable is present in PATH or set the moduleProviders.Qt.qmakeFilePaths property to point a qmake executable.
[   75s] ERROR: /home/abuild/rpmbuild/BUILD/tiled-1.10.0/dist/distribute.qbs:10:1 Error while handling product 'distribute':
[   75s] /home/abuild/rpmbuild/BUILD/tiled-1.10.0/dist/distribute.qbs:16:5 Dependency 'Qt.core' not found for product 'distribute'.
[   75s] /home/abuild/rpmbuild/BUILD/tiled-1.10.0/src/karchive/karchive.qbs:3:1 Error while handling product 'karchive':
[   75s] /home/abuild/rpmbuild/BUILD/tiled-1.10.0/src/karchive/karchive.qbs:7:5 Dependency 'Qt.core' not found for product 'karchive'.

Even though qt6-core-devel >= 6.4.2 is required in the spec file.
Any hints would be welcome.

@jubalh jubalh added the bug Broken behavior. label Mar 11, 2023
@bjorn
Copy link
Member

bjorn commented Mar 11, 2023

The readme still lists Qt5 deps only. Are the build instructions up to date? The release notes sound like Qt6 should be default now.

There is no default Qt, it just picks whatever is in your path or Qbs profile. The release notes meant the binaries I'm releasing have been updated to Qt 6. But Tiled should still compile fine against Qt 5.12 or higher as well.

Regarding the error, it says "WARNING: Could not find any qmake executables in PATH". Could you check whether there is a qmake in the PATH? If there isn't, then either the package providing qmake needs to be installed, or you might try to use qbs setup-qt <path to qmake> <profile name> and then build Tiled with that profile.

@jubalh
Copy link
Contributor Author

jubalh commented Mar 14, 2023

WARNING: Could not find any qmake executables in PATH

Ah I did this locally already but forgot to push. But even with qmake present it still doesn't build due to the other errors.
I updated the build in the build system so you can see it at:
https://build.opensuse.org/package/live_build_log/games:tools/tiled/openSUSE_Tumbleweed/x86_64

It's those [ 19s] /home/abuild/rpmbuild/BUILD/tiled-1.10.0/src/libtiled/libtiled.qbs:194:9 Dependency 'Qt.gui' not found for product 'test_staggeredrenderer'. etc things.

Might be that I need to use Qt5 libs? Because it looks now its kind of some mix with qmake-qt5? I'm no Qt expert..

@bjorn
Copy link
Member

bjorn commented Mar 14, 2023

It's those [ 19s] /home/abuild/rpmbuild/BUILD/tiled-1.10.0/src/libtiled/libtiled.qbs:194:9 Dependency 'Qt.gui' not found for product 'test_staggeredrenderer'. etc things.

The problem starts earlier, it's that one:

WARNING: Error setting up Qt for '/usr/lib64/qt5/bin/qmake': Error: Unable to open file '/usr/include/qt5/QtGui/qtgui-config.h': No such file or directory

According to your list of dependencies, you're trying to compile Tiled against Qt 6, but in the PATH there is a Qt 5 qmake. Maybe it is because of the BuildRequires: libqt5-qtbase-common-devel in the spec?

It could be that the Qt 6 qmake has a different name. In that case, you may need to run the qbs setup-qt <path to qmake> <profile name> command explicitly, followed by qbs config defaultProfile <profile name>, before compiling Tiled.

@jubalh
Copy link
Contributor Author

jubalh commented Mar 14, 2023

According to your list of dependencies, you're trying to compile Tiled against Qt 6, but in the PATH there is a Qt 5 qmake. Maybe it is because of the BuildRequires: libqt5-qtbase-common-devel in the spec?

Yes, this is what I meant above with mixing. For some reason I can't find a qmake binary and neither a qmake-qt6 binary in no package. I can only find the qmake-qt5 binary in libqt5-qtbase-common-devel.

I wasn't yet able to find somebody who explain to me why we don't have a qmake-qt6 in our repos. But I'm no Qt expert so I figured maybe qmake-qt5 can handle both qt5 and qt6.

Seems like the best would be if I drop the Qt6 dependencies and go back to Qt5 and then can use the qmake-qt5.

@jubalh
Copy link
Contributor Author

jubalh commented Mar 14, 2023

Aha, I have the right dependency already added qt6-base-common-devel but the binary name is now qmake6 and it seems like it doesn't detect that automatically.

@jubalh
Copy link
Contributor Author

jubalh commented Mar 14, 2023

[    5s] + cd tiled-1.10.0
[    5s] + qbs setup-toolchains --detect
[    5s] Trying to detect gcc...
[    5s] Profile 'x86_64-suse-linux-gcc-12' created for '/usr/bin/x86_64-suse-linux-gcc-12'.
[    5s] Trying to detect clang...
[    5s] No clang toolchains found.
[    5s] Trying to detect IAR toolchains...
[    5s] No IAR toolchains found.
[    5s] Trying to detect KEIL toolchains...
[    5s] No KEIL toolchains found.
[    5s] Trying to detect SDCC toolchains...
[    5s] No SDCC toolchains found.
[    5s] Trying to detect COSMIC toolchains...
[    5s] No COSMIC toolchains found.
[    5s] Trying to detect DMC toolchains...
[    5s] No DMC toolchains found.
[    5s] Trying to detect WATCOM toolchains...
[    5s] No WATCOM toolchains found.
[    5s] + qbs setup-qt /usr/bin/qmake6 defprof
[    5s] Creating profile 'defprof'.
[    5s] Setting profile 'x86_64-suse-linux-gcc-12' as the base profile for this profile.
[    5s] + qbs config defaultProfile defprof
[    5s] + qbs qbs.installPrefix:/usr projects.Tiled.useRPaths:false
[    5s] Build graph does not yet exist for configuration 'default'. Starting from scratch.
[    5s] Resolving project for configuration default
[    5s] Setting up Qt at '/usr/bin/qmake6'...
[    5s] Qt was set up successfully.
[    6s] ERROR: /home/abuild/rpmbuild/BUILD/tiled-1.10.0/dist/distribute.qbs:10:1 Error while handling product 'distribute':
[    6s] /usr/share/qbs/imports/qbs/Probes/GccProbe.qbs:56:16 Error: Error running '/usr/bin/x86_64-suse-linux-g++': execve: No such file or directory
[    6s] /home/abuild/rpmbuild/BUILD/tiled-1.10.0/src/karchive/karchive.qbs:3:1 Error while handling product 'karchive':
[    6s] /usr/share/qbs/imports/qbs/Probes/GccProbe.qbs:56:16 Error: Error running '/usr/bin/x86_64-suse-linux-g++': execve: No such file or directory
[    6s] /home/abuild/rpmbuild/BUILD/tiled-1.10.0/src/libtiled/libtiled.qbs:4:1 Error while handling product 'libtiled':
[    6s] /usr/share/qbs/imports/qbs/Probes/GccProbe.qbs:56:16 Error: Error running '/usr/bin/x86_64-suse-linux-g++': execve: No such file or directory
[    6s] /home/abuild/rpmbuild/BUILD/tiled-1.10.0/src/libtiledquick/libtiledquick.qbs:3:1 Error while handling product 'libtiledquick':

at https://build.opensuse.org/package/live_build_log/games:tools/tiled/openSUSE_Tumbleweed/x86_64

@bjorn
Copy link
Member

bjorn commented Mar 14, 2023

Could it be that you're somehow missing a C++ compiler? It seems it may only have found a C compiler.

Edit: Not likely, judging by the line [ 20s] [311/438] cumulate gcc-c++-12-2.4. You may need to explicitly set up the toolchain as well, since it seems auto-detection failed to set it up correctly.

Maybe try:

qbs setup-toolchains <compiler path> gcc

Using the expected path to the g++ executable, before the qbs setup-qt command.

@Vogtinator
Copy link

I guess for some reason qbs detects and tries to use x86_64-suse-linux-gcc-12 instead of gcc-12. There is no x86_64-suse-linux-g++-12, but there is g++-12.

@bjorn
Copy link
Member

bjorn commented Mar 14, 2023

Right, in that case running qbs setup-toolchains g++-12 gcc instead of qbs setup-toolchains --detect should do the trick.

@jubalh
Copy link
Contributor Author

jubalh commented Mar 14, 2023

Thanks guys, that was it.

@jubalh jubalh closed this as completed Mar 14, 2023
@bjorn
Copy link
Member

bjorn commented Mar 14, 2023

@jubalh That's great! And thank you for maintaining the openSUSE Tiled package! :-)

@jubalh
Copy link
Contributor Author

jubalh commented Mar 15, 2023

@bjorn is there a specific thing I need to pass to qbs to install libtiled.so etc into a certain dir? It places them in /usr/lib but we need /usr/lib64 or /usr/libexec (depending).

@bjorn
Copy link
Member

bjorn commented Mar 15, 2023

@jubalh The install path for libtiled is set up here:

qbs.installDir: {
if (qbs.targetOS.contains("windows"))
if (project.windowsLayout)
return ""
else
return "bin"
else
return "lib"
}

So, at the moment there is unfortunately no option to have it install to lib64. I also could not find any way to override this property from the command-line (for example, I'd have expected products.libtiled.qbs.installDir:lib64 to have worked, but in my tests that didn't work, possibly because this property is only set within a specific Group).

So for packaging Tiled 1.10, I think your only option is to patch up the relevant parts of the Qbs files. For future releases, I can add appropriate options to the top-level project for convenience. Just let me know exactly what options you need.

@jubalh
Copy link
Contributor Author

jubalh commented Mar 15, 2023

I used:

Index: tiled-1.10.0/src/libtiled/libtiled.qbs
===================================================================
--- tiled-1.10.0.orig/src/libtiled/libtiled.qbs
+++ tiled-1.10.0/src/libtiled/libtiled.qbs
@@ -209,7 +209,7 @@ DynamicLibrary {
                 else
                     return "bin"
             else
-                return "lib"
+                return "lib64"
         }
         fileTagsFilter: "dynamiclibrary"
     }

Which placed the one lib into /usr/lib64/libtiled.so. The other still in /usr/lib/libtilededitor.so though. The plugin libs are in /usr/lib/tiled.

@bjorn
Copy link
Member

bjorn commented Mar 15, 2023

The other still in /usr/lib/libtilededitor.so though.

For that one you'd need to patch up this part:

qbs.installDir: {
if (qbs.targetOS.contains("windows"))
if (project.windowsLayout)
return ""
else
return "bin"
else
return "lib"
}

The plugin libs are in /usr/lib/tiled.

That would require patching up this part:

qbs.installDir: {
if (project.windowsLayout)
return "plugins/tiled"
else if (qbs.targetOS.contains("macos"))
return "Tiled.app/Contents/PlugIns"
else
return "lib/tiled/plugins"
}

@jubalh
Copy link
Contributor Author

jubalh commented Mar 15, 2023

Thanks!
Depending on architecture libtiled.so and libtiled.so, are in /usr/lib or /usr/lib64 now. Plugins are in /usr/lib/tiled/plugins/ or /usr/lib64/tiled/plugins.
Spec file and patch are at https://build.opensuse.org/package/show/games:tools/tiled

bjorn added a commit that referenced this issue Mar 16, 2023
Since Qbs 1.13, Application and DynamicLibrary items have convenient
"install" and "installDir" properties.

Added products.Tiled.libDir option, which can be used to change the
directory libraries are installed to. This is useful for openSUSE packaging (and possibly Fedora), which like to put 64-bit libraries in a lib64 directory (see issue #3613).
bjorn added a commit that referenced this issue Mar 16, 2023
Since Qbs 1.13, Application and DynamicLibrary items have convenient
"install" and "installDir" properties.

Added projects.Tiled.libDir option, which can be used to change the
directory libraries are installed to. This is useful for openSUSE
packaging (and possibly Fedora), which like to put 64-bit libraries in a
lib64 directory (see issue #3613).
@bjorn
Copy link
Member

bjorn commented Mar 16, 2023

I noticed the Fedora package is using the following hack, btw:

mkdir -p %{buildroot}%{_libdir}
[ "%{buildroot}%{_prefix}/lib" = "%{buildroot}%{_libdir}" ] || mv -v %{buildroot}%{_prefix}/lib/* %{buildroot}%{_libdir}

(edit: which needs to be combined with their patch, to make sure Tiled still finds its plug-ins)

However, I have now also just finished adding an option which can be used like projects.Tiled.libDir:lib64, to change the lib dir without needing patches or hacks: 46c4474

bjorn added a commit that referenced this issue Mar 16, 2023
Since Qbs 1.13, Application and DynamicLibrary items have convenient
"install" and "installDir" properties.

Added projects.Tiled.libDir option, which can be used to change the
directory libraries are installed to. This is useful for openSUSE
packaging (and possibly Fedora), which like to put 64-bit libraries in a
lib64 directory (see issue #3613).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken behavior.
Projects
None yet
Development

No branches or pull requests

3 participants