Skip to content

Commit 8505df9

Browse files
authored
Merge PR #5401: Backport "BUILD: Remove concept of an RELEASE_ID"
2 parents 38fec41 + d4757d7 commit 8505df9

File tree

8 files changed

+11
-94
lines changed

8 files changed

+11
-94
lines changed

.ci/azure-pipelines/build_linux.bash

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,16 @@
2020
#
2121

2222
if [[ -n "$MUMBLE_BUILD_NUMBER_TOKEN" ]]; then
23-
VERSION=$(python "scripts/mumble-version.py" --format version)
23+
VERSION=$(python "scripts/mumble-version.py")
2424
BUILD_NUMBER=$(curl "https://mumble.info/get-build-number?commit=${BUILD_SOURCEVERSION}&version=${VERSION}&token=${MUMBLE_BUILD_NUMBER_TOKEN}")
2525
else
2626
BUILD_NUMBER=0
2727
fi
2828

29-
RELEASE_ID=$(python "scripts/mumble-version.py")
30-
3129
cd $BUILD_BINARIESDIRECTORY
3230

3331
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=appdir/usr -DCMAKE_UNITY_BUILD=ON \
34-
-DCMAKE_BUILD_TYPE=Release -DRELEASE_ID=$RELEASE_ID -DBUILD_NUMBER=$BUILD_NUMBER \
32+
-DCMAKE_BUILD_TYPE=Release -DBUILD_NUMBER=$BUILD_NUMBER \
3533
-Dtests=ON -Dsymbols=ON -Dgrpc=ON \
3634
-Ddisplay-install-paths=ON $BUILD_SOURCESDIRECTORY
3735

.ci/azure-pipelines/build_macos.bash

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,16 @@
3131
#
3232

3333
if [[ -n "$MUMBLE_BUILD_NUMBER_TOKEN" ]]; then
34-
VERSION=$(python "scripts/mumble-version.py" --format version)
34+
VERSION=$(python "scripts/mumble-version.py")
3535
BUILD_NUMBER=$(curl "https://mumble.info/get-build-number?commit=${BUILD_SOURCEVERSION}&version=${VERSION}&token=${MUMBLE_BUILD_NUMBER_TOKEN}")
3636
else
3737
BUILD_NUMBER=0
3838
fi
3939

40-
RELEASE_ID=$(python "scripts/mumble-version.py")
41-
4240
cd $BUILD_BINARIESDIRECTORY
4341

4442
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=$MUMBLE_ENVIRONMENT_TOOLCHAIN -DIce_HOME="$MUMBLE_ENVIRONMENT_PATH/installed/x64-osx" \
45-
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DRELEASE_ID=$RELEASE_ID -DBUILD_NUMBER=$BUILD_NUMBER \
43+
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DBUILD_NUMBER=$BUILD_NUMBER \
4644
-Dtests=ON -Dstatic=ON -Dsymbols=ON -Dgrpc=ON \
4745
-Ddisplay-install-paths=ON $BUILD_SOURCESDIRECTORY
4846

.ci/azure-pipelines/release_macos.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
# repository is downloaded.
1414
#
1515

16-
RELEASE_ID=$(python "scripts/mumble-version.py")
16+
VERSION=$(python "scripts/mumble-version.py")
1717

1818
cd $BUILD_BINARIESDIRECTORY
1919

20-
$BUILD_SOURCESDIRECTORY/macx/scripts/osxdist.py --version=$RELEASE_ID --source-dir=$BUILD_SOURCESDIRECTORY --binary-dir=.
20+
$BUILD_SOURCESDIRECTORY/macx/scripts/osxdist.py --version=$VERSION --source-dir=$BUILD_SOURCESDIRECTORY --binary-dir=.
2121

2222
mv *.dmg $BUILD_ARTIFACTSTAGINGDIRECTORY

.ci/build_windows.bat

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
:: The method we use to store a command's output into a variable:
2626
:: https://stackoverflow.com/a/6362922
27-
for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py" --format version`) do (set "VERSION=%%g")
27+
for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py"`) do (set "VERSION=%%g")
2828

2929
:: For some really stupid reason we can't have this statement and the one where we set the VERSION variable in the same if body as
3030
:: in that case the variable substitution of that variable in the expression below fails (is replaced with empty string)
@@ -36,8 +36,6 @@ if defined MUMBLE_BUILD_NUMBER_TOKEN (
3636
set BUILD_NUMBER=0
3737
)
3838

39-
for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py"`) do (set "RELEASE_ID=%%g")
40-
4139
:: Create build directory if it doesn't exist.
4240
if not exist "%MUMBLE_BUILD_DIRECTORY%" mkdir "%MUMBLE_BUILD_DIRECTORY%
4341

@@ -50,7 +48,7 @@ set PATH=%PATH%;C:\WixSharp
5048
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE="%MUMBLE_ENVIRONMENT_TOOLCHAIN%" -DVCPKG_TARGET_TRIPLET=%MUMBLE_ENVIRONMENT_TRIPLET% ^
5149
-DIce_HOME="%MUMBLE_ENVIRONMENT_PATH%\installed\%MUMBLE_ENVIRONMENT_TRIPLET%" ^
5250
-DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe ^
53-
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DRELEASE_ID=%RELEASE_ID% -DBUILD_NUMBER=%BUILD_NUMBER% ^
51+
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DBUILD_NUMBER=%BUILD_NUMBER% ^
5452
-Dpackaging=ON -Dtests=ON -Dstatic=ON -Dsymbols=ON -Dgrpc=ON -Dasio=ON -Dg15=ON ^
5553
-Ddisplay-install-paths=ON %MUMBLE_SOURCE_REPOSITORY%
5654

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20.0")
1212
endif()
1313

1414
set(BUILD_NUMBER CACHE STRING "The build number of the current build. Will be used in Mumble's version to make sure newer builds upgrade older installations properly.")
15-
set(RELEASE_ID CACHE STRING "The ID of the current release (used for representation in the UI and the updater)")
1615

1716
if ("${BUILD_NUMBER}" STREQUAL "")
1817
if(packaging)
@@ -79,7 +78,6 @@ target_architecture(MUMBLE_TARGET_ARCH)
7978
string(TOLOWER "${MUMBLE_TARGET_ARCH}" MUMBLE_TARGET_ARCH)
8079

8180
message(STATUS "##################################################")
82-
message(STATUS "Mumble release ID: ${RELEASE_ID}")
8381
message(STATUS "Mumble version: ${PROJECT_VERSION}")
8482
message(STATUS "Architecture: ${MUMBLE_TARGET_ARCH}")
8583
if(NOT IS_MULTI_CONFIG)

scripts/mumble-version.py

Lines changed: 2 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -5,55 +5,7 @@
55
# that can be found in the LICENSE file at the root of the
66
# Mumble source tree or at <https://www.mumble.info/LICENSE>.
77
#
8-
# This script returns the Mumble version string for a Mumble Git
9-
# repository. The script must be run from within a Mumble Git
10-
# repository.
11-
# This is a replacement for `git describe` to make snapshots
12-
# use the future, untagged version number rather than the previous.
13-
#
14-
# The version is of form 1.3.0~2020-07-02~g4f336a2~snapshot.
15-
# It includes the target release version rather than the previous
16-
# release (as git describe does).
17-
#
18-
# Detailed description:
19-
#
20-
# Once upon a time, Mumble used the output of `git describe` as
21-
# its version string.
22-
#
23-
# If a commit was tagged, it was a "release", and got a simple
24-
# string which was the name of the tag.
25-
#
26-
# If a commit wasn't tagged, it got '1.2.6-234-gf552ag1', which
27-
# consists of the number of commits since the latest tag, and
28-
# the commit hash of the latest commit.
29-
#
30-
# However, the output of `git describe` was found to be confusing
31-
# in practice. This is because the base version of the `git describe`
32-
# output is the latest tag, which is to say: the *previous*
33-
# version of Mumble.
34-
#
35-
# So, a user running a snapshot that would become 1.3.0 would be
36-
# running a version like 1.2.6-234-gf552ag1. This is confusing
37-
# simply by looking at the version numbers, but the way versioning
38-
# works inside the Mumble client made it worse: the client's version
39-
# was referred to as "1.3.0" in several places, but the actual version
40-
# number said 1.2.6-234-gf552ag1.
41-
#
42-
# This script is the replacement for `git describe`. It outputs the
43-
# *actual* base version of the Mumble tree, rather than the latest tag.
44-
# This means that snapshots for Mumble 1.3.0 now have the base version
45-
# '1.3.0'.
46-
#
47-
# It also changes the version string: Instead of using dashes
48-
# as a separator in the version string, it now uses tildes. This allows
49-
# Debian's dpkg version comparer to correctly sort snapshot versions
50-
# before release versions. The new string also includes 'snapshot' in the
51-
# version string to denote to users that the given version is a pre-release
52-
# snapshot.
53-
# Furthermore the version number does use the latest commit's date rather
54-
# than therevision number since the last tag.
55-
# A full new-style version string looks like this:
56-
# 1.3.0~2020-07-02~g4f336a2~snapshot.
8+
# This script reads and prints the current Mumble version
579

5810
from __future__ import (unicode_literals, print_function, division)
5911

@@ -100,10 +52,7 @@ def readProjectVersion():
10052

10153
def main():
10254
parser = argparse.ArgumentParser()
103-
parser.add_argument('-f', '--format', choices = ['full', 'version', 'suffix'], default='full', help = 'Output format')
10455
parser.add_argument('-n', '--newline', action = "store_true", help = 'Break line after printing version')
105-
parser.add_argument('-r', '--revision', type = int, default = 1, help = 'Revision (only used for type \'beta\' and \'rc\')')
106-
parser.add_argument('-t', '--type', choices = ['snapshot', 'beta', 'rc', 'stable'], default = 'snapshot', help = 'Release type - determines the suffix')
10756
args = parser.parse_args()
10857

10958
if args.newline:
@@ -113,27 +62,9 @@ def main():
11362

11463
version = readProjectVersion()
11564

116-
if args.format == 'version':
117-
print(version, end = end)
118-
return
119-
120-
suffix = ''
65+
print(version, end = end)
12166

122-
if args.type == 'rc' or args.type == 'beta':
123-
suffix = '-{0}{1}'.format(args.type, args.revision)
124-
elif args.type == 'snapshot':
125-
# Get the date of the most recent commit
126-
latestCommitDate = cmd(['git', 'log', '-1', '--format=%cd', '--date=short']).strip()
12767

128-
# Get the hash of the most recent commit (shortened)
129-
latestCommitHash = cmd(['git', 'rev-parse', '--short', 'HEAD']).strip()
130-
131-
suffix = '~{0}~g{1}~snapshot'.format(latestCommitDate, latestCommitHash)
132-
133-
if args.format == 'suffix':
134-
print(suffix, end = end)
135-
else:
136-
print(version + suffix, end = end)
13768

13869
if __name__ == '__main__':
13970
main()

src/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ target_sources(shared
128128
target_compile_definitions(shared
129129
PUBLIC
130130
"MUMBLE_VERSION=${PROJECT_VERSION}"
131-
# Only define this macro if RELEASE_ID is actually set
132-
$<$<NOT:$<STREQUAL:"${RELEASE_ID}","">>:MUMBLE_RELEASE_ID=${RELEASE_ID}>
133131
)
134132

135133
target_compile_definitions(shared

src/Version.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111
#define MUMXTEXT(X) #X
1212
#define MUMTEXT(X) MUMXTEXT(X)
1313

14-
#ifndef MUMBLE_RELEASE_ID
15-
# define MUMBLE_RELEASE "Compiled by User"
16-
#else
17-
# define MUMBLE_RELEASE MUMTEXT(MUMBLE_RELEASE_ID)
18-
#endif
14+
#define MUMBLE_RELEASE MUMTEXT(MUMBLE_VERSION)
1915

2016
namespace Version {
2117

0 commit comments

Comments
 (0)