From 8f27b40d702791d7b9ec63efefe7a5fc2a4e804e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Ren=C3=A9=20Rideau?= Date: Tue, 5 Dec 2023 13:38:30 -0500 Subject: [PATCH] Support version MANIFEST. Update release.md. (#1074) --- configure | 43 +++++++++++++++++++++++++++---- doc/reference/dev/release.md | 50 +++++++++++++++++++++++------------- manifest.sh | 18 +++++++++++++ src/build/build-version.scm | 37 ++++++++++++++++---------- 4 files changed, 112 insertions(+), 36 deletions(-) create mode 100755 manifest.sh diff --git a/configure b/configure index 93b899015..2238dc9a0 100755 --- a/configure +++ b/configure @@ -2,6 +2,14 @@ set -e cd $(dirname "$0") +# There are two ways that Gerbil may get version information: +# 1. a version MANIFEST file, for git-less tarballs and builds (e.g. Nix, Guix) +# 2. git, for regular development +# +# The format of the version MANIFEST file is as generated by ./manifest.sh +# with quote-less shell definitions var=value for the following variables: +# gerbil_stamp_version gambit_stamp_version gambit_stamp_ymd gambit_stamp_hms + die() { echo "configuration failed" exit 1 @@ -57,7 +65,12 @@ package_out_of_tree() { echo "It is now available as an external package: github.com/mighty-gerbils/gerbil-${pkg}" } -readonly gerbil_version="$(git describe --tags --always)" +if [ -f MANIFEST ] ; then + . ./MANIFEST + readonly gerbil_version="$gerbil_stamp_version" +else + readonly gerbil_version="$(git describe --tags --always)" +fi readonly gerbil_targets="" readonly default_gambit_tag=8b18ab69504c2d41301f7fec16a5350db717a20e readonly default_gambit_config="--enable-targets=${gerbil_targets} --enable-single-host --enable-dynamic-clib --enable-default-runtime-options=tE8,f8,-8 --enable-trust-c-tco" @@ -213,14 +226,34 @@ else fi fi -git submodule init || die -git submodule update --force || die - -(cd src/gambit && git fetch origin && git checkout "${gambit_tag}" && touch configure config.status) || die +if [ ! -f MANIFEST -o ! -f src/gambit/configure ] ; then + git submodule init || die + git submodule update --force || die + (cd src/gambit && git fetch origin && git checkout "${gambit_tag}" && touch configure config.status) || die + unset gambit_stamp_version +fi gambit_config="--prefix=${gerbil_prefix} --enable-march=${gambit_march} ${gambit_shared} ${gambit_config}" (export LDFLAGS="$LDFLAGS"; export CFLAGS="$CFLAGS"; cd src/gambit && ./configure $gambit_config ) || die +if [ -n "$gambit_stamp_version" ] ; then + sed -i -e "s/^stamp:/stamp-orig:/" src/gambit/include/makefile + echo stamp: >> src/gambit/include/makefile + cat >> src/gambit/include/stamp.h < build-env.sh < MANIFEST <