fix: resolve symbol-upload outside the package folder - #203
Open
bobbyg603 wants to merge 1 commit into
Open
Conversation
Symbol upload silently did nothing for registry and git package installs. UploadSymbols resolved the uploader at Packages/com.bugsplat.unity/Editor/, a path that only physically exists for embedded/local installs - registry and git URL installs resolve under Library/PackageCache. The uploader binaries are gitignored and never shipped, so the download fallback ran on every install, and for the PackageCache case it wrote into a directory that does not exist (and that Unity owns and may re-extract). WebClient threw, the error was logged and swallowed, and Process.Start then threw uncaught - leaving a "successful" build with no symbols uploaded. Resolve the package root via PackageInfo.FindForAssembly, the way PostProcessWindows already does, use an uploader already sitting in the package if there is one, and otherwise download to Temp/. Downloads no longer mutate the package or generate .meta churn, and Temp/ is writable for every install type. Make failures observable: DownloadSymbolUpload now reports success so a failed download or chmod short-circuits to onCompleted(-1) instead of falling through to a doomed Process.Start, and Process.Start is wrapped so a launch failure is logged and surfaced as a non-zero exit code to the existing callbacks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Resolves symbol uploader path resolution for Unity PackageCache installs by locating the package root via PackageInfo.FindForAssembly, downloading the uploader into a writable Temp/ location when needed, and ensuring failures surface as non-zero exit codes instead of silently proceeding.
Changes:
- Added
GetSymUploaderPath()to resolve the uploader path viaPackageInfo.FindForAssembly, with a fallback toPackages/com.bugsplat.unity. - Updated
UploadSymbolsto short-circuit on download failures and to catchProcess.Startexceptions. - Updated
DownloadSymbolUploadto create the destination directory and return success/failure (including chmod success).
Suppressed comments (1)
Editor/PostBuild.cs:681
- Log prefix is inconsistent (
PostBuild:vsBugSplat.) within the same symbol-upload path, and the chmod exception path again logs onlyex.Message. Use the consistentBugSplat.prefix and log the full exception for actionable diagnostics.
if (process.ExitCode != 0)
{
Debug.LogError($"PostBuild: Failed to make {destinationPath} executable. Error: {error}");
return false;
}
Debug.Log($"PostBuild: Successfully made {destinationPath} executable. Output: {output}");
}
catch (Exception ex)
{
Debug.LogError($"PostBuild: Error setting executable permission for {destinationPath}. Error: {ex.Message}");
return false;
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
613
to
615
| var varient = Path.GetFileName(destinationPath); | ||
| var fileUrl = $"https://app.bugsplat.com/download/{varient}"; | ||
|
|
Comment on lines
+591
to
+595
| catch (Exception ex) | ||
| { | ||
| Debug.LogError($"BugSplat. Failed to start {symbolUploadPath}. Error: {ex.Message}"); | ||
| onCompleted(-1); | ||
| return; |
daveplunkett
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #150
What was broken
UploadSymbolsresolved the uploader atPath.GetFullPath("Packages/com.bugsplat.unity/Editor/<exe>"). That path only physically exists for embedded/local installs — registry and git URL installs resolve underLibrary/PackageCache/com.bugsplat.unity@<hash>/, so the file was never found there.The uploader binaries are gitignored and never ship in the package, so the download fallback ran on every install, not just the broken ones. For PackageCache installs it tried to write into a directory that does not exist (and that Unity owns and may re-extract at any time).
WebClient.DownloadFilethrew, the error was logged and swallowed, andProcess.Startthen threw uncaught with aFileNamepointing at a nonexistent binary — leaving a build that reported success with no symbols uploaded.This affects the majority install path (git URL / OpenUPM), on every platform that goes through
UploadSymbols(Windows, macOS, Android).What changed
All of it in
Editor/PostBuild.cs, confined to the uploader path resolution and download:GetSymUploaderPath()resolves the package root viaUnityEditor.PackageManager.PackageInfo.FindForAssembly, the same wayPostProcessWindowsalready does, with the oldPackages/com.bugsplat.unitypath kept only as the fallback whenFindForAssemblyreturns null. An uploader already sitting in the package'sEditor/folder is used in place; otherwise the path resolves toTemp/, which is writable for every install type, is not scanned by the asset importer (no.metachurn), and never mutates the package.DownloadSymbolUploadnow creates the destination directory and returns whether it succeeded. A failed download or a failedchmod +xshort-circuits toonCompleted(-1)instead of falling through to a doomedProcess.Start.Process.Startis wrapped in a try/catch, so a launch failure is logged and surfaced as a non-zero exit code to the existing callbacks rather than escaping the[PostProcessBuild]callback.Deliberately not touched, to keep this mergeable alongside #151 and #162: the
#elif UNITY_EDITOR_WINdispatch inOnPostprocessBuildand the Android upload callback.Verified
dotnet buildof the fullRuntime/+Editor/source set against Unity 6000.5.6f1's managed assemblies, in three define configurations:UNITY_EDITOR,UNITY_EDITOR;UNITY_EDITOR_WIN(withUnityEditor.WindowsStandalone.Extensions.dll), andUNITY_EDITOR;UNITY_ANDROID(withUnityEditor.Android.Extensions.dll+Unity.Android.Types.dll). 0 errors in all three; the only warnings are pre-existing (_platformunused, two never-assigned fields inBugSplat.cs).mainrather than drifted audit notes: the hardcoded path was still atPostBuild.cs:545, and.gitignoreconfirms the uploader binaries are never committed, so the download path is always exercised.Not verified
dotnet buildagainst Unity's DLLs, not a Unity build, so nothing here was exercised at runtime: no actual player build, no real download toTemp/, no real upload to BugSplat, and no confirmation from an actual PackageCache install.#if UNITY_IOSblock was not compiled (needs the iOS Xcode extension assemblies). It does not callUploadSymbolsand is unchanged by this PR.Temp/is cleared when the editor quits, so the uploader is re-downloaded once per editor session. That is the tradeoff the issue asked for and it is not benchmarked here.BugSplat.Unity.RuntimeTestsassembly, so that needs a new Editor test assembly and is left as follow-up under Audit: 5.0.0 SDK review — correctness, platform coverage, security, DX, packaging (mono-issue) #132 (J3). The optional fail-the-build toggle from the issue is also not implemented — it needs a new serialized field onBugSplatOptionsplus editor UI, which would collide with the other in-flightPostBuild.csPRs.🤖 Generated with Claude Code