Martin Kletzander
2021-Sep-22 12:09 UTC
[Libguestfs] [libnbd PATCH 0/3] CI and configure fixes for cross-builds
Pipeline is green here: https://gitlab.com/nertpinx/libnbd/-/pipelines/375185133 although the patches it is built from are not cleaned up. However the tree is identical. Martin Kletzander (3): ci: Simplify and fix .gitlab.yml ci: Fix build script configure: Do not misuse enable_ocaml configure.ac | 5 +++-- .gitlab-ci.yml | 43 ++++++++++++++++++++----------------------- ci/build.sh | 5 +++-- 3 files changed, 26 insertions(+), 27 deletions(-) -- 2.33.0
Martin Kletzander
2021-Sep-22 12:09 UTC
[Libguestfs] [libnbd PATCH 1/3] ci: Simplify and fix .gitlab.yml
No need for .native_build_job, that is decided with the env var CROSS which is
set when running the container. And cross builds should use the proper image
name.
Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
.gitlab-ci.yml | 43 ++++++++++++++++++++-----------------------
1 file changed, 20 insertions(+), 23 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a90c25956ca4..8976015b1e20 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -36,6 +36,7 @@ stages:
.base_build_job:
stage: builds
+ image: $CI_REGISTRY_IMAGE/$NAME:latest
cache:
paths:
- ccache/
@@ -51,10 +52,6 @@ stages:
public: true
when: always
-.native_build_job:
- extends: .base_build_job
- image: $CI_REGISTRY_IMAGE/$NAME:latest
-
# Jobs that we delegate to Cirrus CI because they require an operating
# system other than Linux. These jobs will only run if the required
# setup has been performed on the GitLab account (see ci/README.rst).
@@ -175,59 +172,59 @@ x64-ubuntu-2004-container:
# Cross-compilation build jobs
i686-debian-10:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- i686-debian-10-container
variables:
- NAME: debian-10
+ NAME: debian-10-cross-i686
CROSS: i686
i686-debian-11:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- i686-debian-11-container
variables:
- NAME: debian-11
+ NAME: debian-11-cross-i686
CROSS: i686
# Native architecture build + test jobs
x64-debian-11:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-debian-11-container
variables:
NAME: debian-11
x64-debian-sid:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-debian-sid-container
variables:
NAME: debian-sid
x64-centos-8:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-centos-8-container
variables:
NAME: centos-8
x64-alpine-314:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-alpine-314-container
variables:
NAME: alpine-314
x64-alpine-edge:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-alpine-edge-container
variables:
NAME: alpine-edge
x64-centos-8-clang:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-centos-8-container
variables:
@@ -235,35 +232,35 @@ x64-centos-8-clang:
CC: clang
x64-centos-stream-8:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-centos-stream-8-container
variables:
NAME: centos-stream-8
x64-fedora-33:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-fedora-33-container
variables:
NAME: fedora-33
x64-fedora-34:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-fedora-34-container
variables:
NAME: fedora-34
x64-fedora-rawhide:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-fedora-rawhide-container
variables:
NAME: fedora-rawhide
x64-fedora-rawhide-clang:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-fedora-rawhide-container
variables:
@@ -271,21 +268,21 @@ x64-fedora-rawhide-clang:
CC: clang
x64-opensuse-leap-152:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-opensuse-leap-152-container
variables:
NAME: opensuse-leap-152
x64-opensuse-tumbleweed:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-opensuse-tumbleweed-container
variables:
NAME: opensuse-tumbleweed
x64-ubuntu-1804:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-ubuntu-1804-container
variables:
@@ -293,7 +290,7 @@ x64-ubuntu-1804:
GOLANG: skip
x64-ubuntu-2004:
- extends: .native_build_job
+ extends: .base_build_job
needs:
- x64-ubuntu-2004-container
variables:
--
2.33.0
Martin Kletzander
2021-Sep-22 12:09 UTC
[Libguestfs] [libnbd PATCH 2/3] ci: Fix build script
The test for cross builds was written wrong and we should explicitly disable
building of OCaml bindings for cross-builds.
Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
ci/build.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ci/build.sh b/ci/build.sh
index fc43c3008952..3983e7492cf8 100755
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -76,12 +76,13 @@ main() {
--with-libxml2 \
"
- if "$CROSS"
+ if test -n "$CROSS"
then
CONFIG_ARGS="$CONFIG_ARGS
--disable-fuse
--disable-ocaml
- --disable-python"
+ --disable-python
+ --disable-golang"
else
CONFIG_ARGS="$CONFIG_ARGS
--enable-fuse
--
2.33.0
Martin Kletzander
2021-Sep-22 12:09 UTC
[Libguestfs] [libnbd PATCH 3/3] configure: Do not misuse enable_ocaml
That switch is documented to control the building of bindings, not running the generator. For that reason the conditional should disregard the value of enable_ocaml otherwise the generator cannot be run without building the bindings. Signed-off-by: Martin Kletzander <mkletzan at redhat.com> --- configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index ab175808fba5..1e7194471339 100644 --- a/configure.ac +++ b/configure.ac @@ -377,8 +377,9 @@ AM_CONDITIONAL([HAVE_OCAMLDOC], dnl HAVE_OCAMLC can be used to detect if we are able to run the dnl generator. We should NOT require ocamlfind for this. -AM_CONDITIONAL([HAVE_OCAMLC], - [test "x$OCAMLC" != "xno" && test "x$enable_ocaml" = "xyes"]) +dnl Neither should this be dependent on --enable-ocaml, which +dnl should only control the building of OCaml bindings. +AM_CONDITIONAL([HAVE_OCAMLC], [test "x$OCAMLC" != "xno"]) dnl Check if OCaml has caml_alloc_custom_mem (added late 2018). AS_IF([test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno" && \ -- 2.33.0