Repository navigation
feat(debug-files): upload Linux debug files and their sources - #8
Merged
Merged
Conversation
Add monocle debug-files upload and check. They read ELF/DWARF with symbolic, the library of the Monocle symbolicator, compiled to WebAssembly from native/, so source bundles match the ones the server already validates. Amp-Thread-ID: https://ampcode.com/threads/T-01a1cae2-d5fe-73c2-9af0-f37f8075cdb1
Same switch as monocle-sh/monocle: CI_RUNNER=devbox-mac moves both workflows to the devbox runners and skips the GitHub pnpm cache, slow outside GitHub. Amp-Thread-ID: https://ampcode.com/threads/T-01a1cae2-d5fe-73c2-9af0-f37f8075cdb1
Path::is_absolute is always false on wasm32-unknown-unknown, so the module treated /app as relative and never joined relative DWARF paths to the prefix. Builds remapped with --remap-path-prefix=/app=. uploaded no sources. Use has_root, and test the shipped module on a C build with relative paths. Amp-Thread-ID: https://ampcode.com/threads/T-01a1bb09-bcea-71b2-8dcf-2a8efd5976f1 Co-authored-by: Amp <amp@ampcode.com>
upload read, validated and bundled each file just before sending it, so an invalid second file failed after the first one was stored. Prepare all files and source bundles first. Reject build IDs outside the API's 4 to 64 bytes before any request, name the file in read, ELF and DWARF errors instead of an unexpected error, and warn when --root or --prefix is passed without --include-sources.
new Uint8Array(body) only satisfied BodyInit, which rejects Buffer<ArrayBufferLike>. Type the bytes as NonSharedBuffer instead. Uploading a 198 MiB debug file peaks at 1.3 GB instead of 1.7 GB.
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.
Adds
monocle debug-files uploadandmonocle debug-files check, so Rust users resolve native stack traces without cloning the private Monocle repository.How it works
native/compilessymbolic-debuginfo13.9, the version the symbolicator uses, towasm32-unknown-unknown. It reads the GNU build ID and DWARF file list, then writes the source bundle. It is a port ofmonocle-native-sources: same path mapping, limits, and output. On the symbolicator's own binary, it produces a bundle byte-identical to the Rust tool's.--root, after resolving symlinks) and uploads through the existing/native-symbols/uploadsAPI. No server change.debug-files. It ships inwasm/, resolved through the package's own./monocle_native.wasmexport.pnpm buildnow also runsbuild:native, which needs Rust (pinned innative/rust-toolchain.toml) and clang. Checks build it before the tests.Verification
readelf, the debug bytes, and the bundle manifest and contents withunzip. They also cover stripped binaries, a wrong--prefix, and a rejected token.npx: a crates.iomonocle-sh-sdkapp, uploaded, stripped, run. The issue showsmain.rs in orders_api::checkout at line 8with its excerpt. The Docker case (build in/app, upload with--prefix /appfrom another checkout) resolves the same way.