Skip to contentSkip to conversation

build.sh: Support passing configure options

PATCH New Petr Vorel 2 participants 8 messages May 12, 2021 – May 14, 2021

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/2 build.sh: Support passing configure options

and document that in help

---
 build.sh | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
build.sh +11 -3
index 1ec6a51d8..985cc00e8 100755
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2017-2020 Petr Vorel <[email protected]>
+# Copyright (c) 2017-2021 Petr Vorel <[email protected]>
 # Script for travis builds.
 #
 # TODO: Implement comparison of installed files. List of installed files can
@@ -15,9 +15,9 @@ CC="${CC:-gcc}"
 DEFAULT_PREFIX="$HOME/ltp-install"
 DEFAULT_BUILD="native"
 DEFAULT_TREE="in"
-CONFIGURE_OPTS_IN_TREE="--with-open-posix-testsuite --with-realtime-testsuite"
+CONFIGURE_OPTS_IN_TREE="${CONFIGURE_OPT:---with-open-posix-testsuite --with-realtime-testsuite $CONFIGURE_OPT_EXTRA}"
 # TODO: open posix testsuite is currently broken in out-tree-build. Enable it once it's fixed.
-CONFIGURE_OPTS_OUT_TREE="--with-realtime-testsuite"
+CONFIGURE_OPTS_OUT_TREE="${CONFIGURE_OPT:---with-realtime-testsuite $CONFIGURE_OPT_EXTRA}"
 MAKE_OPTS="-j$(getconf _NPROCESSORS_ONLN)"
 
 build_32()
@@ -172,6 +172,14 @@ BUILD TYPES:
 32       32-bit build (PKG_CONFIG_LIBDIR auto-detection for x86_64)
 cross    cross-compile build (requires set compiler via -c switch)
 native   native build
+
+Default configure options:
+in-tree:    $CONFIGURE_OPTS_IN_TREE
+out-of-tree $CONFIGURE_OPTS_OUT_TREE
+
+configure options can be:
+- overwritten with \$CONFIGURE_OPT environment variable
+- extended the default with \$CONFIGURE_OPT_EXTRA environment variable
 EOF
 }
 
Signature · 1 line
2.31.1
author
#1 lore raw

PATCH 2/2 travis: Enhance docparse testing

Specify various asciidoc and asciidoctor configure setup, including PDF. Used in native builds only.

---
Tested:
https://travis-ci.org/github/pevik/ltp/builds/770919150

A proof it finds a bug introduced in 04a7608fe and reverted in c0b511d93:
https://travis-ci.org/github/pevik/ltp/jobs/770919265

Kind regards,
Petr

 .travis.yml | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)
.travis.yml +17 -14
index ef996889a..5d759dab4 100644
@@ -1,4 +1,4 @@
-# Copyright (c) 2017-2020 Petr Vorel <[email protected]>
+# Copyright (c) 2017-2021 Petr Vorel <[email protected]>
 
 dist: bionic
 sudo: required
@@ -30,7 +30,7 @@ matrix:
         - os: linux
           # Message: WARNING: xsltproc: cannot process http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl
           # doc/meson.build:70:1: ERROR: Problem encountered: Docs cannot be built: xsltproc does not work correctly
-          env: DISTRO=alpine:latest
+          env: DISTRO=alpine:latest METADATA=asciidoctor
           compiler: gcc
 
         # build with minimal dependencies
@@ -40,47 +40,47 @@ matrix:
 
         # other builds
         - os: linux
-          env: DISTRO=fedora:latest MAKE_INSTALL=1 CONTAINER=podman
+          env: DISTRO=fedora:latest MAKE_INSTALL=1 CONTAINER=podman METADATA=asciidoctor-pdf
           compiler: clang
 
         - os: linux
-          env: DISTRO=centos:7 TREE=out
+          env: DISTRO=centos:7 TREE=out METADATA=asciidoc-pdf
           compiler: gcc
 
         - os: linux
-          env: DISTRO=debian:testing
+          env: DISTRO=debian:testing METADATA=asciidoctor-pdf
           compiler: gcc
 
         - os: linux
-          env: DISTRO=debian:oldstable
+          env: DISTRO=debian:oldstable METADATA=asciidoc-pdf
           compiler: clang
 
         - os: linux
-          env: DISTRO=opensuse/tumbleweed CONTAINER=podman
+          env: DISTRO=opensuse/tumbleweed CONTAINER=podman METADATA=asciidoctor
           compiler: gcc
 
         - os: linux
-          env: DISTRO=opensuse/leap
+          env: DISTRO=opensuse/leap METADATA=asciidoc-pdf
           compiler: gcc
 
         - os: linux
-          env: DISTRO=debian:oldstable
+          env: DISTRO=debian:oldstable METADATA=asciidoctor
           compiler: gcc
 
         - os: linux
-          env: DISTRO=debian:testing
+          env: DISTRO=debian:testing METADATA=asciidoc-pdf
           compiler: clang
 
         - os: linux
-          env: DISTRO=ubuntu:groovy TREE=out
+          env: DISTRO=ubuntu:groovy TREE=out METADATA=asciidoctor
           compiler: gcc
 
         - os: linux
-          env: DISTRO=ubuntu:xenial
+          env: DISTRO=ubuntu:xenial METADATA=asciidoc-pdf
           compiler: gcc
 
         - os: linux
-          env: DISTRO=centos:latest
+          env: DISTRO=centos:latest METADATA=asciidoctor
           compiler: gcc
 
 before_install:
@@ -123,6 +123,9 @@ script:
     - INSTALL="${DISTRO%%:*}"
     - INSTALL="${INSTALL%%/*}"
     - if [ "$MAKE_INSTALL" = 1 ]; then INSTALL_OPT="-i"; fi
+    - if [ "$METADATA" = "asciidoc-pdf" ]; then CONFIGURE_OPT_EXTRA="--with-metadata-generator=asciidoc --enable-metadata-pdf"; fi
+    - if [ "$METADATA" = "asciidoctor" ]; then CONFIGURE_OPT_EXTRA="--with-metadata-generator=asciidoctor"; fi
+    - if [ "$METADATA" = "asciidoctor-pdf" ]; then CONFIGURE_OPT_EXTRA="--with-metadata-generator=asciidoctor --enable-metadata-pdf"; fi
     - if [ ! "$TREE" ]; then TREE="in"; fi
     - case $VARIANT in cross-compile*) BUILD="cross";; i386) BUILD="32";; *) BUILD="native";; esac
-    - $CONTAINER run $CONTAINER_ARGS -t ltp /bin/sh -c "cd travis && ./$INSTALL.sh && if [ \"$VARIANT\" ]; then ARCH=\"$ARCH\" ./$INSTALL.$VARIANT.sh; fi && ../build.sh -o $TREE -t $BUILD -c $CC $INSTALL_OPT"
+    - $CONTAINER run $CONTAINER_ARGS -t ltp /bin/sh -c "cd travis && ./$INSTALL.sh && if [ \"$VARIANT\" ]; then ARCH=\"$ARCH\" ./$INSTALL.$VARIANT.sh; fi && CONFIGURE_OPT_EXTRA=\"$CONFIGURE_OPT_EXTRA\" ../build.sh -o $TREE -t $BUILD -c $CC $INSTALL_OPT"
Signature · 1 line
2.31.1
#2 lore raw

PATCH 2/2 travis: Enhance docparse testing

Hi!
Looks good.

Is this making the build significantly slower? If not let's get this in now so that we have metadata covered by travis as well.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#3 lore raw

PATCH 2/2 travis: Enhance docparse testing

Quoted 5 lines

Hi!
Looks good.

Is this making the build significantly slower? If not let's get this in now so that we have metadata covered by travis as well.

53 min with [1] vs. 36 min [2] without. That's quite a big difference. But other build got only 39 min [3], thus running yet another build [4] to see what's going on. I'd like to have this docparse testing in travis.

Kind regards,
Petr

[1] https://travis-ci.org/github/pevik/ltp/builds/770930869
[2] https://travis-ci.org/github/pevik/ltp/builds/770895636
[3] https://travis-ci.org/github/pevik/ltp/builds/771055881
[4] https://travis-ci.org/github/pevik/ltp/builds/771117708

author
#4 lore raw

PATCH 2/2 travis: Enhance docparse testing

Hi,

actually the longest one was caused by openSUSE Tumbleweed, probably some temporary container update issue.

Thus merging both with your ack.

Kind regards,
Petr

Quoted 17 lines
Quoted 5 lines

Hi!
Looks good.

Is this making the build significantly slower? If not let's get this in now so that we have metadata covered by travis as well.

53 min with [1] vs. 36 min [2] without. That's quite a big difference. But other build got only 39 min [3], thus running yet another build [4] to see what's going on. I'd like to have this docparse testing in travis.

Kind regards,
Petr

[1] https://travis-ci.org/github/pevik/ltp/builds/770930869
[2] https://travis-ci.org/github/pevik/ltp/builds/770895636
[3] https://travis-ci.org/github/pevik/ltp/builds/771055881
[4] https://travis-ci.org/github/pevik/ltp/builds/771117708

author
#6 lore raw

PATCH 1/2 build.sh: Support passing configure options

Quoted 3 lines

Hi!
Looks good, but is it even used for the second patch? We just pass extra options there, right?

Yes, CONFIGURE_OPT_EXTRA. I added also CONFIGURE_OPT to allow local build.sh without realtime and openposix:

$ CONFIGURE_OPT= ./build.sh

I document it in the commit.

Kind regards,
Petr

author
#7 lore raw

PATCH 1/2 build.sh: Support passing configure options

Quoted 8 lines
Quoted 3 lines

Hi!
Looks good, but is it even used for the second patch? We just pass extra options there, right?

Yes, CONFIGURE_OPT_EXTRA. I added also CONFIGURE_OPT to allow local build.sh without realtime and openposix:

$ CONFIGURE_OPT= ./build.sh

I document it in the commit.

Whole patchset merged.
In the end I really added only CONFIGURE_OPT_EXTRA.

to allow CONFIGURE_OPT be empty it would have to be added as:
CONFIGURE_OPTS_OUT_TREE=${CONFIGURE_OPT: --with-realtime-testsuite ...}" i.e. remove -, but that would again require to always define CONFIGURE_OPT. => postpone it for now.

Kind regards,
Petr

Quoted 2 lines

Kind regards,
Petr