Skip to content

Commit 3d0e287

Browse files
committed
Ensure to return the right release version
Fow now, if we build Cloudberry from a source zip file (not using git clone), the version information displayed is not matched the right info, always return 1.0.0 like this: ``` PostgreSQL 14.4 (Apache Cloudberry 1.0.0 build dev) ``` In this PR, these changes are made: - Update the PACKAGE_VERSION string from 1.0.0 to 2.0.0devel, which is similar to the way PostgreSQL is using. - Generate the new configure file with the new configure.ac - Update the getversion file to take the PACKAGE_VERSION as the base version info, and append `+dev.<count>.g<sha>` whenever possible unless the current commit is exactly on a tag. After these changes, will return the right info no matter how they get the source code, like git-clone, source tarballs. For each release, we also need to update the version string to match the right release version manually in each branch. See: http://github.com/apache/cloudberry/discussions/909
1 parent 26b9cda commit 3d0e287

4 files changed

Lines changed: 22 additions & 20 deletions

File tree

configure

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for Apache Cloudberry 1.0.0.
3+
# Generated by GNU Autoconf 2.69 for Apache Cloudberry 2.0.0devel.
44
#
55
# Report bugs to <dev@cloudberry.apache.org>.
66
#
@@ -570,6 +570,7 @@ ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
570570
#
571571
# Initializations.
572572
#
573+
ac_default_prefix=/usr/local
573574
ac_clean_files=
574575
ac_config_libobj_dir=.
575576
LIBOBJS=
@@ -581,8 +582,8 @@ MAKEFLAGS=
581582
# Identity of this package.
582583
PACKAGE_NAME='Apache Cloudberry'
583584
PACKAGE_TARNAME='apache-cloudberry'
584-
PACKAGE_VERSION='1.0.0'
585-
PACKAGE_STRING='Apache Cloudberry 1.0.0'
585+
PACKAGE_VERSION='2.0.0devel'
586+
PACKAGE_STRING='Apache Cloudberry 2.0.0devel'
586587
PACKAGE_BUGREPORT='dev@cloudberry.apache.org'
587588
PACKAGE_URL='https://cloudberry.apache.org/'
588589

@@ -759,8 +760,8 @@ HAVE_CXX14
759760
enable_gpcloud
760761
enable_shared_postgres_backend
761762
enable_mapreduce
762-
enable_catalog_ext
763763
enable_serverless
764+
enable_catalog_ext
764765
enable_orca
765766
autodepend
766767
PKG_CONFIG_LIBDIR
@@ -1512,7 +1513,7 @@ if test "$ac_init_help" = "long"; then
15121513
# Omit some internal or obsolete options to make the list less imposing.
15131514
# This message is too long to be a string in the A/UX 3.1 sh.
15141515
cat <<_ACEOF
1515-
\`configure' configures Apache Cloudberry 1.0.0 to adapt to many kinds of systems.
1516+
\`configure' configures Apache Cloudberry 2.0.0devel to adapt to many kinds of systems.
15161517

15171518
Usage: $0 [OPTION]... [VAR=VALUE]...
15181519

@@ -1578,7 +1579,7 @@ fi
15781579

15791580
if test -n "$ac_init_help"; then
15801581
case $ac_init_help in
1581-
short | recursive ) echo "Configuration of Apache Cloudberry 1.0.0:";;
1582+
short | recursive ) echo "Configuration of Apache Cloudberry 2.0.0devel:";;
15821583
esac
15831584
cat <<\_ACEOF
15841585

@@ -1608,7 +1609,7 @@ Optional Features:
16081609
--enable-cassert enable assertion checks (for debugging)
16091610
--disable-orca disable ORCA optimizer
16101611
--enable-catalog-ext enable Cloudberry catalog extension
1611-
--enable-serverless enable Cloudberry serverless mode
1612+
--enable-serverless use serverless mode of Cloudberry
16121613
--enable-mapreduce enable Cloudberry Mapreduce support
16131614
--disable-shared-postgres-backend
16141615
enable Cloudberry shared postgres backend support
@@ -1781,7 +1782,7 @@ fi
17811782
test -n "$ac_init_help" && exit $ac_status
17821783
if $ac_init_version; then
17831784
cat <<\_ACEOF
1784-
Apache Cloudberry configure 1.0.0
1785+
Apache Cloudberry configure 2.0.0devel
17851786
generated by GNU Autoconf 2.69
17861787

17871788
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2534,7 +2535,7 @@ cat >config.log <<_ACEOF
25342535
This file contains any messages produced by compilers while
25352536
running configure, to aid debugging if configure makes a mistake.
25362537

2537-
It was created by Apache Cloudberry $as_me 1.0.0, which was
2538+
It was created by Apache Cloudberry $as_me 2.0.0devel, which was
25382539
generated by GNU Autoconf 2.69. Invocation command line was
25392540

25402541
$ $0 $@
@@ -8380,7 +8381,7 @@ $as_echo "checking whether to build with catalog extension... $enable_catalog_ex
83808381

83818382

83828383
#
8383-
# Enable serverless mode
8384+
# --enable-serverless uses serverless mode of Cloudberry
83848385
#
83858386

83868387

@@ -8407,8 +8408,8 @@ else
84078408
fi
84088409

84098410

8410-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: checking whether to use serverless architecture of Cloudberry ... $enable_serverless" >&5
8411-
$as_echo "checking whether to use serverless architecture of Cloudberry ... $enable_serverless" >&6; }
8411+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: checking whether to use serverless mode of Cloudberry... $enable_serverless" >&5
8412+
$as_echo "checking whether to use serverless mode of Cloudberry... $enable_serverless" >&6; }
84128413

84138414

84148415
#
@@ -23331,7 +23332,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
2333123332
# report actual input values of CONFIG_FILES etc. instead of their
2333223333
# values after options handling.
2333323334
ac_log="
23334-
This file was extended by Apache Cloudberry $as_me 1.0.0, which was
23335+
This file was extended by Apache Cloudberry $as_me 2.0.0devel, which was
2333523336
generated by GNU Autoconf 2.69. Invocation command line was
2333623337

2333723338
CONFIG_FILES = $CONFIG_FILES
@@ -23402,7 +23403,7 @@ _ACEOF
2340223403
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2340323404
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
2340423405
ac_cs_version="\\
23405-
Apache Cloudberry config.status 1.0.0
23406+
Apache Cloudberry config.status 2.0.0devel
2340623407
configured by $0, generated by GNU Autoconf 2.69,
2340723408
with options \\"\$ac_cs_config\\"
2340823409

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
2020
dnl The PACKAGE_VERSION from upstream PostgreSQL is maintained in the
2121
dnl PG_PACKAGE_VERSION variable, when merging make sure to update this
2222
dnl variable with the merge conflict from the AC_INIT() statement.
23-
AC_INIT([Apache Cloudberry], [1.0.0], [dev@cloudberry.apache.org], [], [https://cloudberry.apache.org/])
23+
AC_INIT([Apache Cloudberry], [2.0.0devel], [dev@cloudberry.apache.org], [], [https://cloudberry.apache.org/])
2424
[PG_PACKAGE_VERSION=14.4]
2525
AC_SUBST(PG_PACKAGE_VERSION)
2626

getversion

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ if type git >/dev/null 2>&1 && [ -d '.git' ] ; then
2323
# overwrite the VERSION from autoconf with the output, else append
2424
# HEAD commit info
2525
if git describe >/dev/null 2>&1 ; then
26-
VERSION=$(generate_dev_version)
27-
else
28-
VERSION+=+
29-
VERSION+=$(git rev-parse --short HEAD)
26+
GIT_VERSION=$(generate_dev_version)
27+
# Append commit distance and SHA if not on a tag
28+
if ! git describe --exact-match >/dev/null 2>&1; then
29+
VERSION+=\+$(echo "$GIT_VERSION" | cut -d'+' -f2-)
30+
fi
3031
fi
3132
# If not a git repository and VERSION file exists, use version string from file.
3233
elif [[ -s ./VERSION ]]; then

gpMgmt/bin/gppylib/gpversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
% os.path.split(__file__)[-1])
1919
sys.exit(1)
2020

21-
MAIN_VERSION = [1,99] # version number for main
21+
MAIN_VERSION = [2,99] # version number for main
2222

2323

2424
#============================================================

0 commit comments

Comments
 (0)