-
Notifications
You must be signed in to change notification settings - Fork 923
Progress reporting for module loading and compilation #5883
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
706d650
feat: Progress reporting and abort for module compilation
theduke 9d8e664
feat(wasix): Module load/compile progress reporting
theduke 43027f2
feat(cli): run command: Show compilation progress
theduke 17ae0ce
Fix clippy warnings
theduke 3aab1ac
Rename CompileError::User to CompileError::Aborted
theduke 965e038
Refactor Module::new_with_progress to ProgressEngineExt::new_module_w…
theduke a861985
tests: Add module compile progress/abort tests
theduke 5fe730d
chore(cli): Improve module compilation progress status
theduke a9a070b
Lift ProgressContext to wasmer-compiler crate
theduke 9b1f8a9
Extend singlepass compiler with progress reporting.
theduke 26507da
Include trampolines in compilation progress.
theduke 327b3b9
Add singlepass progress tests
theduke 4571262
chore: Docs improvements and small clippy fixes
theduke 4aadf39
tmp
theduke c44c3b0
Merge remote-tracking branch 'origin/main' into compiler-progress
theduke 6fac680
Merge branch 'main' into compiler-progress
marxin b6b5290
Merge branch 'main' into compiler-progress
marxin c0ec682
fix cranelift testse
marxin 27398f1
remove dbg output
marxin f4f4575
use correct runtime
marxin 0c84047
refactor
marxin 085f23a
remove from_binary_with_progress from BackendModule trait
marxin 84ef34d
simplify
marxin 0c0f0e4
drop progress_ext
marxin 810bf6d
use thiserror for UserAbort
marxin 6d69f89
move tests to tests/compilers
marxin f4c1a40
fix singlepass progress bar
marxin 6e28543
run progress tests for all compilers
marxin ca9ad0e
fix compilation error based on configuration
marxin 9a93a1b
fix conditional build
marxin c33b214
fix cargo fmt
marxin c2bc7dc
Merge branch 'main' into compiler-progress
marxin 4a9516f
remove unused imports
marxin 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,35 @@ | ||
| use wasmer_types::CompilationProgressCallback; | ||
|
|
||
| /// Provides progress-related extensions to the `Engine` trait. | ||
| pub trait ProgressEngineExt { | ||
| /// Compile a module from bytes with a progress callback. | ||
| /// | ||
| /// The callback is invoked with progress updates during the compilation process. | ||
| /// The callback also may return an error to abort the compilation. | ||
| /// | ||
| /// Signature of the callback function: `Fn(CompilationProgress) -> Result<(), UserAbort> + Send + Sync + 'static` | ||
| /// | ||
| /// # Aborting compilation | ||
| /// | ||
| /// The callback has to return a `Result<(), UserAbort>`. | ||
| /// | ||
| /// If the callback returns an error, the compilation will fail with a `CompileError::Aborted`. | ||
| /// | ||
| /// See [`CompilationProgressCallback::new`] for more details. | ||
| fn new_module_with_progress( | ||
| &self, | ||
| bytes: &[u8], | ||
| on_progress: CompilationProgressCallback, | ||
| ) -> Result<crate::Module, wasmer_types::CompileError>; | ||
| } | ||
|
|
||
| impl ProgressEngineExt for crate::Engine { | ||
marxin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| /// See [`ProgressEngineExt::new_module_with_progress`]. | ||
| fn new_module_with_progress( | ||
| &self, | ||
| bytes: &[u8], | ||
| on_progress: CompilationProgressCallback, | ||
| ) -> Result<crate::Module, wasmer_types::CompileError> { | ||
| crate::BackendModule::new_with_progress(self, bytes, on_progress).map(crate::Module) | ||
| } | ||
| } | ||
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
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.