-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
file_packager.py: option to continue-on-error in output js (for optional packages)? #21310
Comments
If possible, I'd would prefer not to add more feature to If we do end up adding new option perhaps we should just call it |
One of the issues encountered investigating such an approach is how to handle unblocking the WebAssembly module. The file packager's generated script adds multiple run dependencies:
It appears that 2 is a sticking point (although I may be missing something). And in any event, having to replicate in an external script the internal implementation details of how (Hence why I went with adding an option to
I've gone ahead and updated the PR to name it |
Hmm.. I agree that baking in knowledge of the file_package generated code seems bad. Regarding (2), are you saying that the |
Yes - for every file, a emscripten/tools/file_packager.py Lines 698 to 701 in 52e5687
And emscripten/tools/file_packager.py Lines 679 to 685 in 52e5687
|
Currently, when using
file_packager.py
to generate a preload package*, the output .js code will throw an error insidefetchRemotePackage
if the associated.data
file cannot be downloaded. This then yields a state where loading the Module is blocked indefinitely.* (via
file_packager.py --preload [...] --js-output=packageName.js --use-preload-cache
)In the case of optional packages (which an application can handle running without), we'd like to essentially swallow this error and allow loading / running to continue.
The specific use-case: We have optional packages, and an application we're trying to make resilient in offline scenarios (ex. when the .data files for those packages aren't cached). The application can already handle if the optional packages aren't present, so all that's needed is functionality in the
file_packager
generated script to gracefully handle the error case and remove the run dependencies.Thoughts on options?
One idea:
Have
file_packager.py
take a new--continue-on-fetch-error
/--continue-on-loading-error
/--continue-on-error
(?) option that adapts the output .js code to:throw new Error("NetworkError for: " + packageName);
throw new Error(xhr.statusText + " : " + xhr.responseURL);
(which currently end up as unhandled errors)
Module['removeRunDependency']('datafile_<packageName>.data');
Module['removeRunDependency'](`fp ${that.name}`);
(for all dependencies added as a result ofDataRequest.open
calls inrunWithFS
The text was updated successfully, but these errors were encountered: