-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[wasmfs] Add support for squashfs #24670
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
base: main
Are you sure you want to change the base?
Conversation
First, it's good to see that it is practical to add a WasmFS backend like this! Otherwise, I would guess that this makes more sense as an external/contrib port, that is, with the main code out of tree, like e.g. glfw3, both because of the licensing and that I'm not sure how much general interest there is for it. I don't feel strongly though, curious to hear thoughts from @tlively @sbc100 How would this compare to LZ4, btw? We have such a backend for the old FS. |
Also, I am not sure what the best approach would be, but if you could take a look at the code anyway, and let me know if I've missed anything, that would also be helpful.
I did not know about LZ4. However, the idea is mainly for python packages for jupyter lite. So that it can be generated outside of the tool chain. So my idea is that a squashfs may be backed by the fetch backend of wasmfs for the sqfs file can have benefits, since you do not have to download the whole file. Currently, I have only included zlib, which may yield performance not as good as LZ4 for compression. |
I looked now. Looks pretty good to me. The only two thoughts I have are
|
Thanks!
That is a good idea! I can just look, if it is inited and tear it down otherwise.
Sure, but my motivation comes from Jupyter Lite. I use the python (I think C/C++ may also work) in my lectures as applets, and the startup times are not great (30 s and more). As it basically emulates a python environment it has to keep the directory and file structure as it is for the standard setup. Currently, the implementation downloads a tar.gz file and extracts it. My idea is that not all files are needed for startup, and I may benefit from using squashfs (probably sorting files may also be important). |
Well, I am trying to move the wasm backend code to a port (as step towards an external port). EDIT: I would say it can't go outside system. |
Ok, I can find the upstream code via EMSDK environment variable |
Move the wasmfs code from system to port to prepare for conversion to an external port. (Also, this only includes LGPL code if the ports are included). |
External port is now at: |
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 think ideally this kind of work could be done completely out-of-tree, with no changes to emscripten itself, except perhaps to make all the required parts of wasmfs API exposed such that extensions like this can be authored based only on the public headers.
// 1 = use emscripten_wasmfs_sqaushfs from emscripten-ports | ||
// Alternate syntax: --use-port=emscripten_wasmfs_sqaushfs | ||
// [compile+link] | ||
var USE_EMSCRIPTEN_WASMFS_SQUASHFS = false; |
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.
For new port we don't add new settings like. Instead we just make them available via --use-port
.
In the external repository, I was able to compile it out of tree. But I had to include the internal headers of wasmfs via a hack. |
This is an attempt to add support for squashfs to wasmfs.
There are a couple of questions that I need to find out during the review:
The primary motivation on my side is to avoid decompressing large file systems in Jupyter Lite deployments, which may or may not result in a speedup. (Potentially using the fetch backend for the squashfs).