[Development] Tips needed on doing cross-platform building/testing

John Layt jlayt at kde.org
Fri Sep 27 17:05:16 CEST 2013


On 27 September 2013 15:37, Mitch Curtis <mitch.curtis at digia.com> wrote:
> On 09/27/2013 01:57 PM, Mandeep Sandhu wrote:
>> Hi All,
>>
>> I'm a Linux (Ubuntu) user. I've recently made some changes for a bug
>> report and wanted to test them on Windows as well.
>>
>> For that I've installed Windows (I've installed 7, do I need to test on
>> other versions as well?) inside VirtualBox.
>>
>> Now I was thinking what was the easiest way to get my Qt repo inside
>> that VM instance. There are 2 ways I thought of:
>>
>> * Share the git repo on my Linux host with the VM
>> * Push my changes to my Gerrit remote and then clone from there inside
>> the VM.
>>
>> The first option seems to be the simplest. However, can I build the Qt
>> sources (using developer mode) in the same dir as where my host (Linux)
>> build is? With developer build there's no 'install' dir that's created
>> and the built libs/bins are present in the root dir only (qtbase).
>>
>> I'm sure people here already have setups for handling this scenario, so
>> whats the preferred way for doing this?
>>
>> Thanks,
>> -mandeep
>
> I'd just push the patch to gerrit as work in progress (with a WIP prefix
> in the commit message) and clone any relevant repos on the VM, then use
> the checkout feature of gerrit to checkout the patch. Ideally you should
> test your changes on the supported platforms [1], but it's expected that
> there may be problems when trying to integrate patches on platforms that
> you don't have access to; but that's what CI is for.

If by share with the VM you mean via a shared folder, I wouldn't
recommend it, Qt uses in-tree builds so you'd be forever having to
"git clean -dfx" and rebuild from scratch every time you switched
OS's, and believe me given how slow Git and Qt is building in a
Window's VM then you don't want to do that often.

If you only make occasional patches, then pushing to Gerrit as a WIP
is a good approach.  I use a clone of qtbase on Gitorious though as I
push lots of experimental branches to lots of different places and
don't want to crowd my Gerrit Dashboard.

What platforms to test on very much depends on what you are changing.
If it's not platform specific, you should be fine with only building
it on Linux and letting CI check the rest of the platforms for you, or
just checking Win7/vc2010 to be safe.  If it is platform specific code
though, i.e. with ifdefs for Win and Mac, then you really should try
to build on those platforms, otherwise CI could be a long and painful
process and people will get annoyed at the failed builds and repeated
reviews.  If you really can't test your platform-specific code, then
add the platform maintainer or approver to the WIP Gerrit change and
request that they build it for you, just don't do it too often :-)

Testing on Windows I find particularly annoying as depending on what
I've changed I often need to test with vc2010 and Mingw compilers, and
for Win7 and WinXP, and need to check that any Win32 api used is also
available on WinCE.  Ideally on Mac I'd test both 10.6 and 10.8, and
check for iOS api usage as well, but I usually only do 10.8.  For now
I don't worry about WinRT or Android or QNX, leaving to CI catch any
problems there, or contacting the maintainer as necessary.

Cheers!

John.



More information about the Development mailing list