Remove host_print_writer
from the arguments to UninitializedSandbox::new
#487
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.
With #480 merged, registering a host function with a name that is already in use, just replaces the previous registration.
This means that we can pre-emptively register the default
HostPrint
method, and replace it afterwards.This PR removes
host_print_writer
from the arguments toUninitializedSandbox::new
.The default host print is pre-emptively registered, and a new
HostPrint
can be registered like any other host function.Alternatively, the method
register_print
can be used, which uses the correct name and (compile-time-)checks the function signature.This partly addresses the following comment (i.e., it still doesn't implement a builder pattern, but does allow adding extra syscalls to the writer method)
hyperlight/src/hyperlight_host/src/sandbox/uninitialized.rs
Lines 195 to 197 in a862d4a