Skip to content

Adding Qt6 support#3711

Merged
sandman7920 merged 52 commits intosqlitebrowser:masterfrom
sandman7920:qt6_port
Aug 26, 2024
Merged

Adding Qt6 support#3711
sandman7920 merged 52 commits intosqlitebrowser:masterfrom
sandman7920:qt6_port

Conversation

@sandman7920
Copy link
Copy Markdown
Contributor

This PR adds support for Qt6 and a new CMake configuration.
Both Qt 5 and 6 are supported.
The lowest-tested Qt5 version is 5.12.2 on Windows.
Qt5 is enabled by default, to build with Qt6 run cmake with -DQT_MAJOR=Qt6

Windows deployment is more automated:

cmake -GNinja -S d:\sqlitebrowser -B d:\sqlitebrowser_builds\release -DCMAKE_PREFIX_PATH="c:\dev\x64;C:\Qt\5.15.2\msvc2019_64" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=d:\sqlitebrowser_builds\DB.Browser.for.SQLite-x.xx-win64
cmake --build d:\sqlitebrowser_builds\release
cmake --install d:\sqlitebrowser_builds\release

This will build and deploy the project with all dependencies.

Currently, Qt6 depends on Qt6::Core5Compat, in the future, this should be dropped.

sandman7920 and others added 30 commits August 16, 2024 16:15
A more robust method for finding OpenSSL runtime libraries,
now we search with version patterns **MAJOR**, **MAJOR_MINOR**, and **-x64**.
This should help with Qt6 requirements for OpenSSL-3.
@justinclift
Copy link
Copy Markdown
Member

@sandman7920 Uh oh, it looks like you merged without squashing the (many) commits into a single one.

Are you up for fixing the commit history on master, as it's a bit of a mess now. 😉

Note that you're not the first person to do that before, I think we've all done it at one time or another. 😇

@sandman7920 sandman7920 deleted the qt6_port branch August 26, 2024 10:42
@sandman7920
Copy link
Copy Markdown
Contributor Author

@justinclift Sorry, can we do something?

@justinclift
Copy link
Copy Markdown
Member

justinclift commented Aug 26, 2024

Yeah, it'll need to be fixed manually in the master branch.

i.e. do a manual squash of the commits and push the fixed history

Are you ok to do that? If you're a bit unsure, just let me know and I'll get it done. 😄

@sandman7920
Copy link
Copy Markdown
Contributor Author

sandman7920 commented Aug 26, 2024

@justinclift Better you do it, my git/github skills are mediocre at best.

@justinclift
Copy link
Copy Markdown
Member

justinclift commented Aug 26, 2024

No worries, I'll get it done. As as general guide, these are the steps I'll be taking in my local repo:

Make sure my repo is clean and doesn't have leftover stuff from other things

$ git clean -dffx
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

Ensure I have the latest source

$ git pull

Find the last git commit that we want to rewind everything to

$ git log
[do some manual paging]
commit 57f1824df1f02040ceac404a07b29cfbbcb2b45f
Author: Nikolay Zlatev <sandman7920@gmail.com>
Date:   Fri Aug 16 16:15:28 2024 +0300

    Optimize build process with Qt6 in mind.

commit f2203887dff9536148f91613093b0f27bea29f7c
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Aug 13 20:07:07 2024 +0900

    build(deps): bump signpath/github-action-submit-signing-request from 0.4 to 1 (#3704)
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

So, f2203887dff9536148f91613093b0f27bea29f7c is the last commit before the merge-that-wasn't-squashed.

Rewind to that commit

$ git reset f2203887dff9536148f91613093b0f27bea29f7c

The repository should now be at the last commit before the merge, but still have all of your PR changes applied to it.

$ git log
commit f2203887dff9536148f91613093b0f27bea29f7c (HEAD -> master)
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Aug 13 20:07:07 2024 +0900

    build(deps): bump signpath/github-action-submit-signing-request from 0.4 to 1 (#3704)
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

and:

$ git status
On branch master
Your branch is behind 'origin/master' by 59 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   .github/workflows/build-macos.yml
        modified:   .github/workflows/build-windows.yml
[etc]

At this point, I'll use git add and similar to make a single commit from all of your changes, then push it to master using your details as the commit author:

$ git commit --author="Nikolay Zlatev <sandman7920@gmail.com>

Does that make sense? 😄

@justinclift
Copy link
Copy Markdown
Member

Hmm, actually that might not be the right commit to wind back to. I think that would get some earlier ones as well.

Doing some more investigation...

@justinclift
Copy link
Copy Markdown
Member

justinclift commented Aug 26, 2024

Ahhh. Nah, that's the right commit it just has @lucydodo's one to update the currentrelease thrown into the middle of things as well. Should still be workable.

On it now. 😄

@justinclift
Copy link
Copy Markdown
Member

Ok, done. At least, I think I got it right. Lets see if the CI passes, just in case I missed something somehow. 😉

@justinclift
Copy link
Copy Markdown
Member

Hmm, CI is failing so it looks like I missed something. Any ideas what I missed, as I'm not seeing anything obvious?

@sandman7920
Copy link
Copy Markdown
Contributor Author

After the merge, I pushed build/signing code to the master branch.

@sandman7920
Copy link
Copy Markdown
Contributor Author

I will pull and check the diff

@justinclift
Copy link
Copy Markdown
Member

Hmmm, maybe do your pull and check in a separate branch, just to keep a full copy of the repo (before my attempted fix) around somewhere in case we need it?

@justinclift
Copy link
Copy Markdown
Member

justinclift commented Aug 26, 2024

After the merge, I pushed build/signing code to the master branch.

Ugh, I totally forgot about that. So those commits became part of the merged "Adding Qt6 support" squashed patch.

@justinclift
Copy link
Copy Markdown
Member

With the CI errors happening at the moment, the errors are saying:

CMake Error at CMakeLists.txt:11 (include):
  include could not find requested file:

    config/options.cmake

I have those files on my system though:

$ ls -al config/
total 13
drwxr-xr-x  2 jc jc    9 Aug 26 21:12 ./
drwxr-xr-x 13 jc jc   25 Aug 26 21:27 ../
-rw-r--r--  1 jc jc  455 Aug 26 21:12 3dparty.cmake
-rw-r--r--  1 jc jc 2581 Aug 26 21:12 install.cmake
-rw-r--r--  1 jc jc  836 Aug 26 21:12 options.cmake
-rw-r--r--  1 jc jc 1125 Aug 26 21:12 platform_apple.cmake
-rw-r--r--  1 jc jc  603 Aug 26 21:12 platform.cmake
-rw-r--r--  1 jc jc 1802 Aug 26 21:12 platform_win.cmake
-rw-r--r--  1 jc jc 1504 Aug 26 21:12 translations.cmake

@sandman7920
Copy link
Copy Markdown
Contributor Author

Yes, *.cmake is added to the ignore list by default (maybe not to be added by mistake?) and I have added them whit -f

@sandman7920
Copy link
Copy Markdown
Contributor Author

Should I push them back?

@justinclift
Copy link
Copy Markdown
Member

Ahhh. Nah, I'll add them back to the source tree as part of the squashed commit. 1 sec...

@justinclift
Copy link
Copy Markdown
Member

k, just force pushed an updated, squashed Adding Qt6 support commit. Hopefully it's 100% good now. 😄

@justinclift
Copy link
Copy Markdown
Member

k, CI is passing with the new, squashed Adding Qt6 support commit. If you have some time, it's probably a good idea to look it over to make sure there's nothing else I missed. Just in case.

Oh, and your follow up signing commits... well, lets just leave them merged into this one for simplicity. 😁

@sandman7920
Copy link
Copy Markdown
Contributor Author

sandman7920 commented Aug 26, 2024

Everything seems fine.
But the issue with the Windows build not shipping qsvgiconengine plugin remains, I am not familiar with WiX Toolset at all.

@justinclift
Copy link
Copy Markdown
Member

Ahhh. @lucydodo might have some ideas about that then. 😄

@justinclift
Copy link
Copy Markdown
Member

It might just be a matter of us needing to include some additional .dll files in the .xml definition used to build the package.

@sandman7920
Copy link
Copy Markdown
Contributor Author

sandman7920 commented Aug 26, 2024

Yes, it is but in the future, it will be better for WiX Tools to include the directory structure generated by the cmake --install step (not executed at the moment).
cmake install uses windeployqt which inspects the DB4S executable and deploys all necessary runtime libraries.

This also will make Qt5/Qt6 setup much easier.

@sandman7920
Copy link
Copy Markdown
Contributor Author

And there is some live patching done during GitHub actions

@lucydodo
Copy link
Copy Markdown
Member

@sandman7920 May I ask where the qsvgiconengine file you uploaded last time came from?
I configured a Windows VM, and built DB4S, but couldn't find that library file. :(

@sandman7920
Copy link
Copy Markdown
Contributor Author

It should be in QT_DIR / "plugins/iconengines/qsvgicon.dll"

@lucydodo
Copy link
Copy Markdown
Member

Thanks for letting me know, I've changed the code to include that plugin and are testing it now.

@lucydodo
Copy link
Copy Markdown
Member

Resolved via 2c50024, @sandman7920 Thank you for your advice and assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants