[Qbs] setup-android, no --system?

Christian Gagneraud chgans at gmail.com
Fri May 15 15:23:12 CEST 2020


On Sat, 16 May 2020 at 00:49, Richard Weickelt <richard at weickelt.de> wrote:
> > Because this file will end up in some "home" directory, which might
> > not be accessible to the end user (eg. custom UID, GID, home, ...)
> > Having a system wide qbs conf is bullet-proof in that regard.
> > So, yes i would prefer to run the above command, but with '--system'
> > and no, you cannot simply move the generated user's conf into
> > /etc/xdg/qbs, they don't use the same 'ini' namespace
>
> Until we are able to run the Docker daemon as non-root user, I am using this
> approach:
>
> 1. set up a user XXX and use whatever uid/gid you like (e.g. 1000).
>
> https://code.qt.io/cgit/qbs/qbs.git/tree/docker/bionic/test-android.Dockerfile
>
> 2. enable password-less sudo for this user
> 3. switch to that user before running qbs config to set up the profiles
> 4. Running the container, mount the current folder as the working dir
> 3. add an entrypoint script that looks at the uid/gid of the
>    working dir and adjust the uid/gid of XXX in the container
>    to match it.
>    https://code.qt.io/cgit/qbs/qbs.git/tree/docker/bionic/entrypoint.sh
>
> 5. Run the container with docker-compose which cuts the Docker command line
> down to:
>       docker-compose run --rm IMAGESERVICENAME qbs build ...
>
>    https://code.qt.io/cgit/qbs/qbs.git/tree/docker-compose.yml
>    Docker-compose mounts the current directory and does additional stuff
>    for you. I always have a docker-compose.yml in projects where
>    the build environment is in a Docker container.
>
> You can see it in action here:
> https://code.qt.io/cgit/qbs/qbs.git/tree/.travis.yml#n75

Hi Richard,

Thanks for the detailed explanation, i've been looking at your scripts
and docker files recently (and have adopted your install-qt.sh! ;))
I think we don't have the same use case, you need to build and test
qbs, i need to build and test a android+qt+qbs container that works
"out of the box" whichever way it is used (CI or developers).
Basically my ultimate test is: build and sign an hello world APK with
this android+qt+qbs container, that depends on all the Qt modules i
want to be available to developers.
My goal is: just run "qbs build" in the right container and you'll get
a signed APK.

I was just surprised that --system is supported by all qbs
setup/config tools but qbs-setup-android. I don't see any compelling
reason for that, do you?
Maybe it was simply never needed, hence never implemented.

As a side note, i don't install Android the same way. I use what i
believe is the new approach: install commandline-tools first, and run
sdk manager with a package requirement file, here is mine right now:
build-tools;28.0.3
ndk;21.0.6113669
patcher;v4
platform-tools
platforms;android-28

Chris

Digression: I wish Qbs was in the list of tools i can install with
install-qt.sh ...


More information about the Qbs mailing list