Skip to content

Ensure source bundles generated in the same run don't get overwritten (macOS) #2502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
limbonaut opened this issue May 12, 2025 · 8 comments
Labels
Bug Issue type CLI Product area Errors

Comments

@limbonaut
Copy link

limbonaut commented May 12, 2025

Description

This issue is reproducible only on macOS.

When creating source bundles for Godot Engine builds, the previously created bundle for a different architecture gets overwritten because the file name for the source bundle does not include architecture (unlike the original files).

Let me explain with an example. Let's say we compiled templates for macOS using the Sentry guide. We should have the following files and folders in the bin directory as the result:

-rw-r--r--@ 1 limbonaut  staff   51771497 May  7 15:16 godot_macos.zip
-rwxr-xr-x@ 1 limbonaut  staff   71421504 May  7 15:16 godot.macos.template_release.arm64
drwxr-xr-x@ 3 limbonaut  staff         96 May  7 15:15 godot.macos.template_release.arm64.dSYM
-rwxr-xr-x@ 1 limbonaut  staff  153783872 May  7 15:16 godot.macos.template_release.fat
-rwxr-xr-x@ 1 limbonaut  staff   82355224 May  7 15:13 godot.macos.template_release.x86_64
drwxr-xr-x@ 3 limbonaut  staff         96 May  7 15:12 godot.macos.template_release.x86_64.dSYM

To generate source bundles, we could run the following command:

$ sentry-cli debug-files bundle-sources bin/*.dSYM
  WARN    2025-05-12 09:21:07.921441 +02:00 Source exceeded maximum item size limit (1161314). /Users/limbonaut/Projects/godot/main/thirdparty/ufbx/ufbx.c
/Users/limbonaut/Projects/godot/main/bin/godot.macos.template_release.src.zip
  WARN    2025-05-12 09:21:09.496129 +02:00 Source exceeded maximum item size limit (1161314). /Users/limbonaut/Projects/godot/main/thirdparty/ufbx/ufbx.c
/Users/limbonaut/Projects/godot/main/bin/godot.macos.template_release.src.zip

As you can see by the output, sentry-cli generates source bundles with the same file name twice, effectively overwriting its own work. These are supposed to be separate bundles.

I propose that sentry-cli either should keep track of already generated files, so as not to overwrite them, or incorporate the file name in its naming scheme fully, including the architecture tag.

Related to:

@szokeasaurusrex
Copy link
Member

Hey @limbonaut, thanks for opening this issue.

Is this a bug – as in, is the behavior broken? Or are you simply concerned that Sentry CLI is behaving non-optimally, since it appears to be building the same bundle twice?

@limbonaut
Copy link
Author

limbonaut commented May 12, 2025

Hey @szokeasaurusrex. I believe this is a broken behavior as sentry-cli generates a source bundle for godot.macos.template_release.arm64.dSYM named godot.macos.template_release.src.zip, and then overwrites it because the source bundle for godot.macos.template_release.x86_64.dSYM gets the same name (godot.macos.template_release.src.zip). In the result, we only have a bundle for x86_64 binary, not arm64, and traces in Sentry for the arm64 binary do not get associated with this bundle.

Running sentry-cli to upload debug files identifies only one debug file with embedded sources:

> Found 9 debug information files (1 with embedded sources)

Resulting debug file in Sentry:

Image

Only x86_64 source bundle is present in Sentry:

Image

ARM64 trace not having source:

Image

If I point sentry-cli to ARM64 binary separately, it creates a bundle, and the resulting bundle after being uploaded results in traces with source as expected. So the problem is strictly with the source bundle naming scheme (dropping architecture tag from the name results in overwriting–only single architecture can have a bundle present in the file system by default).

EDIT:
I clarified the confusing bit in the OP:

As you can see by the output, sentry-cli generates source bundles with the same file name twice, effectively overwriting its own work. These are supposed to be separate bundles.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 12, 2025
Copy link
Member

Okay, thanks! I'll mark the issue as a bug then; in the meantime, I'd suggest you try to workaround the problem by bundling the sources separately for each binary:

sentry-cli debug-files bundle-sources bin/godot.macos.template_release.x86_64.dSYM
mv bin/godot.macos.template_release.src.zip bin/godot.macos.template_release.x86_64.src.zip
sentry-cli debug-files bundle-sources bin/godot.macos.template_release.arm64.dSYM
mv bin/godot.macos.template_release.src.zip bin/godot.macos.template_release.arm64.src.zip

@szokeasaurusrex szokeasaurusrex added the Bug Issue type label May 12, 2025 — with Linear
@limbonaut
Copy link
Author

I just noticed that the problem seems to be only present on macOS. On Linux and on Windows, the source bundles get the appropriate bundle names incorporating x86_64 in its naming scheme.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 12, 2025
@limbonaut limbonaut changed the title Ensure source bundles generated in the same run don't get overwritten Ensure source bundles generated in the same run don't get overwritten (macOS) May 12, 2025
@szokeasaurusrex
Copy link
Member

@limbonaut but the debug format is different on Windows and Linux, correct (no dSYMs, right)?

@limbonaut
Copy link
Author

@szokeasaurusrex Yes, the debug format is different in these cases. On Windows it's PDBs and on Linux it's .debugsymbols files (DWARF symbols in a separate file, produced by GCC compiler). The issue may be with either macOS or dSYM specifically.

@szokeasaurusrex
Copy link
Member

szokeasaurusrex commented May 15, 2025

Hey @limbonaut, I was trying to reproduce this issue using some (non-Godot) dSYMs, but the command failed stating that the files were of an unsupported type, which is quite confusing (perhaps, the Godot docs page's example for this command is inaccurate).

Would you be able to provide the files you were attempting to upload? Or some steps I could follow to generate similar Godot dSYMs? I am not super familiar with Godot so any pointers would be helpful.

Also, why are you using sentry-cli debug-files bundle-sources? Would it not be simpler to just run sentry-cli debug-files upload --include-sources? By passing --include-sources, the upload command does the uploading and source bundling in a single go; also for some reason, that command appears be working as expected.

@limbonaut
Copy link
Author

Also, why are you using sentry-cli debug-files bundle-sources? Would it not be simpler to just run sentry-cli debug-files upload --include-sources? By passing --include-sources, the upload command does the uploading and source bundling in a single go; also for some reason, that command appears be working as expected.

I ended up doing that. I was using bundle-sources because I somehow missed --include-sources 😅

I sent you a DM with a link to compiled templates. The commands I used to compile them are:

scons target=template_release arch=x86_64 production=yes debug_symbols=yes separate_debug_symbols=yes platform=macos
scons target=template_release arch=arm64 generate_bundle=yes production=yes debug_symbols=yes separate_debug_symbols=yes platform=macos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issue type CLI Product area Errors
Projects
Status: No status
Development

No branches or pull requests

3 participants