[Qt-creator] QT Creator with chroots or dockers

Benjamin Zeller benjamin.zeller at canonical.com
Tue Jan 13 12:44:22 CET 2015


Hi Ray,

we are using the approach Tobias suggested for qmake based chroot builds.
We have a chroot wrapper script, that maps all paths printed to stdout and
stderr to "outside" of the chroot.
This script handles invoking qmake, make and gcc (for the toolchain 
detection part).

The Kit using those wrapped tools needs to set the sysroot path to the 
chroot
so QtCreator thinks its using a sysroot toolchain.

It works fine, the only drawback is, there is a performance overhead
when starting QtC or opening the options dialog, which grows for every Kit
invoking a wrapped qmake.

http://bazaar.launchpad.net/~ubuntu-sdk-team/qtcreator-plugin-ubuntu/trunk/view/head:/share/qtcreator/ubuntu/scripts/qtc_chroot_wrapper.py

The script is part of the Ubunu-SDK but it should give you a idea on how 
it works.

Best regards

Benjamin Zeller

Am 13.01.2015 um 12:08 schrieb Tobias Hunger:
> Hi Ray,
>
> Yes, I am one of the people working on the build infrastructure, but
> actually Daniel is the maintainer of that area (see
> https://qt-project.org/wiki/Maintainers).
>
>
> There is (at least) one flavors of Qt Creator that support building in
> a VM (sailfish OS SDK) and ubuntu seems to be working on building in
> chroots or something (ubuntu touch SDK). Unfortunately the contact to
> those projects is sporadic at best (at least at this time) and I do not
> know what these projects are up to in detail. Maybe they even have
> changed their approach completely in the meantime. There might also be
> more Qt Creator flavors doing similar things that I do not know about.
>
> So while this apparently is possible, we do not have any infrastructure
> in Qt Creator to help with handling chroots. Adding it would require
> some involved changes, since we would need to consistently map
> information from "in chroot paths" to "out-of-chroot paths" in a
> reliable way. This is necessary for e.g. the code model to find the
> right headers, etc. Obviously such a change also needs intense testing
> as the code paths touched are used by all existing platforms we have.
>
> Docker might be even more challenging. Don't you need to set the
> command the container runs in the container configuration? So can you
> even use the same container to build, debug and run your code? Getting
> access to files in the container will also be interesting: There are
> several on disk formats for containers. The filesystem image being set
> up in layers that overlay each other does not make this any easier.
>
> Maybe the easiest approach to support docker would be to require
> ssh/gdbserver running in the docker image and use the existing remote
> desktop machinery for the run/debug part. That way we would only need
> to support "remote build" via SSH in addition to what we already have.
> But then I admit I have not thought about docker support much yet.
>
>
> If you need chroot support fast, then one hackish approach is to
> provide wrapper scripts around make/qmake/etc. that do the path name
> mapping *outside* creator. That can get you some way. I did that for a
> while, but nowadays I just install Qt Creator into the chroots and
> build "locally" in those chroots. That works well for me: I work on Qt
> Creator, so I need all the Qt Creator dependencies inside the chroot
> anyway. Unfortunately it also requires me to switch Creators whenever I
> switch chroots, but so far I did not have to switch often: Almost all
> the bugs that I had to reproduce on Linux have been distribution
> agnostic:-)
>
>
> This is a feature I would love to work on, but unfortunately I do not
> expect to find the time for this anytime soon.
>
> Best Regards,
> Tobias
>
> --
> Tobias Hunger, Senior Software Engineer | The Qt Company
>
> Digia Germany GmbH, Rudower Chaussee 13, D-12489 Berlin
> Geschäftsführer: Mika Pälsi, Juha Varelius, Tuula Haataja Sitz der
> Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB
> 144331 B
>
> Email: tobias.hunger at theqtcompany.com | Phone: +49 30 63 92 3255
> www.qt.io | Qt Blog: http://blog.qt.digia.com/ | Twitter: @QtbyDigia,
> @Qtproject | Facebook: www.facebook.com/qt
>
> On Mo, Jan 12, 2015 at 11:36 , Scheufler Ray M
> <ScheuflerRayM at JohnDeere.com> wrote:
>> I am working on setting up a development environment for cross
>> compilation and I want to use chroot or docker to isolate my cross
>> libraries.  I have seen mentions of doing this on the qt forums but I
>> can’t find any documentation on how to do this.  I am able to
>> manage my environments outside of the IDE but I much prefer having an
>> IDE to aid development.
>>
>> It appears that Tobias Hunger is doing this so I was hoping for a
>> nudge in the correct direction.
>>
>> I would like to be able to run QT Creator in the host and delegate
>> all actions to a docker container.
>>
>> http://qt-project.org/forums/viewthread/33751
>> http://qt-project.org/forums/viewthread/832
>>
>>
>> Ray Scheufler
>>
>>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator




More information about the Qt-creator mailing list