Repository navigation
Fully remove unused FS.filesystems property from libfs.js. NFC - #27940
Conversation
|
I think the there are references in test/test_core.py that need removing too |
|
So I think it's worth pointing out that using import instantiateModule from "./a.out.mjs";
const Module = await instantiateModule();
Module.FS.mount(Module.FS.filesystems.SOMEFS, ...);Of course one can just put See python/cpython#160264 where I do this workaround downstream. |
|
We didn't imagine there there were uses of this property, but if there are then perhaps we should bring it back. BTW, can you not do |
|
Yes, I think you can just export the FS object to the outside world if you need to: |
|
Yes, I think exporting MEMFS if needed is the best solution here. But sorry for the breakage @hoodmane , I didn't fully realize this issue before. I can add something to the changelog to mention the exporting solution if we think that would be helpful for others? |
|
Yeah I think it would be helpful to mention the external use case in the changelog. |
|
So Pyodide will put back |
|
Sorry about the breakage. We should do a better job or auditing at least open source world users before removing stuff. |
|
Well it hasn't been released yet so if it were a more problematic change that actually needed a revert we still would have time. But maybe 40% of Emscripten releases have a regression for me. I'm trying to keep better track of this with my cron github action that runs cpython tests against tip of tree Emscripten. Which caught this bug and #27941. |
|
Some of this is unavoidable as we have been turning some auto-exported things off by default, as a long-term project to reduce the code size waste of decisions that were made over a decade ago. That is, to move to better defaults. But, yeah, we should document each such breaking change. I'll add a changelog mention here. |
After `FS.filesystems` was removed in emscripten-core#27940 and `toplevel: true` was enabled for Terser in emscripten-core#27987, optional filesystem backends linked in via `-lidbfs.js`, `-lworkerfs.js`, `-lproxyfs.js`, `-lopfs.js`, etc. had no remaining references in the generated JS and were eliminated in `-O2` and `-O3` builds when referenced only from external JS (such as `Module.preRun` in HTML). Mark these optional filesystem backend objects with `__export: true` so that when `$FS` pulls them in, they are exported and preserved across JS optimizations (including `--closure=1`, `-sMODULARIZE`, and `-sMODULARIZE=instance`), without adding any code size when `$FS` is not used or under default settings. Fixes: emscripten-core#28072
After `FS.filesystems` was removed in emscripten-core#27940 and `toplevel: true` was enabled for Terser in emscripten-core#27987, optional filesystem backends linked in via `-lidbfs.js`, `-lworkerfs.js`, `-lproxyfs.js`, `-lopfs.js`, etc. had no remaining references in the generated JS and were eliminated in `-O2` and `-O3` builds when referenced only from external JS (such as `Module.preRun` in HTML). Mark these optional filesystem backend objects with `__export: true` so that when `$FS` pulls them in, they are exported and preserved across JS optimizations (including `--closure=1`, `-sMODULARIZE`, and `-sMODULARIZE=instance`), without adding any code size when `$FS` is not used or under default settings. Fixes: emscripten-core#28072
Replaces #27918 which did not go far enough.