From 8d600e226960a81636137d9bf286c69ab39066ed Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 26 Mar 2023 18:05:29 -0400 Subject: embed debug symbols for Linux/macOS compatibility This fixes error stack traces not having line numbers on Linux/macOS. --- build/common.targets | 3 +++ build/deploy-local-smapi.targets | 4 ---- build/unix/prepare-install-package.sh | 5 ++--- build/windows/prepare-install-package.ps1 | 5 ++--- docs/release-notes.md | 1 + src/SMAPI.Installer/InteractiveInstaller.cs | 2 +- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/build/common.targets b/build/common.targets index 1ead1508..bb13a26a 100644 --- a/build/common.targets +++ b/build/common.targets @@ -14,6 +14,9 @@ repo. It imports the other MSBuild files as needed. $(DefineConstants);SMAPI_DEPRECATED true + + embedded + enable $(NoWarn);CS8632 diff --git a/build/deploy-local-smapi.targets b/build/deploy-local-smapi.targets index 6ea5f0a2..e6c01800 100644 --- a/build/deploy-local-smapi.targets +++ b/build/deploy-local-smapi.targets @@ -18,7 +18,6 @@ This assumes `find-game-folder.targets` has already been imported and validated. - @@ -62,7 +61,6 @@ This assumes `find-game-folder.targets` has already been imported and validated. - @@ -70,12 +68,10 @@ This assumes `find-game-folder.targets` has already been imported and validated. - - diff --git a/build/unix/prepare-install-package.sh b/build/unix/prepare-install-package.sh index 304579b9..3e33c277 100755 --- a/build/unix/prepare-install-package.sh +++ b/build/unix/prepare-install-package.sh @@ -122,7 +122,7 @@ for folder in ${folders[@]}; do fi # bundle root files - for name in "StardewModdingAPI" "StardewModdingAPI.dll" "StardewModdingAPI.pdb" "StardewModdingAPI.xml" "steam_appid.txt"; do + for name in "StardewModdingAPI" "StardewModdingAPI.dll" "StardewModdingAPI.xml" "steam_appid.txt"; do if [ $name == "StardewModdingAPI" ] && [ $folder == "windows" ]; then name="$name.exe" fi @@ -134,7 +134,7 @@ for folder in ${folders[@]}; do cp -r "$smapiBin/i18n" "$bundlePath/smapi-internal" # bundle smapi-internal - for name in "0Harmony.dll" "0Harmony.xml" "Mono.Cecil.dll" "Mono.Cecil.Mdb.dll" "Mono.Cecil.Pdb.dll" "MonoMod.Common.dll" "Newtonsoft.Json.dll" "Pathoschild.Http.Client.dll" "Pintail.dll" "TMXTile.dll" "SMAPI.Toolkit.dll" "SMAPI.Toolkit.pdb" "SMAPI.Toolkit.xml" "SMAPI.Toolkit.CoreInterfaces.dll" "SMAPI.Toolkit.CoreInterfaces.pdb" "SMAPI.Toolkit.CoreInterfaces.xml" "System.Net.Http.Formatting.dll"; do + for name in "0Harmony.dll" "0Harmony.xml" "Mono.Cecil.dll" "Mono.Cecil.Mdb.dll" "Mono.Cecil.Pdb.dll" "MonoMod.Common.dll" "Newtonsoft.Json.dll" "Pathoschild.Http.Client.dll" "Pintail.dll" "TMXTile.dll" "SMAPI.Toolkit.dll" "SMAPI.Toolkit.xml" "SMAPI.Toolkit.CoreInterfaces.dll" "SMAPI.Toolkit.CoreInterfaces.xml" "System.Net.Http.Formatting.dll"; do cp "$smapiBin/$name" "$bundlePath/smapi-internal" done @@ -164,7 +164,6 @@ for folder in ${folders[@]}; do mkdir "$targetPath" --parents cp "$fromPath/$modName.dll" "$targetPath" - cp "$fromPath/$modName.pdb" "$targetPath" cp "$fromPath/manifest.json" "$targetPath" if [ -d "$fromPath/i18n" ]; then cp -r "$fromPath/i18n" "$targetPath" diff --git a/build/windows/prepare-install-package.ps1 b/build/windows/prepare-install-package.ps1 index 71de1154..434d2466 100644 --- a/build/windows/prepare-install-package.ps1 +++ b/build/windows/prepare-install-package.ps1 @@ -142,7 +142,7 @@ foreach ($folder in $folders) { } # bundle root files - foreach ($name in @("StardewModdingAPI", "StardewModdingAPI.dll", "StardewModdingAPI.pdb", "StardewModdingAPI.xml", "steam_appid.txt")) { + foreach ($name in @("StardewModdingAPI", "StardewModdingAPI.dll", "StardewModdingAPI.xml", "steam_appid.txt")) { if ($name -eq "StardewModdingAPI" -and $folder -eq "windows") { $name = "$name.exe" } @@ -154,7 +154,7 @@ foreach ($folder in $folders) { cp -Recurse "$smapiBin/i18n" "$bundlePath/smapi-internal" # bundle smapi-internal - foreach ($name in @("0Harmony.dll", "0Harmony.xml", "Mono.Cecil.dll", "Mono.Cecil.Mdb.dll", "Mono.Cecil.Pdb.dll", "MonoMod.Common.dll", "Newtonsoft.Json.dll", "Pathoschild.Http.Client.dll", "Pintail.dll", "TMXTile.dll", "SMAPI.Toolkit.dll", "SMAPI.Toolkit.pdb", "SMAPI.Toolkit.xml", "SMAPI.Toolkit.CoreInterfaces.dll", "SMAPI.Toolkit.CoreInterfaces.pdb", "SMAPI.Toolkit.CoreInterfaces.xml", "System.Net.Http.Formatting.dll")) { + foreach ($name in @("0Harmony.dll", "0Harmony.xml", "Mono.Cecil.dll", "Mono.Cecil.Mdb.dll", "Mono.Cecil.Pdb.dll", "MonoMod.Common.dll", "Newtonsoft.Json.dll", "Pathoschild.Http.Client.dll", "Pintail.dll", "TMXTile.dll", "SMAPI.Toolkit.dll", "SMAPI.Toolkit.xml", "SMAPI.Toolkit.CoreInterfaces.dll", "SMAPI.Toolkit.CoreInterfaces.xml", "System.Net.Http.Formatting.dll")) { cp "$smapiBin/$name" "$bundlePath/smapi-internal" } @@ -189,7 +189,6 @@ foreach ($folder in $folders) { mkdir "$targetPath" > $null cp "$fromPath/$modName.dll" "$targetPath" - cp "$fromPath/$modName.pdb" "$targetPath" cp "$fromPath/manifest.json" "$targetPath" if (Test-Path "$fromPath/i18n" -PathType Container) { cp -Recurse "$fromPath/i18n" "$targetPath" diff --git a/docs/release-notes.md b/docs/release-notes.md index e023cf64..8c3c498c 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -10,6 +10,7 @@ ## Upcoming release * For players: * Added support for overriding SMAPI configuration per `Mods` folder (thanks to Shockah!). + * Fixed logged SMAPI errors not having line numbers on Linux/macOS. * For mod authors: * Added support for [custom update manifests](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Update_checks#Custom_update_manifest) (thanks to Jamie Taylor!). diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs index d00a5df4..b15d4bf6 100644 --- a/src/SMAPI.Installer/InteractiveInstaller.cs +++ b/src/SMAPI.Installer/InteractiveInstaller.cs @@ -48,7 +48,7 @@ namespace StardewModdingApi.Installer yield return GetInstallPath("StardewModdingAPI.exe"); yield return GetInstallPath("StardewModdingAPI.exe.config"); yield return GetInstallPath("StardewModdingAPI.exe.mdb"); // Linux/macOS only - yield return GetInstallPath("StardewModdingAPI.pdb"); // Windows only + yield return GetInstallPath("StardewModdingAPI.pdb"); // before 4.0 (Windows only) yield return GetInstallPath("StardewModdingAPI.runtimeconfig.json"); yield return GetInstallPath("StardewModdingAPI.xml"); yield return GetInstallPath("smapi-internal"); -- cgit