[Development] How to perform unattended installations of Qt? (Was: Changes to Qt offering)

Konstantin Tokarev annulen at yandex.ru
Sat Oct 3 23:07:07 CEST 2020



03.10.2020, 20:26, "Croitor Alexandru" <placinta at gmail.com>:
> Hi all,
>
> I spent a bit of time trying to get a project of mine to build in Github Actions with a Qt installed via the new online installer.
>
> I used Volker's script as a base, modified it a bit, and created a github workflow that installs Qt 5.15.1 essentials package.
> The workflow then builds a qmake app project and publishes a macdeploy'ed archive as a Github artifact.
>
> I also got some inspiration from qt-creator's and Cristian's ccache GA workflows.
> So credit goes to Volker, Cristian, and anyone that worked on the creator workflow.
>
> Here's the gist of what I have so far: https://gist.github.com/alcroito/549d47b4d961936a24a518aaada685f3
>
> To make the online installer work in the CI setting, i first downloaded it locally and logged in with my account,
> extracted the created JWT token from ~/Library/Application\ Support/Qt/qtaccount.ini
> and saved it as a secret that's set as an environment variable in the CI.
>
> Not sure for how long the token is valid though.
>
> The workflow in the linked gist also uses GA's caching action, to cache the installed Qt (so as not to hammer Qt's mirrors).
> It also reduces the overall Qt installation time:
>
>               initial install time    restore from cache    cache size
> Linux        2m 58s                  35s                           695MB
> Windows   4m 27s                 1m 5s                       783MB
> macOS      3m38s                  22s                           590MB

For comparison, using simple python script from [1] (which was mentioned on the list a few times before)
results in my workflow [2] in 56 seconds on Windows [3] and 20 seconds on macOS with
*NO CACHE* and *NO CREDENTIALS*. Time is saved because only used Qt modules are installed,
online installer doesn't provide this kind of granularity.

[1] https://github.com/engnr/qt-downloader
[2] https://github.com/qtwebkit/qtwebkit/blob/qtwebkit-dev-wip/.github/workflows/build_cmake.yml#L84
https://github.com/qtwebkit/qtwebkit/blob/qtwebkit-dev-wip/.github/workflows/build_cmake.yml#L100
[3] https://github.com/qtwebkit/qtwebkit/runs/1195504225?check_suite_focus=true
[4] https://github.com/qtwebkit/qtwebkit/runs/1195504192?check_suite_focus=true


>
> Hope the gist proves useful to someone.
>
> I'm pondering continuing work on the installer script as well as the build_with_qmake script, and perhaps package them as GA actions
> if it's feasible and useful.
>
> On Wed, Sep 16, 2020 at 5:25 PM Volker Hilsheimer <volker.hilsheimer at qt.io> wrote:
>>> On 16 Sep 2020, at 17:05, Thiago Macieira <thiago.macieira at intel.com> wrote:
>>>
>>> On Wednesday, 16 September 2020 03:39:58 PDT Volker Hilsheimer wrote:
>>>> I’ve recently been doing a bit of work to automate the testing of the online
>>>> installer and the Qt packages through minicoin [1] recently; check
>>>>
>>>> https://git.qt.io/vohilshe/minicoin/-/tree/master/minicoin/jobs/install-onli
>>>> ne
>>>>
>>>> for a cmake script that downloads the Qt Online installer and installs the
>>>> latest Qt 6 snapshot, on any host platform Qt supports.
>>>>
>>>> I’m running things regularly on local and cloud-hosted VMs running
>>>> Windows10, macOS, and Ubuntu. FWIW, the xdotool stuff is only needed
>>>> because I also want to run some basic tests that require a user session.
>>>
>>> Thanks, Volker
>>>
>>> The script is very understandable. When I have the time, I'll take a look at
>>> setting up a GitHub Action for installing Qt on their Linux and Mac hosts. I
>>> really need to get away from Travis, since that is taking 2-3 days to test a
>>> pull request.
>>>
>>> One question: the downloads are currently anonymous. I understood from earlier
>>> in this thread that would not remain the case. Did I misunderstand or is that
>>> still a change to come?
>>>
>>> --
>>> Thiago Macieira - thiago.macieira (AT) intel.com
>>>  Software Architect - Intel DPG Cloud Engineering
>>
>> The download in the cmake script (and thanks to Christian Adam for some of the ideas to it) just pulls down the online installer.
>>
>> The online installer then downloads the actual packages, and expects your qtaccount.ini file to have the credentials and license information.
>>
>> The other scripts take care of that, and are part of how jobs are designed in minicoin: the pre-run script runs on the host, takes your local qtaccount.ini file, and puts it into the job; minicoin uploads the entire job directory ot the VM; the “main” scripts then run on the guest, and put them where the installer expects them.
>>
>> Cheers,
>> Volker
>>
>> _______________________________________________
>> Development mailing list
>> Development at qt-project.org
>> https://lists.qt-project.org/listinfo/development
> ,
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development


-- 
Regards,
Konstantin


More information about the Development mailing list