Add optional "multibundle" to version string.

This commit is contained in:
Roman Telezhynskyi 2024-03-28 14:53:26 +02:00
parent 2c72549195
commit d5c260a24d
4 changed files with 22 additions and 9 deletions

View File

@ -402,7 +402,7 @@ macos_task_template: &MACOS_TASK_TEMPLATE
- export CRASH_QT_VERSION=$(/opt/homebrew/opt/qt6/bin/qmake -query QT_VERSION | awk -F. '{print $1 "_" $2}')
- export CRASH_SHORT_SHA=$(git log --pretty=format:%h -n 1)
- curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mozilla/dump_syms/releases/download/v2.3.1/dump_syms-installer.sh | sh
- python3 scripts/symupload.py $CIRRUS_WORKING_DIR/build/install-root $VALENTINA_VERSION $CRASH_SHORT_SHA $CRASH_QT_VERSION --clean
- python3 scripts/symupload.py $CIRRUS_WORKING_DIR/build/install-root $VALENTINA_VERSION $CRASH_SHORT_SHA $CRASH_QT_VERSION --multibundle=$MULTI_BUNDLE --clean
- qbs build -f valentina.qbs -d $CIRRUS_WORKING_DIR/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:$CIRRUS_WORKING_DIR/build/install-root profile:qt6 project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:${ENABLE_CCACHE} moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix xerces-c)/lib/pkgconfig,$(brew --prefix qt6)/lib/pkgconfig,$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:$(brew --prefix qt6)/lib,$(brew --prefix poppler)/lib modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir project.enableConan:true project.conanWithCrashReporting:true project.conanProfiles:valentina
# Store the notarization credentials so that we can prevent a UI password dialog
# from blocking the CI

View File

@ -701,7 +701,7 @@ for:
- export CRASH_QT_VERSION=$($QTDIR/bin/qmake -query QT_VERSION | awk -F. '{print $1 "_" $2}')
- export CRASH_SHORT_SHA=$(git log --pretty=format:%h -n 1)
- curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mozilla/dump_syms/releases/download/v2.3.1/dump_syms-installer.sh | sh
- python3 scripts/symupload.py ${APPVEYOR_BUILD_FOLDER}/build/install-root $VALENTINA_VERSION $CRASH_SHORT_SHA $CRASH_QT_VERSION --clean
- python3 scripts/symupload.py ${APPVEYOR_BUILD_FOLDER}/build/install-root $VALENTINA_VERSION $CRASH_SHORT_SHA $CRASH_QT_VERSION --multibundle=$MULTI_BUNDLE --clean
- qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt6 project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:true moduleProviders.qbspkgconfig.extraPaths:$(brew --prefix xerces-c)/lib/pkgconfig,$(brew --prefix qt6)/lib/pkgconfig,$(brew --prefix openssl@1.1)/lib/pkgconfig "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:$(brew --prefix qt6)/lib,$(brew --prefix poppler)/lib modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir project.enableConan:true project.conanWithCrashReporting:true project.conanProfiles:valentina
# Store the notarization credentials so that we can prevent a UI password dialog
# from blocking the CI
@ -900,7 +900,7 @@ for:
- export CRASH_QT_VERSION=$($QTDIR/bin/qmake -query QT_VERSION | awk -F. '{print $1 "_" $2}')
- export CRASH_SHORT_SHA=$(git log --pretty=format:%h -n 1)
- curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mozilla/dump_syms/releases/download/v2.3.1/dump_syms-installer.sh | sh
- python3 scripts/symupload.py ${APPVEYOR_BUILD_FOLDER}/build/install-root $VALENTINA_VERSION $CRASH_SHORT_SHA $CRASH_QT_VERSION --clean
- python3 scripts/symupload.py ${APPVEYOR_BUILD_FOLDER}/build/install-root $VALENTINA_VERSION $CRASH_SHORT_SHA $CRASH_QT_VERSION --multibundle=$MULTI_BUNDLE --clean
- qbs build -f valentina.qbs -d ${APPVEYOR_BUILD_FOLDER}/build -p 'Valentina DMG' --force-probe-execution --jobs $(nproc) config:release modules.buildconfig.enableUnitTests:false modules.buildconfig.enableMultiBundle:${MULTI_BUNDLE} qbs.installRoot:${APPVEYOR_BUILD_FOLDER}/build/install-root profile:qt5 project.minimumMacosVersion:${MACOS_DEPLOYMENT_TARGET} modules.buildconfig.enableCcache:true "modules.buildconfig.signingIdentity:$MACOS_CERTIFICATE_NAME" modules.macdeployqt.libpath:${QTDIR}/lib modules.macdeployqt.pluginspath:${QTDIR}/plugins modules.macdeployqt.macdeployqtProgramBinPath:${HOME}/macdeployqt-install-dir project.enableConan:true project.conanWithCrashReporting:true project.conanProfiles:valentina
# Store the notarization credentials so that we can prevent a UI password dialog
# from blocking the CI

View File

@ -55,20 +55,25 @@ def generate_sym_files(install_root):
return sym_files
def generate_version_string(val_version, commit_hash, qt_version):
def generate_version_string(val_version, commit_hash, qt_version, multibundle):
# Determine the platform
platform = sys.platform
multibundle_str = ""
if platform == "win32":
platform_str = "windows"
elif platform == "darwin":
platform_str = "macos"
if multibundle:
multibundle_str = "-multibundle"
elif platform == "linux":
platform_str = "linux"
else:
platform_str = "unknown"
# Generate the version string
version_string = f"{val_version}-{commit_hash}-Qt_{qt_version}-{platform_str}"
version_string = f"{val_version}-{commit_hash}-Qt_{qt_version}-{platform_str}{multibundle_str}"
return version_string
def get_app_name(sym_file):
@ -89,7 +94,7 @@ def get_app_name(sym_file):
return base_name
def upload_symbols(install_root, val_version, commit_hash, qt_version, clean=False):
def upload_symbols(install_root, val_version, commit_hash, qt_version, clean=False, multibundle=False):
# Platform-specific commands for generating and uploading symbol files
platform = sys.platform
sym_files = generate_sym_files(install_root)
@ -98,7 +103,7 @@ def upload_symbols(install_root, val_version, commit_hash, qt_version, clean=Fal
print("No symbol files found. Exiting upload process.")
return
app_version = generate_version_string(val_version, commit_hash, qt_version)
app_version = generate_version_string(val_version, commit_hash, qt_version, multibundle)
print(f"Uploading symbols for version {app_version}")
for _, sym_file in sym_files:
@ -141,6 +146,7 @@ if __name__ == "__main__":
# - Third argument: Commit git hash
# - Fourth argument: Qt version
# - Optional argument: --clean (Clean up after upload)
# - Optional argument: --multibundle (Mark multibundle version. Has effect only on macos)
# Parse command-line arguments
parser = argparse.ArgumentParser(description="Upload symbols to BugSplat.")
@ -149,8 +155,11 @@ if __name__ == "__main__":
parser.add_argument("hash", type=str, help="Commit git hash")
parser.add_argument("qt_version", type=str, help="Qt version")
parser.add_argument("--clean", action="store_true", help="Clean up after upload")
parser.add_argument("--multibundle", type=str, default="false", choices=["true", "false"], help="Mark multibundle version. Has effect only on Macos")
args = parser.parse_args()
multibundle = (args.multibundle == "true")
# Call install_package function with provided arguments
upload_symbols(args.install_root, args.val_version, args.hash, args.qt_version, args.clean)
upload_symbols(args.install_root, args.val_version, args.hash, args.qt_version, args.clean, multibundle)

View File

@ -77,9 +77,13 @@ auto AppCrashVersion() -> QString
{
QString const version = QStringLiteral("%1_%2_%3").arg(MAJOR_VERSION).arg(MINOR_VERSION).arg(DEBUG_VERSION);
QString const qtVersion = QStringLiteral("Qt_%1_%2").arg(QT_VERSION_MAJOR).arg(QT_VERSION_MINOR);
QString multibundle; // NOLINT(misc-const-correctness)
#if defined(Q_OS_MACOS)
QString const platform = QStringLiteral("macos");
#if defined(MULTI_BUNDLE)
multibundle = QStringLiteral("-multibundle");
#endif
#elif defined(Q_OS_WIN)
QString const platform = QStringLiteral("windows");
#elif defined(Q_OS_LINUX)
@ -88,7 +92,7 @@ auto AppCrashVersion() -> QString
QString const platform = QStringLiteral("unknown");
#endif
return QStringLiteral("%1-%2-%3-%4").arg(version, VCS_REPO_STATE_REVISION, qtVersion, platform);
return QStringLiteral("%1-%2-%3-%4%5").arg(version, VCS_REPO_STATE_REVISION, qtVersion, platform, multibundle);
}
//---------------------------------------------------------------------------------------------------------------------