Merge PR #5400: BUILD: Remove concept of an RELEASE_ID

Having a separate RELEASE_ID just unnecessarily complicates drafting
releases. Plus, now that we are using different build numbers for every
new build anyway, a separate release ID is really not necessary.
This commit is contained in:
Robert Adam 2022-01-02 12:12:46 +01:00 committed by GitHub
commit ef045be7fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 22 additions and 92 deletions

View File

@ -26,12 +26,10 @@ else
BUILD_NUMBER=0 BUILD_NUMBER=0
fi fi
RELEASE_ID=$(python "scripts/mumble-version.py")
cd $BUILD_BINARIESDIRECTORY cd $BUILD_BINARIESDIRECTORY
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=appdir/usr -DCMAKE_UNITY_BUILD=ON \ cmake -G Ninja -DCMAKE_INSTALL_PREFIX=appdir/usr -DCMAKE_UNITY_BUILD=ON \
-DCMAKE_BUILD_TYPE=Release -DRELEASE_ID=$RELEASE_ID -DBUILD_NUMBER=$BUILD_NUMBER \ -DCMAKE_BUILD_TYPE=Release -DBUILD_NUMBER=$BUILD_NUMBER \
-Dtests=ON -Dsymbols=ON -Dgrpc=ON \ -Dtests=ON -Dsymbols=ON -Dgrpc=ON \
-Ddisplay-install-paths=ON $BUILD_SOURCESDIRECTORY -Ddisplay-install-paths=ON $BUILD_SOURCESDIRECTORY

View File

@ -37,12 +37,10 @@ else
BUILD_NUMBER=0 BUILD_NUMBER=0
fi fi
RELEASE_ID=$(python "scripts/mumble-version.py")
cd $BUILD_BINARIESDIRECTORY cd $BUILD_BINARIESDIRECTORY
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=$MUMBLE_ENVIRONMENT_TOOLCHAIN -DIce_HOME="$MUMBLE_ENVIRONMENT_PATH/installed/x64-osx" \ cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=$MUMBLE_ENVIRONMENT_TOOLCHAIN -DIce_HOME="$MUMBLE_ENVIRONMENT_PATH/installed/x64-osx" \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DRELEASE_ID=$RELEASE_ID -DBUILD_NUMBER=$BUILD_NUMBER \ -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DBUILD_NUMBER=$BUILD_NUMBER \
-Dtests=ON -Dstatic=ON -Dsymbols=ON -Dgrpc=ON \ -Dtests=ON -Dstatic=ON -Dsymbols=ON -Dgrpc=ON \
-Ddisplay-install-paths=ON $BUILD_SOURCESDIRECTORY -Ddisplay-install-paths=ON $BUILD_SOURCESDIRECTORY

View File

@ -13,10 +13,10 @@
# repository is downloaded. # repository is downloaded.
# #
RELEASE_ID=$(python "scripts/mumble-version.py") VERSION=$(python "scripts/mumble-version.py")
cd $BUILD_BINARIESDIRECTORY cd $BUILD_BINARIESDIRECTORY
$BUILD_SOURCESDIRECTORY/macx/scripts/osxdist.py --version=$RELEASE_ID --source-dir=$BUILD_SOURCESDIRECTORY --binary-dir=. $BUILD_SOURCESDIRECTORY/macx/scripts/osxdist.py --version=$VERSION --source-dir=$BUILD_SOURCESDIRECTORY --binary-dir=.
mv *.dmg $BUILD_ARTIFACTSTAGINGDIRECTORY mv *.dmg $BUILD_ARTIFACTSTAGINGDIRECTORY

View File

@ -24,7 +24,7 @@
:: The method we use to store a command's output into a variable: :: The method we use to store a command's output into a variable:
:: https://stackoverflow.com/a/6362922 :: https://stackoverflow.com/a/6362922
for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py" --format version`) do (set "VERSION=%%g") for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py"`) do (set "VERSION=%%g")
:: 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 :: 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
:: in that case the variable substitution of that variable in the expression below fails (is replaced with empty string) :: 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 (
set BUILD_NUMBER=0 set BUILD_NUMBER=0
) )
for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py"`) do (set "RELEASE_ID=%%g")
:: Create build directory if it doesn't exist. :: Create build directory if it doesn't exist.
if not exist "%MUMBLE_BUILD_DIRECTORY%" mkdir "%MUMBLE_BUILD_DIRECTORY% if not exist "%MUMBLE_BUILD_DIRECTORY%" mkdir "%MUMBLE_BUILD_DIRECTORY%
@ -50,7 +48,7 @@ set PATH=%PATH%;C:\WixSharp
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE="%MUMBLE_ENVIRONMENT_TOOLCHAIN%" -DVCPKG_TARGET_TRIPLET=%MUMBLE_ENVIRONMENT_TRIPLET% ^ cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE="%MUMBLE_ENVIRONMENT_TOOLCHAIN%" -DVCPKG_TARGET_TRIPLET=%MUMBLE_ENVIRONMENT_TRIPLET% ^
-DIce_HOME="%MUMBLE_ENVIRONMENT_PATH%\installed\%MUMBLE_ENVIRONMENT_TRIPLET%" ^ -DIce_HOME="%MUMBLE_ENVIRONMENT_PATH%\installed\%MUMBLE_ENVIRONMENT_TRIPLET%" ^
-DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe ^ -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe ^
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DRELEASE_ID=%RELEASE_ID% -DBUILD_NUMBER=%BUILD_NUMBER% ^ -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DBUILD_NUMBER=%BUILD_NUMBER% ^
-Dpackaging=ON -Dtests=ON -Dstatic=ON -Dsymbols=ON -Dgrpc=ON -Dasio=ON -Dg15=ON ^ -Dpackaging=ON -Dtests=ON -Dstatic=ON -Dsymbols=ON -Dgrpc=ON -Dasio=ON -Dg15=ON ^
-Ddisplay-install-paths=ON %MUMBLE_SOURCE_REPOSITORY% -Ddisplay-install-paths=ON %MUMBLE_SOURCE_REPOSITORY%

View File

@ -14,7 +14,6 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20.0")
endif() endif()
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.") 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.")
set(RELEASE_ID CACHE STRING "The ID of the current release (used for representation in the UI and the updater)")
if ("${BUILD_NUMBER}" STREQUAL "") if ("${BUILD_NUMBER}" STREQUAL "")
if(packaging) if(packaging)
@ -89,7 +88,6 @@ target_architecture(MUMBLE_TARGET_ARCH)
string(TOLOWER "${MUMBLE_TARGET_ARCH}" MUMBLE_TARGET_ARCH) string(TOLOWER "${MUMBLE_TARGET_ARCH}" MUMBLE_TARGET_ARCH)
message(STATUS "##################################################") message(STATUS "##################################################")
message(STATUS "Mumble release ID: ${RELEASE_ID}")
message(STATUS "Mumble version: ${PROJECT_VERSION}") message(STATUS "Mumble version: ${PROJECT_VERSION}")
message(STATUS "Architecture: ${MUMBLE_TARGET_ARCH}") message(STATUS "Architecture: ${MUMBLE_TARGET_ARCH}")
if(NOT IS_MULTI_CONFIG) if(NOT IS_MULTI_CONFIG)

View File

@ -21,6 +21,7 @@ In order to actually build Mumble, you can follow one of the following instructi
Furthermore you might find these helpful as well: Furthermore you might find these helpful as well:
- [FAQ](faq.md) - [FAQ](faq.md)
- [Determine build number](find_build_number.md)
- [Common build errors](common_build_errors.md) - [Common build errors](common_build_errors.md)
- [List of available cmake options](cmake_options.md) - [List of available cmake options](cmake_options.md)
- [IDE integration](ide_integration.md) - [IDE integration](ide_integration.md)

View File

@ -0,0 +1,12 @@
# Finding the correct BUILD_NUMBER
When invoking CMake, you can specify a build number as e.g. `-DBUILD_NUMBER=42`. The build number will be used as the third component of the Mumble
version.
First off: This is only important if you are planning to distribute/package Mumble (it makes sure that Mumble can be upgraded properly). For
self-compiled versions this doesn't really matter and you can simply omit the build number.
The build number is automatically increased with every commit that is made to Mumble. All build numbers for all commits can be found on
https://mumble.info/build-number.json. Simply look up the current commit hash (topmost entry in the result of `git log`) in the list and use the
corresponding build number.

View File

@ -5,55 +5,7 @@
# that can be found in the LICENSE file at the root of the # that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>. # Mumble source tree or at <https://www.mumble.info/LICENSE>.
# #
# This script returns the Mumble version string for a Mumble Git # This script reads and prints the current Mumble version
# repository. The script must be run from within a Mumble Git
# repository.
# This is a replacement for `git describe` to make snapshots
# use the future, untagged version number rather than the previous.
#
# The version is of form 1.3.0~2020-07-02~g4f336a2~snapshot.
# It includes the target release version rather than the previous
# release (as git describe does).
#
# Detailed description:
#
# Once upon a time, Mumble used the output of `git describe` as
# its version string.
#
# If a commit was tagged, it was a "release", and got a simple
# string which was the name of the tag.
#
# If a commit wasn't tagged, it got '1.2.6-234-gf552ag1', which
# consists of the number of commits since the latest tag, and
# the commit hash of the latest commit.
#
# However, the output of `git describe` was found to be confusing
# in practice. This is because the base version of the `git describe`
# output is the latest tag, which is to say: the *previous*
# version of Mumble.
#
# So, a user running a snapshot that would become 1.3.0 would be
# running a version like 1.2.6-234-gf552ag1. This is confusing
# simply by looking at the version numbers, but the way versioning
# works inside the Mumble client made it worse: the client's version
# was referred to as "1.3.0" in several places, but the actual version
# number said 1.2.6-234-gf552ag1.
#
# This script is the replacement for `git describe`. It outputs the
# *actual* base version of the Mumble tree, rather than the latest tag.
# This means that snapshots for Mumble 1.3.0 now have the base version
# '1.3.0'.
#
# It also changes the version string: Instead of using dashes
# as a separator in the version string, it now uses tildes. This allows
# Debian's dpkg version comparer to correctly sort snapshot versions
# before release versions. The new string also includes 'snapshot' in the
# version string to denote to users that the given version is a pre-release
# snapshot.
# Furthermore the version number does use the latest commit's date rather
# than therevision number since the last tag.
# A full new-style version string looks like this:
# 1.3.0~2020-07-02~g4f336a2~snapshot.
from __future__ import (unicode_literals, print_function, division) from __future__ import (unicode_literals, print_function, division)
@ -100,10 +52,7 @@ def readProjectVersion():
def main(): def main():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('-f', '--format', choices = ['full', 'version', 'suffix'], default='full', help = 'Output format')
parser.add_argument('-n', '--newline', action = "store_true", help = 'Break line after printing version') parser.add_argument('-n', '--newline', action = "store_true", help = 'Break line after printing version')
parser.add_argument('-r', '--revision', type = int, default = 1, help = 'Revision (only used for type \'beta\' and \'rc\')')
parser.add_argument('-t', '--type', choices = ['snapshot', 'beta', 'rc', 'stable'], default = 'snapshot', help = 'Release type - determines the suffix')
args = parser.parse_args() args = parser.parse_args()
if args.newline: if args.newline:
@ -113,27 +62,9 @@ def main():
version = readProjectVersion() version = readProjectVersion()
if args.format == 'version': print(version, end = end)
print(version, end = end)
return
suffix = ''
if args.type == 'rc' or args.type == 'beta':
suffix = '-{0}{1}'.format(args.type, args.revision)
elif args.type == 'snapshot':
# Get the date of the most recent commit
latestCommitDate = cmd(['git', 'log', '-1', '--format=%cd', '--date=short']).strip()
# Get the hash of the most recent commit (shortened)
latestCommitHash = cmd(['git', 'rev-parse', '--short', 'HEAD']).strip()
suffix = '~{0}~g{1}~snapshot'.format(latestCommitDate, latestCommitHash)
if args.format == 'suffix':
print(suffix, end = end)
else:
print(version + suffix, end = end)
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -130,8 +130,6 @@ target_sources(shared
target_compile_definitions(shared target_compile_definitions(shared
PUBLIC PUBLIC
"MUMBLE_VERSION=${PROJECT_VERSION}" "MUMBLE_VERSION=${PROJECT_VERSION}"
# Only define this macro if RELEASE_ID is actually set
$<$<NOT:$<STREQUAL:"${RELEASE_ID}","">>:MUMBLE_RELEASE_ID=${RELEASE_ID}>
) )
target_compile_definitions(shared target_compile_definitions(shared

View File

@ -11,11 +11,7 @@
#define MUMXTEXT(X) #X #define MUMXTEXT(X) #X
#define MUMTEXT(X) MUMXTEXT(X) #define MUMTEXT(X) MUMXTEXT(X)
#ifndef MUMBLE_RELEASE_ID #define MUMBLE_RELEASE MUMTEXT(MUMBLE_VERSION)
# define MUMBLE_RELEASE "Compiled by User"
#else
# define MUMBLE_RELEASE MUMTEXT(MUMBLE_RELEASE_ID)
#endif
namespace Version { namespace Version {