-
Notifications
You must be signed in to change notification settings - Fork 35
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
👻 Add options to customize behavior of unknown Wasm imports #313
Conversation
Adds a new shared option to the CLI with three behavior modes: ``` --unknown-import-behavior <UNKNOWN_IMPORT_BEHAVIOR> Set the behavior for unknown imports. Note that if a program only works with a non-default setting for this flag, it is unlikely to be publishable to Fastly. [default: link-error] Possible values: - link-error: Unknown imports are rejected at link time (default behavior) - trap: Unknown imports trap when called - zero-or-null: Unknown imports return zero or a null pointer, depending on the type ``` This ended up touching more files than I'd expect, because I had to make the integration test harness bubble out link-time errors rather than `.expect()`ing them, so there are quite a few new `?`s across the integration test suite.
04cbccb
to
f048fd9
Compare
This sounds great! Since we're using a privileged hostcall in our internal service, we currently have a cargo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.... it occurs to me that this is a fascinating way to discover at runtime if a program's dependencies really do need browser-shaped wasm glue, or if maybe you'd never actually reach any of that at runtime. hmmmm..
very handy!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i should approve from the right account though
Adds a new shared option to the CLI with three behavior modes: ``` --unknown-import-behavior <UNKNOWN_IMPORT_BEHAVIOR> Set the behavior for unknown imports. Note that if a program only works with a non-default setting for this flag, it is unlikely to be publishable to Fastly. [default: link-error] Possible values: - link-error: Unknown imports are rejected at link time (default behavior) - trap: Unknown imports trap when called - zero-or-null: Unknown imports return zero or a null pointer, depending on the type ``` This ended up touching more files than I'd expect, because I had to make the integration test harness bubble out link-time errors rather than `.expect()`ing them, so there are quite a few new `?`s across the integration test suite.
Adds a new shared option to the CLI with three behavior modes:
This ended up touching more files than I'd expect, because I had to make the integration test harness bubble out link-time errors rather than
.expect()
ing them, so there are quite a few new?
s across the integration test suite.