-
-
Notifications
You must be signed in to change notification settings - Fork 14
feat(wasm-debug-files): Add prepare command for WASM debug setup #1572
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
d2anamaria
wants to merge
15
commits into
main
Choose a base branch
from
ana/feat/wasm/debug-file-pipeline
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e3b7a96
feat(wasm): expose section predicates and external_debug_info decode
d2anamaria f4bb9ee
ref(wasm): reuse splitWasm for debug-files prepare
d2anamaria ada71a1
ref(debug-files): share stamping, wait, and source-file helpers
d2anamaria d765ed7
feat(debug-files): add prepare command with markdown output
d2anamaria ee292fa
fix(debug-files): take the first readable build_id when inspecting
d2anamaria 9025888
ref(wasm): read the build id through the shared helper
d2anamaria e6e4bc3
fix(debug-files): reject --build-id for directories and multiple paths
d2anamaria 625815a
address review feedback
d2anamaria 83c787a
refactor(scan): share ignore matcher
d2anamaria d48170b
fix: companion collisions under --out-dir
d2anamaria 42d877d
fix(prepare): say debug files in upload output, not companions
d2anamaria 916cb52
fix(upload): require DWARF in existing companion before treating modu…
d2anamaria 0ac2043
fix(prepare): skip custom-named companions referenced by a scanned mo…
d2anamaria ac78128
ref(debug-files): rename prepare command to wasm-upload
d2anamaria b1119f5
no message
d2anamaria File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /** | ||
| * Shared `--wait` / `--wait-for` handling for `debug-files` commands. | ||
| * | ||
| * Uploading is only half the job: the server still has to assemble and index | ||
| * what it received. Commands that upload therefore offer the same pair of | ||
| * flags, and they have to agree on what the pair means. | ||
| */ | ||
|
|
||
| import { DEBUG_FILES_MAX_WAIT_MS } from "../../lib/api/debug-files.js"; | ||
| import { ValidationError } from "../../lib/errors.js"; | ||
|
|
||
| /** The wait flags, as a command declares them. */ | ||
| export type WaitFlags = { | ||
| /** Wait for server-side processing, using the default deadline. */ | ||
| wait?: boolean; | ||
| /** Wait for server-side processing, in seconds. */ | ||
| "wait-for"?: number; | ||
| }; | ||
|
|
||
| /** Whether to wait, and for how long. */ | ||
| export type WaitMode = { | ||
| wait: boolean; | ||
| maxWaitMs: number; | ||
| }; | ||
|
|
||
| /** | ||
| * Resolve the wait mode and deadline from the flags. | ||
| * | ||
| * @throws {ValidationError} If both flags are set, or `--wait-for` is invalid. | ||
| */ | ||
| export function resolveWaitMode(flags: WaitFlags): WaitMode { | ||
| const waitFor = flags["wait-for"]; | ||
| if (flags.wait && waitFor !== undefined) { | ||
| throw new ValidationError( | ||
| "--wait and --wait-for cannot be combined", | ||
| "wait" | ||
| ); | ||
| } | ||
| if (waitFor !== undefined) { | ||
| if (!Number.isFinite(waitFor) || waitFor <= 0) { | ||
| throw new ValidationError( | ||
| "--wait-for must be a positive number of seconds", | ||
| "wait-for" | ||
| ); | ||
| } | ||
| return { wait: true, maxWaitMs: Math.round(waitFor * 1000) }; | ||
| } | ||
| return { wait: Boolean(flags.wait), maxWaitMs: DEBUG_FILES_MAX_WAIT_MS }; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.