From f45064a6f7b66b502bd80fdcd8b843a6656fa9b5 Mon Sep 17 00:00:00 2001 From: Mikael Zayenz Lagerkvist Date: Mon, 13 Jul 2026 17:01:34 +0200 Subject: [PATCH 1/4] Respect disabled components during install --- Makefile.in | 31 ++++++++++++++++++++----------- changelog.in | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/Makefile.in b/Makefile.in index be42d52c23..1b20e4d47a 100755 --- a/Makefile.in +++ b/Makefile.in @@ -906,6 +906,11 @@ INTEXAMPLESRC0 = \ INTEXAMPLEHDR = $(INTEXAMPLEHDR0:%=examples/%.hpp) INTEXAMPLESRC = $(INTEXAMPLESRC0:%=examples/%.cpp) +ifeq "@enable_examples@" "yes" +INSTALLEXAMPLEHDR = $(INTEXAMPLEHDR) +else +INSTALLEXAMPLEHDR = +endif ifeq "@enable_int_vars@" "yes" INTEXAMPLEEXE = $(INTEXAMPLESRC:%.cpp=%$(EXESUFFIX)) else @@ -1034,7 +1039,7 @@ ALLGECODEHDR = \ $(SUPPORTHDR) $(KERNELHDR) $(SEARCHHDR) \ $(INTHDR) $(FLOATHDR) $(SETHDR) $(MMHDR) \ $(DRIVERHDR) $(ITERHDR) $(GISTHDR) $(FLATZINCHDR) \ - $(INTEXAMPLEHDR) + $(INSTALLEXAMPLEHDR) ALLHDR = \ $(ALLGECODEHDR) $(THIRDHDR) ALLOBJ0 = $(ALLSRC:%.cpp=%$(OBJSUFFIX)) \ @@ -2039,18 +2044,22 @@ doinstallheaders: $(ALLHDR:%=$(top_srcdir)/%) $(EXTRA_HEADERS) $(VARIMPHDR) $(FL for_extraheaders="$(EXTRA_HEADERS)" && \ for f in $$for_extraheaders; do \ cp $$f $(DESTDIR)$(includedir)/$$f; done && \ - mkdir -p $(DESTDIR)$(datadir)/minizinc/solvers && \ for_flatconf="$(FLATZINCCONFIG)" && \ - for f in $$for_flatconf; do \ - cp $$f $(DESTDIR)$(datadir)/minizinc/solvers; done && \ + if test -n "$$for_flatconf"; then \ + mkdir -p $(DESTDIR)$(datadir)/minizinc/solvers && \ + for f in $$for_flatconf; do \ + cp $$f $(DESTDIR)$(datadir)/minizinc/solvers; done; \ + fi && \ for_mznlib="$(FLATZINCMZNLIB)" && \ - mznlibdir="$(DESTDIR)$(datadir)/minizinc/gecode" && \ - mkdir -p "$$mznlibdir" && \ - for f in $$for_mznlib; do \ - srcdir="$(top_srcdir)/$$f"; \ - (cd "$$srcdir" && find . -type f -name '*.mzn' \ - -exec sh -c 'mznlibdir=$$1; shift; for mznfile do mznfile=$${mznfile#./}; mzndir=$${mznfile%/*}; if test "$$mzndir" != "$$mznfile"; then mkdir -p "$$mznlibdir/$$mzndir" || exit 1; fi; cp "$$mznfile" "$$mznlibdir/$$mznfile" || exit 1; done' sh "$$mznlibdir" {} +) || exit 1; \ - done + if test -n "$$for_mznlib"; then \ + mznlibdir="$(DESTDIR)$(datadir)/minizinc/gecode" && \ + mkdir -p "$$mznlibdir" && \ + for f in $$for_mznlib; do \ + srcdir="$(top_srcdir)/$$f"; \ + (cd "$$srcdir" && find . -type f -name '*.mzn' \ + -exec sh -c 'mznlibdir=$$1; shift; for mznfile do mznfile=$${mznfile#./}; mzndir=$${mznfile%/*}; if test "$$mzndir" != "$$mznfile"; then mkdir -p "$$mznlibdir/$$mzndir" || exit 1; fi; cp "$$mznfile" "$$mznlibdir/$$mznfile" || exit 1; done' sh "$$mznlibdir" {} +) || exit 1; \ + done; \ + fi doinstalllib: mkdir -p $(DESTDIR)$(sharedlibdir) && \ diff --git a/changelog.in b/changelog.in index 18991b0bf4..80921440fe 100755 --- a/changelog.in +++ b/changelog.in @@ -96,6 +96,26 @@ Thanks: Mats Carlsson Fix non-terminating propagation for sorted constraints when a matching component contains no interval compatible with an input variable. +[ENTRY] +Module: other +What: bug +Rank: minor +Issue: 107 +Thanks: Yuri Victorovich +[DESCRIPTION] +Do not install example data headers when examples are disabled in an Autotools +build. + +[ENTRY] +Module: other +What: bug +Rank: minor +Issue: 108 +Thanks: Yuri Victorovich +[DESCRIPTION] +Do not create empty MiniZinc directories when FlatZinc is disabled in an +Autotools build. + [ENTRY] Module: flatzinc What: new From a96f67f427270f0fc899e564e64b25f359ae2932 Mon Sep 17 00:00:00 2001 From: Mikael Zayenz Lagerkvist Date: Mon, 13 Jul 2026 21:27:49 +0200 Subject: [PATCH 2/4] Test disabled component install layouts --- .github/ci/autoconf-install-layout-smoke.sh | 42 +++++++++++++++++++++ .github/ci/autoconf-install-smoke.sh | 42 ++++++++++++++++++--- .github/workflows/build.yml | 27 +++++++++++++ Makefile.in | 17 +++++++-- 4 files changed, 118 insertions(+), 10 deletions(-) create mode 100755 .github/ci/autoconf-install-layout-smoke.sh diff --git a/.github/ci/autoconf-install-layout-smoke.sh b/.github/ci/autoconf-install-layout-smoke.sh new file mode 100755 index 0000000000..5b6ab4a9fc --- /dev/null +++ b/.github/ci/autoconf-install-layout-smoke.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +set -euxo pipefail + +source_dir="${1:?usage: autoconf-install-layout-smoke.sh }" +build_dir="${2:?}" +destdir="${3:?}" +examples_enabled="${4:?}" +flatzinc_enabled="${5:?}" + +rm -rf "$build_dir" "$destdir" +mkdir -p "$build_dir" + +case "$examples_enabled:$flatzinc_enabled" in + yes:yes|yes:no|no:yes|no:no) ;; + *) + echo "feature values must be yes or no" >&2 + exit 2 + ;; +esac + +( + cd "$build_dir" + "$source_dir/configure" \ + --disable-float-vars \ + --disable-set-vars \ + --disable-gist \ + "--enable-examples=$examples_enabled" \ + "--enable-flatzinc=$flatzinc_enabled" + + # Example data remains part of documentation/statistics inputs even when it + # is deliberately omitted from the installed header set. + make --no-print-directory -f Makefile -f - check-documentation-inputs <<'MAKE' +.PHONY: check-documentation-inputs +check-documentation-inputs: + @case " $(ALLGECODEHDR) " in *" examples/scowl.hpp "*) ;; *) exit 1;; esac + @case " $(ALLGECODEHDR) " in *" examples/job-shop-instances.hpp "*) ;; *) exit 1;; esac +MAKE + + make -j4 + "$source_dir/.github/ci/autoconf-install-smoke.sh" \ + "$destdir" /usr/local "$examples_enabled" "$flatzinc_enabled" +) diff --git a/.github/ci/autoconf-install-smoke.sh b/.github/ci/autoconf-install-smoke.sh index 2068200e2a..f00163b194 100755 --- a/.github/ci/autoconf-install-smoke.sh +++ b/.github/ci/autoconf-install-smoke.sh @@ -1,8 +1,10 @@ #!/usr/bin/env bash set -euxo pipefail -destdir="${1:?usage: autoconf-install-smoke.sh [logical-prefix]}" +destdir="${1:?usage: autoconf-install-smoke.sh [logical-prefix] [examples-enabled] [flatzinc-enabled]}" logical_prefix="${2:-/usr/local}" +examples_enabled="${3:-yes}" +flatzinc_enabled="${4:-yes}" case "$logical_prefix" in /*) ;; @@ -23,12 +25,40 @@ solver_config="$solver_dir/gecode.msc" mznlib_dir="$install_prefix/share/minizinc/gecode" test -f "$install_prefix/include/gecode/support/config.hpp" -test -x "$install_prefix/bin/fzn-gecode" -test -x "$install_prefix/bin/mzn-gecode" -! grep -q "/usr/local" "$install_prefix/bin/mzn-gecode" -test -f "$solver_config" -test -f "$mznlib_dir/experimental/on_restart/fzn_on_restart_complete.mzn" +case "$examples_enabled" in + yes) + test -f "$install_prefix/include/examples/scowl.hpp" + test -f "$install_prefix/include/examples/job-shop-instances.hpp" + ;; + no) + test ! -e "$install_prefix/include/examples" + ;; + *) + echo "examples-enabled must be yes or no: $examples_enabled" >&2 + exit 2 + ;; +esac + +case "$flatzinc_enabled" in + yes) + test -x "$install_prefix/bin/fzn-gecode" + test -x "$install_prefix/bin/mzn-gecode" + ! grep -q "/usr/local" "$install_prefix/bin/mzn-gecode" + test -f "$solver_config" + test -f "$mznlib_dir/experimental/on_restart/fzn_on_restart_complete.mzn" + ;; + no) + test ! -e "$install_prefix/bin/fzn-gecode" + test ! -e "$install_prefix/bin/mzn-gecode" + test ! -e "$install_prefix/share/minizinc" + exit 0 + ;; + *) + echo "flatzinc-enabled must be yes or no: $flatzinc_enabled" >&2 + exit 2 + ;; +esac python3 - "$solver_config" "$solver_dir" <<'PY' import json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f77eb9622a..dfc8cdada2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,6 +88,33 @@ jobs: shell: bash run: bash .github/ci/custom-vis-smoke.sh + autoconf-install-layout: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + examples: [yes, no] + flatzinc: [yes, no] + + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + + - name: Install Ubuntu build deps + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y flex bison libgmp-dev libmpfr-dev + + - name: Check Autoconf install layout + shell: bash + run: | + bash .github/ci/autoconf-install-layout-smoke.sh \ + "$GITHUB_WORKSPACE" \ + "$RUNNER_TEMP/gecode-build" \ + "$RUNNER_TEMP/gecode-install" \ + "${{ matrix.examples }}" \ + "${{ matrix.flatzinc }}" + build-cmake-unix: runs-on: ${{ matrix.os }} strategy: diff --git a/Makefile.in b/Makefile.in index 1b20e4d47a..1f041e2e29 100755 --- a/Makefile.in +++ b/Makefile.in @@ -860,6 +860,7 @@ else export FLATZINCCONFIG = tools/flatzinc/gecode.msc endif FLATZINCEXE = tools/flatzinc/fzn-gecode$(EXESUFFIX) +FLATZINCLAUNCHER = tools/flatzinc/mzn-gecode@BATCHFILE@ ifeq "@need_soname@" "yes" export FLATZINCSONAME = @WLSONAME@$(LIBPREFIX)@FLATZINC@$(SOSUFFIX) else @@ -882,6 +883,7 @@ export FLATZINCMZNLIB = export FLATZINCRES = export FLATZINCRC = FLATZINCEXE = +FLATZINCLAUNCHER = endif # @@ -1039,9 +1041,16 @@ ALLGECODEHDR = \ $(SUPPORTHDR) $(KERNELHDR) $(SEARCHHDR) \ $(INTHDR) $(FLOATHDR) $(SETHDR) $(MMHDR) \ $(DRIVERHDR) $(ITERHDR) $(GISTHDR) $(FLATZINCHDR) \ - $(INSTALLEXAMPLEHDR) + $(INTEXAMPLEHDR) ALLHDR = \ $(ALLGECODEHDR) $(THIRDHDR) +INSTALLGECODEHDR = \ + $(SUPPORTHDR) $(KERNELHDR) $(SEARCHHDR) \ + $(INTHDR) $(FLOATHDR) $(SETHDR) $(MMHDR) \ + $(DRIVERHDR) $(ITERHDR) $(GISTHDR) $(FLATZINCHDR) \ + $(INSTALLEXAMPLEHDR) +INSTALLHDR = \ + $(INSTALLGECODEHDR) $(THIRDHDR) ALLOBJ0 = $(ALLSRC:%.cpp=%$(OBJSUFFIX)) \ $(GISTMOCSRC:%.cpp=%$(OBJSUFFIX)) \ $(FLATZINC_GENSRC:%.cpp=%$(OBJSUFFIX)) @@ -1098,7 +1107,7 @@ LIBLIBTARGETS = PDBTARGETS = endif -EXETARGETS = $(FLATZINCEXE) tools/flatzinc/mzn-gecode@BATCHFILE@ +EXETARGETS = $(FLATZINCEXE) $(FLATZINCLAUNCHER) # # Testing @@ -2034,9 +2043,9 @@ endif endif -doinstallheaders: $(ALLHDR:%=$(top_srcdir)/%) $(EXTRA_HEADERS) $(VARIMPHDR) $(FLATZINCCONFIG) +doinstallheaders: $(INSTALLHDR:%=$(top_srcdir)/%) $(EXTRA_HEADERS) $(VARIMPHDR) $(FLATZINCCONFIG) mkdir -p $(DESTDIR)$(includedir) && \ - (cd $(top_srcdir) && tar cf - $(ALLHDR)) | \ + (cd $(top_srcdir) && tar cf - $(INSTALLHDR)) | \ (cd $(DESTDIR)$(includedir) && tar xf -) && \ for_varimpheaders="$(VARIMPHDR)" && \ for f in $$for_varimpheaders; do \ From c68e0e8635c48be91b492fe0d95d18a4a769ff49 Mon Sep 17 00:00:00 2001 From: Mikael Zayenz Lagerkvist Date: Mon, 13 Jul 2026 21:40:00 +0200 Subject: [PATCH 3/4] ci: install uv for Autoconf layout checks --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfc8cdada2..adb8f9c8b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,6 +99,11 @@ jobs: steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + - name: Install uv + uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 + with: + enable-cache: false + - name: Install Ubuntu build deps shell: bash run: | From 13640e0e2755436fd3000ce98e011a997fd43472 Mon Sep 17 00:00:00 2001 From: Mikael Zayenz Lagerkvist Date: Mon, 13 Jul 2026 22:24:15 +0200 Subject: [PATCH 4/4] Avoid expanding install CI --- .github/ci/autoconf-install-layout-smoke.sh | 42 --------------------- .github/workflows/build.yml | 32 ---------------- 2 files changed, 74 deletions(-) delete mode 100755 .github/ci/autoconf-install-layout-smoke.sh diff --git a/.github/ci/autoconf-install-layout-smoke.sh b/.github/ci/autoconf-install-layout-smoke.sh deleted file mode 100755 index 5b6ab4a9fc..0000000000 --- a/.github/ci/autoconf-install-layout-smoke.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -set -euxo pipefail - -source_dir="${1:?usage: autoconf-install-layout-smoke.sh }" -build_dir="${2:?}" -destdir="${3:?}" -examples_enabled="${4:?}" -flatzinc_enabled="${5:?}" - -rm -rf "$build_dir" "$destdir" -mkdir -p "$build_dir" - -case "$examples_enabled:$flatzinc_enabled" in - yes:yes|yes:no|no:yes|no:no) ;; - *) - echo "feature values must be yes or no" >&2 - exit 2 - ;; -esac - -( - cd "$build_dir" - "$source_dir/configure" \ - --disable-float-vars \ - --disable-set-vars \ - --disable-gist \ - "--enable-examples=$examples_enabled" \ - "--enable-flatzinc=$flatzinc_enabled" - - # Example data remains part of documentation/statistics inputs even when it - # is deliberately omitted from the installed header set. - make --no-print-directory -f Makefile -f - check-documentation-inputs <<'MAKE' -.PHONY: check-documentation-inputs -check-documentation-inputs: - @case " $(ALLGECODEHDR) " in *" examples/scowl.hpp "*) ;; *) exit 1;; esac - @case " $(ALLGECODEHDR) " in *" examples/job-shop-instances.hpp "*) ;; *) exit 1;; esac -MAKE - - make -j4 - "$source_dir/.github/ci/autoconf-install-smoke.sh" \ - "$destdir" /usr/local "$examples_enabled" "$flatzinc_enabled" -) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index adb8f9c8b6..f77eb9622a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,38 +88,6 @@ jobs: shell: bash run: bash .github/ci/custom-vis-smoke.sh - autoconf-install-layout: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - examples: [yes, no] - flatzinc: [yes, no] - - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - - - name: Install uv - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 - with: - enable-cache: false - - - name: Install Ubuntu build deps - shell: bash - run: | - sudo apt-get update - sudo apt-get install -y flex bison libgmp-dev libmpfr-dev - - - name: Check Autoconf install layout - shell: bash - run: | - bash .github/ci/autoconf-install-layout-smoke.sh \ - "$GITHUB_WORKSPACE" \ - "$RUNNER_TEMP/gecode-build" \ - "$RUNNER_TEMP/gecode-install" \ - "${{ matrix.examples }}" \ - "${{ matrix.flatzinc }}" - build-cmake-unix: runs-on: ${{ matrix.os }} strategy: