From d76a46091717f20fbd8e8c02f06214f25b66abab Mon Sep 17 00:00:00 2001 From: alves Date: Thu, 11 Dec 2025 09:32:14 +0800 Subject: [PATCH 01/11] feature add machine report rate on sentry. --- src/sentry_wrapper/SentryWrapper.cpp | 79 ++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 3 deletions(-) diff --git a/src/sentry_wrapper/SentryWrapper.cpp b/src/sentry_wrapper/SentryWrapper.cpp index 03399d72d1..316f56cce5 100644 --- a/src/sentry_wrapper/SentryWrapper.cpp +++ b/src/sentry_wrapper/SentryWrapper.cpp @@ -26,11 +26,25 @@ #include #include +#include namespace Slic3r { #ifdef SLIC3R_SENTRY +#define SENTRY_EVENT_TRACE "trace" +#define SENTRY_EVENT_DEBUG "info" +#define SENTRY_EVENT_INFO "debug" +#define SENTRY_EVENT_WARNING "warning" +#define SENTRY_EVENT_ERROR "error" +#define SENTRY_EVENT_FATAL "fatal" + +#define MACHINE_MODULE "Moonraker_Mqtt" + +#define SENTRY_KEY_LEVEL "level" + + + static sentry_value_t on_crash_callback(const sentry_ucontext_t* uctx, sentry_value_t event, void* closure) { (void) uctx; @@ -40,6 +54,60 @@ static sentry_value_t on_crash_callback(const sentry_ucontext_t* uctx, sentry_va return event; } +static sentry_value_t before_send(sentry_value_t event, void* hint, void* data) +{ + sentry_value_t level_val = sentry_value_get_by_key(event, SENTRY_KEY_LEVEL); + + std::string eventLevel = sentry_value_as_string(sentry_value_get_by_key(event, SENTRY_KEY_LEVEL)); + + //module name + sentry_value_t logger_val = sentry_value_get_by_key(event, "logger"); + std::string logger = sentry_value_as_string(logger_val); + + if (MACHINE_MODULE == logger) + { + srand((unsigned int) time(0)); + int random_num = rand() % 100; + int randNumber = rand() % 100 + 1; + if (randNumber < 85) + { + sentry_value_decref(event); + return sentry_value_new_null(); + } + else + { + return event; + } + } + + if (SENTRY_EVENT_FATAL == eventLevel || + SENTRY_EVENT_ERROR == eventLevel || + SENTRY_EVENT_TRACE == eventLevel) + { + return event; + } + else if (SENTRY_EVENT_WARNING == eventLevel) + { + srand((unsigned int) time(0)); + int random_num = rand() % 100; + int randNumber = rand() % 100 + 1; + if (randNumber > 5) + { + sentry_value_decref(event); + return sentry_value_new_null(); + } + else + { + return event; + } + } + + //info trace debug not report + sentry_value_decref(event); + return sentry_value_new_null(); + +} + void initSentryEx() { sentry_options_t* options = sentry_options_new(); @@ -130,7 +198,7 @@ void initSentryEx() sentry_options_set_auto_session_tracking(options, 0); sentry_options_set_symbolize_stacktraces(options, 1); sentry_options_set_on_crash(options, on_crash_callback, NULL); - sentry_options_set_before_send(options, NULL, NULL); + sentry_options_set_before_send(options, before_send, NULL); sentry_options_set_sample_rate(options, 1.0); sentry_options_set_traces_sample_rate(options, 1.0); @@ -138,6 +206,7 @@ void initSentryEx() sentry_init(options); sentry_start_session(); + sentryReportLog(SENTRY_LOG_ERROR, "init sentry error", "initSentry module"); } } @@ -181,9 +250,13 @@ void sentryReportLogEx(SENTRY_LOG_LEVEL logLevel, funcModule.c_str(), logContent.c_str() ); + + if (!logTraceId.empty()) + { + sentry_value_t tags = sentry_value_get_by_key(event, "snapmaker_tags"); + sentry_value_set_by_key(tags, "snapmaker_trace_id", sentry_value_new_string(logTraceId.c_str())); + } - if (!logTraceId.empty()) - sentry_set_trace(logTraceId.c_str(), ""); if (!logTagKey.empty()) sentry_set_tag(logTagKey.c_str(), logTagValue.c_str()); From c5e8bd2b1ea7bc5134dbeb8fdd658029a8062500 Mon Sep 17 00:00:00 2001 From: alves Date: Thu, 11 Dec 2025 09:35:19 +0800 Subject: [PATCH 02/11] feature add sentry cli function for mac os --- .github/workflows/build_deps.yml | 3 ++- .github/workflows/build_orca.yml | 8 ++++++ .github/workflows/sentry_cli.yml | 46 ++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_deps.yml b/.github/workflows/build_deps.yml index 6cd71744b1..1a31b91e49 100644 --- a/.github/workflows/build_deps.yml +++ b/.github/workflows/build_deps.yml @@ -159,5 +159,6 @@ jobs: with: os: ${{ inputs.os }} pdb-artifact-name: PDB - release: ${{ github.sha }} + dsym-artifact-name: ${{ inputs.os == 'macos-14' && format('dSYM_Mac_{0}', needs.build_orca.outputs.release) || '' }} + release: ${{ needs.build_orca.outputs.release || github.sha }} secrets: inherit \ No newline at end of file diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index b9411fd28d..76a92bfc86 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -204,6 +204,14 @@ jobs: path: ${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg if-no-files-found: ignore + - name: Upload dSYM artifacts mac + if: inputs.os == 'macos-14' + uses: actions/upload-artifact@v4 + with: + name: dSYM_Mac_${{ env.ver }} + path: ${{ github.workspace }}/build/universal/Snapmaker_Orca/dSYM + if-no-files-found: ignore + - name: Deploy Mac release if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.2.0') && inputs.os == 'macos-14' uses: WebFreak001/deploy-nightly@v3.2.0 diff --git a/.github/workflows/sentry_cli.yml b/.github/workflows/sentry_cli.yml index 0693fab2a0..869f5943a5 100644 --- a/.github/workflows/sentry_cli.yml +++ b/.github/workflows/sentry_cli.yml @@ -11,6 +11,10 @@ on: required: false type: string description: "Artifact name for Windows PDB archive (e.g., 'PDB')" + dsym-artifact-name: + required: false + type: string + description: "Artifact name for macOS dSYM archive (e.g., 'dSYM_Mac_V1.0.0')" release: required: true type: string @@ -86,7 +90,49 @@ jobs: } # ==================== macOS ==================== + - name: "[macOS] Install sentry-cli via brew" + if: inputs.os == 'macos-14' + run: | + brew install getsentry/tap/sentry-cli || true + sentry-cli --version + - name: "[macOS] Download dSYM artifact" + if: inputs.os == 'macos-14' + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.dsym-artifact-name }} + path: ./symbols + + - name: "[macOS] Upload dSYM to Sentry (sentry-cli)" + if: inputs.os == 'macos-14' + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_LOG_LEVEL: debug + run: | + echo "Checking for dSYM files in ./symbols..." + find ./symbols -name "*.dSYM" -type d | while read dsym; do + echo "Found dSYM: $dsym" + done + + dsymCount=$(find ./symbols -name "*.dSYM" -type d | wc -l | tr -d ' ') + if [ "$dsymCount" -gt 0 ]; then + echo "Found $dsymCount dSYM file(s) to upload from ./symbols:" + find ./symbols -name "*.dSYM" -type d | while read dsym; do + echo " - $dsym" + done + echo "" + echo "Starting Sentry upload with debug logging..." + sentry-cli --log-level=debug --auth-token "$SENTRY_AUTH_TOKEN" upload-dif --org "${{ secrets.SENTRY_ORG }}" --project "${{ secrets.SENTRY_PROJECT }}" --release "${{ inputs.release }}" ./symbols + if [ $? -ne 0 ]; then + echo "::error::Sentry upload failed with exit code $?" + exit 1 + fi + else + echo "::error::No dSYM files found in ./symbols" + echo "Contents of ./symbols:" + find ./symbols -type f -o -type d | head -20 + exit 1 + fi # ==================== Linux ==================== From 371545fe153081cd3382aaa71552c2078fd13f0e Mon Sep 17 00:00:00 2001 From: alves Date: Thu, 11 Dec 2025 11:53:49 +0800 Subject: [PATCH 03/11] fix sentry cli install fail on mac os --- .github/workflows/sentry_cli.yml | 33 +++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sentry_cli.yml b/.github/workflows/sentry_cli.yml index 869f5943a5..8ec47540ba 100644 --- a/.github/workflows/sentry_cli.yml +++ b/.github/workflows/sentry_cli.yml @@ -90,11 +90,38 @@ jobs: } # ==================== macOS ==================== - - name: "[macOS] Install sentry-cli via brew" + - name: "[macOS] Install sentry-cli" if: inputs.os == 'macos-14' run: | - brew install getsentry/tap/sentry-cli || true - sentry-cli --version + # Try multiple installation methods for reliability + # Method 1: Official install script (most reliable) + if ! command -v sentry-cli &> /dev/null; then + echo "Installing sentry-cli via official script..." + curl -sL https://sentry.io/get-cli/ | bash || true + fi + + # Method 2: npm fallback + if ! command -v sentry-cli &> /dev/null; then + echo "Official script failed, trying npm..." + npm install -g @sentry/cli || true + fi + + # Method 3: Direct binary download fallback + if ! command -v sentry-cli &> /dev/null; then + echo "npm failed, downloading binary directly..." + SENTRY_CLI_VERSION=$(curl -s https://api.github.com/repos/getsentry/sentry-cli/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + curl -sL "https://github.com/getsentry/sentry-cli/releases/download/${SENTRY_CLI_VERSION}/sentry-cli-Darwin-universal" -o /usr/local/bin/sentry-cli + chmod +x /usr/local/bin/sentry-cli + fi + + # Verify installation + if command -v sentry-cli &> /dev/null; then + echo "sentry-cli installed successfully:" + sentry-cli --version + else + echo "::error::Failed to install sentry-cli via all methods" + exit 1 + fi - name: "[macOS] Download dSYM artifact" if: inputs.os == 'macos-14' From f7efe0dfc3bcaa973a6d71249e311a7d1f2b3947 Mon Sep 17 00:00:00 2001 From: alves Date: Thu, 11 Dec 2025 15:30:49 +0800 Subject: [PATCH 04/11] feature create mac os dsym and upload server --- .github/workflows/build_orca.yml | 2 +- CMakeLists.txt | 7 ++ build_release_macos.sh | 125 +++++++++++++++---------------- 3 files changed, 69 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index 76a92bfc86..5e00ad4f5c 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -210,7 +210,7 @@ jobs: with: name: dSYM_Mac_${{ env.ver }} path: ${{ github.workspace }}/build/universal/Snapmaker_Orca/dSYM - if-no-files-found: ignore + if-no-files-found: warn - name: Deploy Mac release if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.2.0') && inputs.os == 'macos-14' diff --git a/CMakeLists.txt b/CMakeLists.txt index cc83da3582..590cbb2645 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -404,6 +404,13 @@ endif () if (APPLE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=partial-availability -Werror=unguarded-availability -Werror=unguarded-availability-new") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=partial-availability -Werror=unguarded-availability -Werror=unguarded-availability-new") + + # Generate debug symbols for Release builds on macOS (required for dSYM generation and Sentry crash reporting) + # This adds -g flag to produce DWARF debug info that dsymutil can extract + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -g") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -g") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g") endif () if(MSVC) diff --git a/build_release_macos.sh b/build_release_macos.sh index 59152caccd..16d86e36a5 100755 --- a/build_release_macos.sh +++ b/build_release_macos.sh @@ -265,39 +265,38 @@ function build_slicer() { find ./Snapmaker_Orca_profile_validator.app/ -name '.DS_Store' -delete fi - # Generate dSYM debug symbols for Sentry crash reporting - if [ "$SLIC3R_SENTRY" = "1" ]; then - echo "Generating dSYM debug symbols..." - DSYM_DIR="./dSYM" - mkdir -p "${DSYM_DIR}" - - # Generate dSYM for main app - if [ -f "${APP_MACOS_DIR}/Snapmaker_Orca" ]; then - echo "Generating dSYM for Snapmaker_Orca..." - dsymutil "${APP_MACOS_DIR}/Snapmaker_Orca" -o "${DSYM_DIR}/Snapmaker_Orca.dSYM" - fi - - # Generate dSYM for crashpad_handler if it exists - if [ -f "${APP_MACOS_DIR}/crashpad_handler" ]; then - echo "Generating dSYM for crashpad_handler..." - dsymutil "${APP_MACOS_DIR}/crashpad_handler" -o "${DSYM_DIR}/crashpad_handler.dSYM" - fi - - # Generate dSYM for libsentry.dylib if it exists - if [ -f "${APP_FRAMEWORKS_DIR}/libsentry.dylib" ]; then - echo "Generating dSYM for libsentry.dylib..." - dsymutil "${APP_FRAMEWORKS_DIR}/libsentry.dylib" -o "${DSYM_DIR}/libsentry.dSYM" - fi - - # Generate dSYM for profile_validator if it exists - if [ -f "./Snapmaker_Orca_profile_validator.app/Contents/MacOS/Snapmaker_Orca_profile_validator" ]; then - echo "Generating dSYM for Snapmaker_Orca_profile_validator..." - dsymutil "./Snapmaker_Orca_profile_validator.app/Contents/MacOS/Snapmaker_Orca_profile_validator" -o "${DSYM_DIR}/Snapmaker_Orca_profile_validator.dSYM" - fi - - echo "dSYM files generated in ${DSYM_DIR}" - ls -la "${DSYM_DIR}" + # Generate dSYM debug symbols for debugging and Sentry crash reporting + # Always generate dSYM files - they are useful for crash analysis even without Sentry + echo "Generating dSYM debug symbols..." + DSYM_DIR="./dSYM" + mkdir -p "${DSYM_DIR}" + + # Generate dSYM for main app + if [ -f "${APP_MACOS_DIR}/Snapmaker_Orca" ]; then + echo "Generating dSYM for Snapmaker_Orca..." + dsymutil "${APP_MACOS_DIR}/Snapmaker_Orca" -o "${DSYM_DIR}/Snapmaker_Orca.dSYM" 2>/dev/null || echo "Warning: Failed to generate dSYM for Snapmaker_Orca (no debug symbols?)" fi + + # Generate dSYM for crashpad_handler if it exists + if [ -f "${APP_MACOS_DIR}/crashpad_handler" ]; then + echo "Generating dSYM for crashpad_handler..." + dsymutil "${APP_MACOS_DIR}/crashpad_handler" -o "${DSYM_DIR}/crashpad_handler.dSYM" 2>/dev/null || true + fi + + # Generate dSYM for libsentry.dylib if it exists + if [ -f "${APP_FRAMEWORKS_DIR}/libsentry.dylib" ]; then + echo "Generating dSYM for libsentry.dylib..." + dsymutil "${APP_FRAMEWORKS_DIR}/libsentry.dylib" -o "${DSYM_DIR}/libsentry.dSYM" 2>/dev/null || true + fi + + # Generate dSYM for profile_validator if it exists + if [ -f "./Snapmaker_Orca_profile_validator.app/Contents/MacOS/Snapmaker_Orca_profile_validator" ]; then + echo "Generating dSYM for Snapmaker_Orca_profile_validator..." + dsymutil "./Snapmaker_Orca_profile_validator.app/Contents/MacOS/Snapmaker_Orca_profile_validator" -o "${DSYM_DIR}/Snapmaker_Orca_profile_validator.dSYM" 2>/dev/null || true + fi + + echo "dSYM files generated in ${DSYM_DIR}" + ls -la "${DSYM_DIR}" 2>/dev/null || echo "No dSYM files generated" ) # extract version @@ -394,39 +393,37 @@ function build_universal() { echo "Universal binary for Snapmaker_Orca_profile_validator created at $UNIVERSAL_VALIDATOR_APP" fi - # Generate dSYM for universal binary if Sentry is enabled - if [ "$SLIC3R_SENTRY" = "1" ]; then - echo "Generating dSYM for universal binary..." - DSYM_DIR="$PROJECT_BUILD_DIR/Snapmaker_Orca/dSYM" - mkdir -p "${DSYM_DIR}" - - # Generate dSYM for universal main app - if [ -f "$UNIVERSAL_APP/$BINARY_PATH" ]; then - echo "Generating dSYM for universal Snapmaker_Orca..." - dsymutil "$UNIVERSAL_APP/$BINARY_PATH" -o "${DSYM_DIR}/Snapmaker_Orca.dSYM" - fi - - # Generate dSYM for universal crashpad_handler if it exists - if [ -f "$UNIVERSAL_APP/Contents/MacOS/crashpad_handler" ]; then - echo "Generating dSYM for universal crashpad_handler..." - dsymutil "$UNIVERSAL_APP/Contents/MacOS/crashpad_handler" -o "${DSYM_DIR}/crashpad_handler.dSYM" - fi - - # Generate dSYM for universal libsentry.dylib if it exists - if [ -f "$UNIVERSAL_APP/Contents/Frameworks/libsentry.dylib" ]; then - echo "Generating dSYM for universal libsentry.dylib..." - dsymutil "$UNIVERSAL_APP/Contents/Frameworks/libsentry.dylib" -o "${DSYM_DIR}/libsentry.dSYM" - fi - - # Generate dSYM for universal profile_validator if it exists - if [ -f "$UNIVERSAL_VALIDATOR_APP/$VALIDATOR_BINARY_PATH" ]; then - echo "Generating dSYM for universal Snapmaker_Orca_profile_validator..." - dsymutil "$UNIVERSAL_VALIDATOR_APP/$VALIDATOR_BINARY_PATH" -o "${DSYM_DIR}/Snapmaker_Orca_profile_validator.dSYM" - fi - - echo "Universal dSYM files generated in ${DSYM_DIR}" - ls -la "${DSYM_DIR}" + # Generate dSYM for universal binary - always generate for debugging and Sentry crash reporting + echo "Generating dSYM for universal binary..." + DSYM_DIR="$PROJECT_BUILD_DIR/Snapmaker_Orca/dSYM" + mkdir -p "${DSYM_DIR}" + + # Generate dSYM for universal main app + if [ -f "$UNIVERSAL_APP/$BINARY_PATH" ]; then + echo "Generating dSYM for universal Snapmaker_Orca..." + dsymutil "$UNIVERSAL_APP/$BINARY_PATH" -o "${DSYM_DIR}/Snapmaker_Orca.dSYM" 2>/dev/null || echo "Warning: Failed to generate dSYM for universal Snapmaker_Orca" fi + + # Generate dSYM for universal crashpad_handler if it exists + if [ -f "$UNIVERSAL_APP/Contents/MacOS/crashpad_handler" ]; then + echo "Generating dSYM for universal crashpad_handler..." + dsymutil "$UNIVERSAL_APP/Contents/MacOS/crashpad_handler" -o "${DSYM_DIR}/crashpad_handler.dSYM" 2>/dev/null || true + fi + + # Generate dSYM for universal libsentry.dylib if it exists + if [ -f "$UNIVERSAL_APP/Contents/Frameworks/libsentry.dylib" ]; then + echo "Generating dSYM for universal libsentry.dylib..." + dsymutil "$UNIVERSAL_APP/Contents/Frameworks/libsentry.dylib" -o "${DSYM_DIR}/libsentry.dSYM" 2>/dev/null || true + fi + + # Generate dSYM for universal profile_validator if it exists + if [ -f "$UNIVERSAL_VALIDATOR_APP/$VALIDATOR_BINARY_PATH" ]; then + echo "Generating dSYM for universal Snapmaker_Orca_profile_validator..." + dsymutil "$UNIVERSAL_VALIDATOR_APP/$VALIDATOR_BINARY_PATH" -o "${DSYM_DIR}/Snapmaker_Orca_profile_validator.dSYM" 2>/dev/null || true + fi + + echo "Universal dSYM files generated in ${DSYM_DIR}" + ls -la "${DSYM_DIR}" 2>/dev/null || echo "No dSYM files generated" } case "${BUILD_TARGET}" in From 9006902bb06152ce001abd6b3d019d7c22fe23d8 Mon Sep 17 00:00:00 2001 From: alves Date: Thu, 11 Dec 2025 17:56:14 +0800 Subject: [PATCH 05/11] feature add retry to download sentry sdk --- deps/Sentry/Sentry.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/deps/Sentry/Sentry.cmake b/deps/Sentry/Sentry.cmake index f636281dbe..138580b24f 100644 --- a/deps/Sentry/Sentry.cmake +++ b/deps/Sentry/Sentry.cmake @@ -82,6 +82,7 @@ endif() Snapmaker_Orca_add_cmake_project(Sentry GIT_REPOSITORY https://github.com/getsentry/sentry-native.git GIT_TAG 0.12.1 + GIT_SHALLOW ON PATCH_COMMAND ${SENTRY_PATCH_COMMAND} CMAKE_ARGS ${_sentry_cmake_generator} From 59b2e59ca0b5d057251606f118ac774c72d7b8ff Mon Sep 17 00:00:00 2001 From: alves Date: Fri, 12 Dec 2025 14:41:21 +0800 Subject: [PATCH 06/11] fix github action not get the correct path for mac dsym bug --- .github/workflows/build_orca.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index 5e00ad4f5c..5f6952f7e4 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -13,6 +13,10 @@ on: arch: required: false type: string + outputs: + release: + description: "Release version/tag for the build" + value: ${{ jobs.build_orca.outputs.release }} jobs: build_orca: From 7370dca2cac50f399cb7bd0c4a8312b8c28eab07 Mon Sep 17 00:00:00 2001 From: alves Date: Fri, 12 Dec 2025 17:25:26 +0800 Subject: [PATCH 07/11] fix mac os sentry cli upload dsym error bug --- .github/workflows/sentry_cli.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sentry_cli.yml b/.github/workflows/sentry_cli.yml index 8ec47540ba..f72f2d9fb1 100644 --- a/.github/workflows/sentry_cli.yml +++ b/.github/workflows/sentry_cli.yml @@ -149,7 +149,11 @@ jobs: done echo "" echo "Starting Sentry upload with debug logging..." - sentry-cli --log-level=debug --auth-token "$SENTRY_AUTH_TOKEN" upload-dif --org "${{ secrets.SENTRY_ORG }}" --project "${{ secrets.SENTRY_PROJECT }}" --release "${{ inputs.release }}" ./symbols + # upload-dif does not support --release flag, it auto-associates with releases + sentry-cli --log-level=debug --auth-token "$SENTRY_AUTH_TOKEN" upload-dif \ + --org "${{ secrets.SENTRY_ORG }}" \ + --project "${{ secrets.SENTRY_PROJECT }}" \ + ./symbols if [ $? -ne 0 ]; then echo "::error::Sentry upload failed with exit code $?" exit 1 From b2b8be7302405cdb069f188e206c4ae3c3beed91 Mon Sep 17 00:00:00 2001 From: alves Date: Mon, 15 Dec 2025 09:44:20 +0800 Subject: [PATCH 08/11] fix too blank and not work correct bug --- .github/workflows/sentry_cli.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sentry_cli.yml b/.github/workflows/sentry_cli.yml index f72f2d9fb1..3470cb0fca 100644 --- a/.github/workflows/sentry_cli.yml +++ b/.github/workflows/sentry_cli.yml @@ -150,12 +150,10 @@ jobs: echo "" echo "Starting Sentry upload with debug logging..." # upload-dif does not support --release flag, it auto-associates with releases - sentry-cli --log-level=debug --auth-token "$SENTRY_AUTH_TOKEN" upload-dif \ - --org "${{ secrets.SENTRY_ORG }}" \ - --project "${{ secrets.SENTRY_PROJECT }}" \ - ./symbols - if [ $? -ne 0 ]; then - echo "::error::Sentry upload failed with exit code $?" + sentry-cli --log-level=debug --auth-token "$SENTRY_AUTH_TOKEN" upload-dif --org "${{ secrets.SENTRY_ORG }}" --project "${{ secrets.SENTRY_PROJECT }}" ./symbols + UPLOAD_EXIT_CODE=$? + if [ $UPLOAD_EXIT_CODE -ne 0 ]; then + echo "::error::Sentry upload failed with exit code $UPLOAD_EXIT_CODE" exit 1 fi else From 3cb6f3a094a98e217b2f9f66c9ea80520b060269 Mon Sep 17 00:00:00 2001 From: alves Date: Mon, 15 Dec 2025 16:09:32 +0800 Subject: [PATCH 09/11] feature merge the sentry mac and win on the sentry server --- .github/workflows/build_deps.yml | 30 ++++++++++++++-------------- src/sentry_wrapper/SentryWrapper.cpp | 8 +++----- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build_deps.yml b/.github/workflows/build_deps.yml index 1a31b91e49..b3d065236a 100644 --- a/.github/workflows/build_deps.yml +++ b/.github/workflows/build_deps.yml @@ -115,7 +115,7 @@ jobs: tar -czvf OrcaSlicer_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir - # Upload Artifacts + # Upload Artifacts (commented out to reduce artifact storage usage) # - name: Upload Mac ${{ inputs.arch }} artifacts # if: inputs.os == 'macos-14' # uses: actions/upload-artifact@v4 @@ -123,21 +123,21 @@ jobs: # name: OrcaSlicer_dep_mac_${{ env.date }} # path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.tar.gz - - name: Upload Windows artifacts - if: inputs.os == 'windows-latest' - uses: actions/upload-artifact@v4 - with: - name: OrcaSlicer_dep_win64_${{ env.date }} - path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip + # - name: Upload Windows artifacts + # if: inputs.os == 'windows-latest' + # uses: actions/upload-artifact@v4 + # with: + # name: OrcaSlicer_dep_win64_${{ env.date }} + # path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip - - name: Upload Ubuntu artifacts - if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }} - env: - ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }} - uses: actions/upload-artifact@v4 - with: - name: OrcaSlicer_dep_ubuntu_${{ env.ubuntu-ver }}_${{ env.date }} - path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz + # - name: Upload Ubuntu artifacts + # if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }} + # env: + # ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }} + # uses: actions/upload-artifact@v4 + # with: + # name: OrcaSlicer_dep_ubuntu_${{ env.ubuntu-ver }}_${{ env.date }} + # path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz build_orca: name: Build Snapmaker_Orca diff --git a/src/sentry_wrapper/SentryWrapper.cpp b/src/sentry_wrapper/SentryWrapper.cpp index 316f56cce5..3dfcb60712 100644 --- a/src/sentry_wrapper/SentryWrapper.cpp +++ b/src/sentry_wrapper/SentryWrapper.cpp @@ -111,14 +111,12 @@ static sentry_value_t before_send(sentry_value_t event, void* hint, void* data) void initSentryEx() { sentry_options_t* options = sentry_options_new(); - std::string dsn = ""; + std::string dsn = std::string("https://c74b617c2aedc291444d3a238d23e780@o4508125599563776.ingest.us.sentry.io/4510425163956224"); { -#ifdef __APPLE__ - - std::string dsn = std::string("https://ac473187efb8877f36bd31694ffd5dec@o4508125599563776.ingest.us.sentry.io/4510425212059648"); +#ifdef __APPLE__ #elif _WIN32 - std::string dsn = std::string("https://c74b617c2aedc291444d3a238d23e780@o4508125599563776.ingest.us.sentry.io/4510425163956224"); + #endif sentry_options_set_dsn(options, dsn.c_str()); std::string handlerDir = ""; From c0779cbd28950cfbcef971940cf7f1f8f537d307 Mon Sep 17 00:00:00 2001 From: alves Date: Mon, 15 Dec 2025 17:44:01 +0800 Subject: [PATCH 10/11] fix mac version not correct bug --- .github/workflows/build_orca.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index 5f6952f7e4..8b0489360a 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -122,7 +122,7 @@ jobs: # Thanks to RaySajuuk, it's working now - name: Sign app and notary - if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || github.ref == 'refs/heads/2.2.0') && inputs.os == 'macos-14' + if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || github.ref == 'refs/heads/2.2.1') && inputs.os == 'macos-14' working-directory: ${{ github.workspace }} env: BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} @@ -175,7 +175,7 @@ jobs: fi - name: Create DMG without notary - if: github.ref != 'refs/heads/main' && inputs.os == 'macos-14' && github.ref != 'refs/heads/2.2.0' + if: github.ref != 'refs/heads/main' && inputs.os == 'macos-14' && github.ref != 'refs/heads/2.2.1' working-directory: ${{ github.workspace }} run: | mkdir -p ${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg @@ -217,7 +217,7 @@ jobs: if-no-files-found: warn - name: Deploy Mac release - if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.2.0') && inputs.os == 'macos-14' + if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.2.1') && inputs.os == 'macos-14' uses: WebFreak001/deploy-nightly@v3.2.0 with: upload_url: https://uploads.github.com/repos/Snapmaker/OrcaSlicer/releases/169912305/assets{?name,label} @@ -228,7 +228,7 @@ jobs: max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted - name: Check if profile validator DMG exists - if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.2.0') && inputs.os == 'macos-14' + if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.2.1') && inputs.os == 'macos-14' id: check_dmg working-directory: ${{ github.workspace }} run: | @@ -242,7 +242,7 @@ jobs: shell: bash - name: Deploy Mac Snapmaker_Orca_profile_validator DMG release - if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.2.0') && inputs.os == 'macos-14' && steps.check_dmg.outputs.exists == 'true' + if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.2.1') && inputs.os == 'macos-14' && steps.check_dmg.outputs.exists == 'true' uses: WebFreak001/deploy-nightly@v3.2.0 with: upload_url: https://uploads.github.com/repos/Snapmaker/OrcaSlicer/releases/169912305/assets{?name,label} @@ -386,7 +386,7 @@ jobs: chmod +x ./build/Snapmaker_Orca_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage - name: Build orca_custom_preset_tests - if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.2.0') && inputs.os == 'ubuntu-24.04' + if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.2.1') && inputs.os == 'ubuntu-24.04' working-directory: ${{ github.workspace }}/build/src/Release shell: bash run: | @@ -426,7 +426,7 @@ jobs: asset_content_type: application/octet-stream max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted - name: Deploy Ubuntu release - if: ${{ ! env.ACT && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.2.0') && inputs.os == 'ubuntu-24.04' }} + if: ${{ ! env.ACT && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.2.1') && inputs.os == 'ubuntu-24.04' }} uses: rickstaa/action-create-tag@v1 with: tag: "nightly-builds" From 6127d35676a1aa8692c631464216e980950adf57 Mon Sep 17 00:00:00 2001 From: alves Date: Mon, 15 Dec 2025 17:46:15 +0800 Subject: [PATCH 11/11] feature remove test code. --- src/sentry_wrapper/SentryWrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentry_wrapper/SentryWrapper.cpp b/src/sentry_wrapper/SentryWrapper.cpp index 3dfcb60712..0b2224adb5 100644 --- a/src/sentry_wrapper/SentryWrapper.cpp +++ b/src/sentry_wrapper/SentryWrapper.cpp @@ -204,7 +204,7 @@ void initSentryEx() sentry_init(options); sentry_start_session(); - sentryReportLog(SENTRY_LOG_ERROR, "init sentry error", "initSentry module"); + //sentryReportLog(SENTRY_LOG_ERROR, "init sentry error", "initSentry module"); } }