Commit Graph

16 Commits

Author SHA1 Message Date
Daniel Henrique Barboza
3252742bab ci/Makefile: get rid of 'make check' references
Update the remaining 'make check' references after the
switch to meson/ninja.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2020-08-17 08:42:47 +02:00
Erik Skultety
4e6e1e2a85 ci: Makefile: Mention CI_MAKE_ARGS and CI_CONFIGURE_ARGS in ci-help
Document the CI_MAKE_ARGS and CI_CONFIGURE_ARGS so that users don't have
to skim through the Makefile to be able to pass arbitrary recognized
make targets to the build system.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-06-18 09:19:21 +02:00
Erik Skultety
32a5083cad ci: Makefile: Fix 'overridde' typo
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2020-06-17 11:47:02 +02:00
Andrea Bolognani
2250a0b56f ci: Update build system integration
The ci-* targets need to know where our container images are stored
and how they are called to work, so now that we use the GitLab
container registry instead of Quay some changes are necessary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-06-11 19:06:53 +02:00
Andrea Bolognani
507724c355 ci: Drop handling of $PKG_CONFIG_LIBDIR
As of libvirt-jenkins-ci commit e41e341f0d8f, we no longer bake
this environment variable into our container images.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-03-04 11:24:10 +01:00
Andrea Bolognani
058b30b382 ci: Fix handling of $PKG_CONFIG_LIBDIR
There are two environment variables that are baked into our
cross-compilation container images at build time, $CONFIGURE_OPTS
and $PKG_CONFIG_LIBDIR: the former contain the options necessary
to convince configure to perform a cross build rather than a
native one, and the latter is necessary so that pkg-config will
locate the .pc files for MinGW libraries. Container images that
are not intended for cross-compilation will not have either one
defined.

The problem is that, while an empty $CONFIGURE_OPTS is completely
harmless, setting $PKG_CONFIG_LIBDIR to an emtpy value will
result in pkg-config not looking in its default search path, thus
not finding any library, and subsequently breaking native builds.

To work around this issue, only pass $PKG_CONFIG_LIBDIR to sudo
when the value is set in the calling environment.

Fixes: 71517ae4db
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-02-24 15:40:55 +01:00
Andrea Bolognani
71517ae4db ci: Make container environment available to scripts
For container images targeted at cross-building, we bake a small
amount of architecture-specific information in the environment so
that builds can work as expected without requiring additional work
from the user; unfortunately this information got lost as soon as
we called sudo. Explicitly allow it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-02-24 13:41:58 +01:00
Andrea Bolognani
3e3cad5238 ci: Fetch list of available container images dynamically
Any static list of images is destined to become outdated eventually,
so let's start generating it dynamically instead.

Unfortunately there doesn't seem to be a straightforward way to get
Podman/Docker to list all repositories under quay.io/libvirt, so we
have to resort to searching and filtering manually; and since the
two tools behave slightly differently in that regard, it's more
sane to have the logic in a separate shell script than it would be
to keep it inline in the Makefile with all the annoying escaping
doing so would entail.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2020-01-06 16:43:46 +01:00
Andrea Bolognani
e672f827d9 ci: Stop using --workdir
Now that we're using sudo, the initial work directory is no
longer relevant since the user will find themselves in their
home directory when they get control anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-08-21 18:58:34 +02:00
Andrea Bolognani
4c39e54ca9 ci: Run $(CI_PREPARE_SCRIPT) as root
In order for the prepare script to be really useful, it needs
to be able to perform privileged operations such as installing
additional packages or setting up custom mount points.

In order to achieve that, we now run the container as root,
run the prepare script with full privilege, and only then
switch to the unprivileged account with sudo.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-08-21 18:58:31 +02:00
Andrea Bolognani
2ce3274ea5 ci: Introduce $(CI_PREPARE_SCRIPT)
This script is run before $(CI_BUILD_SCRIPT) and can be used
to tweak the environment as necessary before the build starts.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-08-21 18:58:27 +02:00
Andrea Bolognani
82c311013a ci: Generalize running commands inside the container
Both for ci-build and ci-shell we want to execute basically
the same setup and cleanup logic, the only difference being
that for the former we then run the build script and with the
latter a shell.

Rework the targets so that they both call the generic
ci-run-command rule passing an appropriate $(CI_COMMAND).

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-08-21 18:58:25 +02:00
Andrea Bolognani
0d1aecdd6a ci: Introduce $(CI_BUILD_SCRIPT)
Instead of hardcoding build instructions into the Makefile,
move them to a separate script that's mounted into the
container.

This gives us a couple of advantages: we no longer have to
deal with the awkward quoting required when embedding shell
code in a Makefile, and we also provide the users with a way
to override the default build instructions with their own.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-08-21 18:58:22 +02:00
Andrea Bolognani
a79ae3b9a9 ci: Move source directory under $(CI_USER_HOME)
Now that we have a home directory for the user, storing the
source there rather than in a custom top-level directory is
the obvious choice.

Later on we're also going to add some more files related to
builds, and storing everything in the user's home directory
will keep things nice and tidy.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-08-21 18:58:19 +02:00
Andrea Bolognani
e14bfc97b7 ci: Create user's home directory in the container
Some applications expect the user's home directory to be
present on the system and require workarounds when that's not
the case. Creating the home directory along with everything
else is easy enough for us, so let's just do that.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-08-21 18:58:16 +02:00
Andrea Bolognani
ffad19f94c ci: Move everything to a separate directory
We're going to have a few more CI-related files in a second, and
it makes sense to have a separate directory for them rather than
littering the root directory.

$(CI_SCRATCHDIR) can now also be created inside the CI directory,
and as a bonus the make rune necessary to start CI builds without
running configure first becomes shorter.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-08-21 18:58:13 +02:00