From d5c260a24d37c32cec11f31af489b9125ad295f5 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 28 Mar 2024 14:53:26 +0200 Subject: [PATCH] Add optional "multibundle" to version string. --- .cirrus.yml | 2 +- appveyor.yml | 4 ++-- scripts/symupload.py | 19 ++++++++++++++----- src/libs/vmisc/crashhandler/crashhandler.cpp | 6 +++++- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 300877e3e..91ec85bed 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -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 diff --git a/appveyor.yml b/appveyor.yml index 120a4b35e..7a41d0f1b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 diff --git a/scripts/symupload.py b/scripts/symupload.py index f45d9843e..7b9bb2484 100644 --- a/scripts/symupload.py +++ b/scripts/symupload.py @@ -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) diff --git a/src/libs/vmisc/crashhandler/crashhandler.cpp b/src/libs/vmisc/crashhandler/crashhandler.cpp index 43acc65e7..9f25e305c 100644 --- a/src/libs/vmisc/crashhandler/crashhandler.cpp +++ b/src/libs/vmisc/crashhandler/crashhandler.cpp @@ -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); } //---------------------------------------------------------------------------------------------------------------------