Skip to content

Commit ae8f31d

Browse files
committed
Merge tag 'rel-emu' into emu
2 parents d90734f + 2b1e293 commit ae8f31d

18 files changed

Lines changed: 204 additions & 51 deletions

File tree

.github/workflows/build_release_shared.yaml

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818

1919
env:
2020
platform: "${{ inputs.client_target == 'emu' && 'Win32' || 'x64' }}"
21+
scoop_packages: "sentry-cli"
2122

2223
jobs:
2324
build:
@@ -135,6 +136,56 @@ jobs:
135136
}
136137
$resourceFile | Set-Content $resourceFilePath
137138
139+
- name: Check Scoop Installation
140+
id: check_scoop
141+
shell: pwsh
142+
run: |
143+
$scoopPath = "$env:USERPROFILE\scoop"
144+
$packages = "${{ env.scoop_packages }}" -split '\s+'
145+
$allInstalled = $true
146+
147+
if (Test-Path $scoopPath) {
148+
foreach ($pkg in $packages) {
149+
if (-not (Test-Path "$scoopPath\apps\$pkg")) {
150+
$allInstalled = $false
151+
break
152+
}
153+
}
154+
} else {
155+
$allInstalled = $false
156+
}
157+
158+
$hash = (Get-FileHash -InputStream ([IO.MemoryStream]::new([Text.Encoding]::UTF8.GetBytes("${{ env.scoop_packages }}"))) -Algorithm SHA256).Hash.Substring(0,16)
159+
160+
echo "scoop_ready=$allInstalled" >> $env:GITHUB_OUTPUT
161+
echo "scoop_packages_hash=$hash" >> $env:GITHUB_OUTPUT
162+
163+
- name: Restore Scoop Cache
164+
if: steps.check_scoop.outputs.scoop_ready != 'true'
165+
id: restore_scoop_cache
166+
uses: actions/cache@v4
167+
with:
168+
path: '~/scoop'
169+
key: ${{ runner.os }}-scoop-${{ steps.check_scoop.outputs.scoop_packages_hash }}
170+
171+
- name: Install Scoop
172+
if: steps.check_scoop.outputs.scoop_ready != 'true' && steps.restore_scoop_cache.outputs.cache-hit != 'true'
173+
uses: MinoruSekine/setup-scoop@v4.0.2
174+
with:
175+
install_scoop: 'true'
176+
buckets: extras
177+
apps: ${{ env.scoop_packages }}
178+
scoop_update: 'true'
179+
update_path: 'true'
180+
181+
- name: Setup Scoop PATH
182+
if: steps.check_scoop.outputs.scoop_ready != 'true' && steps.restore_scoop_cache.outputs.cache-hit == 'true'
183+
uses: MinoruSekine/setup-scoop@v4.0.2
184+
with:
185+
install_scoop: 'false'
186+
scoop_update: 'false'
187+
update_path: 'true'
188+
138189
- name: Setup MSBuild
139190
uses: microsoft/setup-msbuild@v2
140191
with:
@@ -147,8 +198,19 @@ jobs:
147198
run: |
148199
nuget restore src/MacroQuestCustom.sln
149200
150-
- name: Handle vcpkg Cache
151-
if: false # Disabled for build server speed improvements
201+
- name: Check vcpkg Installation
202+
id: check_vcpkg
203+
shell: pwsh
204+
run: |
205+
$installedPath = "${{ github.workspace }}/contrib/vcpkg/installed"
206+
if ((Test-Path $installedPath) -and (Get-ChildItem $installedPath -Directory | Measure-Object).Count -gt 0) {
207+
echo "vcpkg_installed=true" >> $env:GITHUB_OUTPUT
208+
} else {
209+
echo "vcpkg_installed=false" >> $env:GITHUB_OUTPUT
210+
}
211+
212+
- name: Restore vcpkg Cache
213+
if: steps.check_vcpkg.outputs.vcpkg_installed != 'true'
152214
uses: actions/cache@v4
153215
with:
154216
path: |
@@ -172,6 +234,15 @@ jobs:
172234
- name: Create Symbols Archive
173235
run: 7z a -tzip -r build/bin/MacroQuest-Symbols.zip build/bin/Release/*.exe build/bin/Release/*.dll build/bin/Release/*.pdb
174236

237+
- name: Upload Symbols to Sentry
238+
env:
239+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
240+
SENTRY_ORG: macroquest
241+
SENTRY_PROJECT: macroquest
242+
shell: pwsh
243+
run: |
244+
sentry-cli debug-files upload --wait "${{ github.workspace }}\build\bin\Release"
245+
175246
- name: Upload Symbols Artifact
176247
uses: actions/upload-artifact@v4
177248
with:

data/resources/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 3/1/2026
2+
3+
Updated to crashpad from the crashpad-backtrace fork we were previously using.
4+
- For local builders you should remove crashpad-backtrace to prevent conflicts
5+
- `vcpkg remove crashpad-backtrace:x64-windows-static` and/or `vcpkg remove crashpad-backtrace:x86-windows-static`
6+
7+
### Bug fixes
8+
9+
- live/test: Fix /removeaug (#974)
10+
- emu: Fix CTargetWnd buff accessor (#975)
11+
12+
113
## 2/22/2026
214

315
### ImAnim Integration

include/config/crashpad.h.example

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
//
22
// To enable automatic submissions, remove the .example extension from
3-
// this header and set the submissions url to your crashpad submission endpoint.
3+
// this header and set the submission values for your crash backend.
44
//
55

66
#pragma once
77

88
// Enables crashpad submissions
99
#define CRASHPAD_SUBMISSIONS_ENABLED true
1010

11-
// The submission URL used for submitting crash reports
11+
// Optional environment annotation.
12+
// #define CRASHPAD_SUBMISSION_ENVIRONMENT "production"
13+
14+
// Crashpad submission endpoint URL.
15+
// Example: https://crash-reports.example.com/minidump
1216
#define CRASHPAD_SUBMISSIONS_URL ""
1317

1418
// Enables the rate limit for crash submissions (1/hour)

src/eqlib

src/loader/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated from MacroQuest.vcxproj
1+
# Generated from MacroQuest.vcxproj
22
# This file is designed to work with add_subdirectory()
33

44
# ---------------------------------------------------------------------
@@ -114,7 +114,7 @@ target_link_libraries(MacroQuest PRIVATE imgui login routing)
114114
# Include directories
115115
# ---------------------------------------------------------------------
116116
target_include_directories(MacroQuest PRIVATE
117-
"${VCPKG_IncludeStatic}/crashpad-backtrace"
117+
"${VCPKG_IncludeStatic}/crashpad"
118118
"${CMAKE_SOURCE_DIR}/include"
119119
)
120120

src/loader/Crashpad.cpp

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
#if !defined(CRASHPAD_SUBMISSIONS_RATELIMITED)
5151
#define CRASHPAD_SUBMISSIONS_RATELIMITED true
5252
#endif
53+
#if !defined(CRASHPAD_SUBMISSION_PRODUCT)
54+
#define CRASHPAD_SUBMISSION_PRODUCT "MQ Loader"
55+
#endif
56+
#if !defined(CRASHPAD_SUBMISSION_ENVIRONMENT)
57+
#define CRASHPAD_SUBMISSION_ENVIRONMENT "unknown"
58+
#endif
5359

5460
using namespace crashpad;
5561
CrashpadClient client;
@@ -85,6 +91,24 @@ bool InitializeCrashpad()
8591
}
8692

8793
std::map<std::string, std::string> annotations;
94+
annotations["format"] = "minidump";
95+
const std::string product = CRASHPAD_SUBMISSION_PRODUCT;
96+
if (!product.empty())
97+
{
98+
annotations["product"] = product;
99+
}
100+
annotations["version"] = MQMAIN_VERSION;
101+
std::string release = MQMAIN_VERSION;
102+
if (!product.empty())
103+
{
104+
release = product + "@" + release;
105+
}
106+
annotations["sentry[release]"] = release;
107+
const std::string environment = CRASHPAD_SUBMISSION_ENVIRONMENT;
108+
if (!environment.empty())
109+
{
110+
annotations["sentry[environment]"] = environment;
111+
}
88112
std::vector<std::string> arguments;
89113

90114
// This is the directory you will use to store and queue crash data.
@@ -95,9 +119,7 @@ bool InitializeCrashpad()
95119
// crash handlers. This path may be relative.
96120
std::string handlerPath(internal_paths::MQRoot + "\\crashpad_handler.exe");
97121

98-
// This should point to your server dump submission port (labeled as "http/writer"
99-
// in the listener configuration pane. Preferrably, the SSL enabled port should
100-
// be used. If Backtrace is hosting your instance, the default port is 6098.
122+
// This should point to your server dump submission endpoint.
101123
std::string url(gCrashpadSubmissionURL);
102124

103125
if (!gEnableRateLimit)

src/loader/MacroQuest.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
7474
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7575
<ClCompile>
76-
<AdditionalIncludeDirectories>$(VCPKG_IncludeStatic)\crashpad-backtrace;$(MQRoot)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
76+
<AdditionalIncludeDirectories>$(VCPKG_IncludeStatic)\crashpad;$(MQRoot)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
7777
</ClCompile>
7878
<Link />
7979
<Manifest />
@@ -83,7 +83,7 @@
8383
</ItemDefinitionGroup>
8484
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8585
<ClCompile>
86-
<AdditionalIncludeDirectories>$(VCPKG_IncludeStatic)\crashpad-backtrace;$(MQRoot)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
86+
<AdditionalIncludeDirectories>$(VCPKG_IncludeStatic)\crashpad;$(MQRoot)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
8787
</ClCompile>
8888
<Link />
8989
<Manifest />
@@ -96,7 +96,7 @@
9696
<Optimization>MaxSpeed</Optimization>
9797
<FunctionLevelLinking>true</FunctionLevelLinking>
9898
<IntrinsicFunctions>true</IntrinsicFunctions>
99-
<AdditionalIncludeDirectories>$(VCPKG_IncludeStatic)\crashpad-backtrace;$(MQRoot)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
99+
<AdditionalIncludeDirectories>$(VCPKG_IncludeStatic)\crashpad;$(MQRoot)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
100100
</ClCompile>
101101
<Link>
102102
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -110,7 +110,7 @@
110110
<Optimization>MaxSpeed</Optimization>
111111
<FunctionLevelLinking>true</FunctionLevelLinking>
112112
<IntrinsicFunctions>true</IntrinsicFunctions>
113-
<AdditionalIncludeDirectories>$(VCPKG_IncludeStatic)\crashpad-backtrace;$(MQRoot)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
113+
<AdditionalIncludeDirectories>$(VCPKG_IncludeStatic)\crashpad;$(MQRoot)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
114114
</ClCompile>
115115
<Link>
116116
<EnableCOMDATFolding>true</EnableCOMDATFolding>

src/loader/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
],
88
"dependencies": [
9-
"crashpad-backtrace",
9+
"crashpad",
1010
"spdlog",
1111
"wil",
1212
"date",

src/loader/vcpkg_mq.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
crashpad-backtrace
1+
crashpad
22
spdlog
33
wil
44
date

src/main/CrashHandler.cpp

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
#if !defined(CRASHPAD_SUBMISSIONS_RATELIMITED)
5151
#define CRASHPAD_SUBMISSIONS_RATELIMITED true
5252
#endif
53+
#if !defined(CRASHPAD_SUBMISSION_PRODUCT)
54+
#define CRASHPAD_SUBMISSION_PRODUCT "MacroQuest"
55+
#endif
56+
#if !defined(CRASHPAD_SUBMISSION_ENVIRONMENT)
57+
#define CRASHPAD_SUBMISSION_ENVIRONMENT "unknown"
58+
#endif
5359

5460
namespace fs = std::filesystem;
5561

@@ -89,14 +95,15 @@ static LPTOP_LEVEL_EXCEPTION_FILTER lpCrashpadTopLevelExceptionFilter = nullptr;
8995
// The original unhandled exception filter. We need to hold this so we can put it back if we unload.
9096
static LPTOP_LEVEL_EXCEPTION_FILTER lpOrigTopLevelExceptionFilter = nullptr;
9197

92-
// Annotations that should be added to crash reports
93-
static crashpad::StringAnnotation<32> buildTypeAnnotation("buildType");
94-
static crashpad::StringAnnotation<32> buildTimestampAnnotation("eqVersion");
95-
static crashpad::StringAnnotation<32> buildVersionAnnotation("mqVersion");
96-
static crashpad::StringAnnotation<36> buildCrashIdAnnotation("crashId");
98+
// Annotations that should be added to crash reports.
99+
// normal minidump: buildTypeAnnotation("buildType"); Sentry.io: buildTypeAnnotation("sentry[tags][buildType]");
100+
static crashpad::StringAnnotation<32> buildTypeAnnotation("sentry[tags][buildType]");
101+
static crashpad::StringAnnotation<32> buildTimestampAnnotation("sentry[tags][eqVersion]");
102+
static crashpad::StringAnnotation<32> buildVersionAnnotation("sentry[tags][mqVersion]");
103+
static crashpad::StringAnnotation<36> buildCrashIdAnnotation("sentry[tags][crashId]");
97104

98-
static crashpad::StringAnnotation<MAX_STRING> s_currentCommandAnnotation("mq.command");
99-
static crashpad::StringAnnotation<MAX_STRING> s_currentMacroData("mq.macro_data");
105+
static crashpad::StringAnnotation<MAX_STRING> s_currentCommandAnnotation("sentry[tags][mq.command]");
106+
static crashpad::StringAnnotation<MAX_STRING> s_currentMacroData("sentry[tags][mq.macro_data]");
100107

101108
static std::string s_sessionUuid;
102109

@@ -127,6 +134,24 @@ bool InitializeCrashpad()
127134
return true;
128135

129136
std::map<std::string, std::string> annotations;
137+
annotations["format"] = "minidump";
138+
const std::string product = CRASHPAD_SUBMISSION_PRODUCT;
139+
if (!product.empty())
140+
{
141+
annotations["product"] = product;
142+
}
143+
annotations["version"] = MQMAIN_VERSION;
144+
std::string release = MQMAIN_VERSION;
145+
if (!product.empty())
146+
{
147+
release = product + "@" + release;
148+
}
149+
annotations["sentry[release]"] = release;
150+
const std::string environment = CRASHPAD_SUBMISSION_ENVIRONMENT;
151+
if (!environment.empty())
152+
{
153+
annotations["sentry[environment]"] = environment;
154+
}
130155
std::vector<std::string> arguments;
131156

132157
// This is the directory you will use to store and queue crash data.
@@ -137,9 +162,7 @@ bool InitializeCrashpad()
137162
// crash handlers. This path may be relative.
138163
std::wstring handlerPath(utf8_to_wstring(mq::internal_paths::MQRoot + "\\crashpad_handler.exe"));
139164

140-
// This should point to your server dump submission port (labeled as "http/writer"
141-
// in the listener configuration pane. Preferably, the SSL enabled port should
142-
// be used. If Backtrace is hosting your instance, the default port is 6098.
165+
// This should point to your server dump submission endpoint.
143166
std::string url(gCrashpadSubmissionURL);
144167

145168
if (!gEnableRateLimit)
@@ -526,7 +549,7 @@ void CrashHandler_SetLastMacroData(const char* macroData)
526549

527550
//----------------------------------------------------------------------------
528551

529-
static crashpad::StringAnnotation<32> s_synthesizedAnnotation("synthesized");
552+
static crashpad::StringAnnotation<32> s_synthesizedAnnotation("sentry[tags][synthesized]");
530553

531554
void DoCrash(PlayerClient*, const char* szLine)
532555
{

0 commit comments

Comments
 (0)