-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Doubts regarding running clang-repl in browser (using jupyterlite) #23228
Comments
The temporary files for running clang-repl in the browser are generated here(https://github.com/llvm/llvm-project/blob/eb812d28f542bf0de54c157a7391e446739570cc/clang/lib/Interpreter/Wasm.cpp#L79-L80) Something like this
As the files concerned (wasm.h and wasm.cpp) are only included in the build against emscripten and play a major role only for running clang-repl in the browser (which is done through emscripten) , I thought that shifting the files to the "tmp" folder provided by emscripten by default would do the trick ! And that did it for me and I don't see anymore Aborted Runtime errors
|
My question to @sbc100 and anyone interested is that I am curious if what I am doing is hacky/dirty ? as in should we not hardcore "/tmp/" this way ? (only reason I used it while building llvm against emscripten is because it is being provided by default) I also got suggested that I could do the following
But won't this interfere/collide with Emscripten's approach to handle file systems ? |
What emscripten filesystem are you using? It looks like you are using one that is backed by the server? Some kind of fetch-based FS? For temporary/local files you probably don't want to invovle the server so using MEMFS (assuming that is what is in /tmp) makes total sense for those file. And alternative to explictly adding |
Thanks I think this helps me resolve my issues in a way ! |
Hello there! Thanks for the amazing work to get xeus-cpp on emscripten-forge!
Yes kind-of, except it's an in-browser server proxy. But it acts as if files were coming from a normal Jupyter server.
Totally agreed 👍🏽
Does it mean that if the user creates a file with: #include <iostream>
#include <fstream>
std::ofstream outfile ("userfile.txt");
outfile << "custom user file!" << std::endl;
outfile.close(); It will be created under In JupyterLite we have everything set in place to correctly change directory to the expected directory (where the notebook lives is where the code runs), and local directory is synchronized with Jupyter content. I feel like having xeus-cpp change directory under the hood would break this behavior. My suggestion would be to create those temporary run files under EDIT: For more context. In current JupyterLite, the |
This is a continuation of my work involving llvm and emscripten.
I recently got clang-repl working in the browser through llvm 19.1.5
Here is most of the discussion I had with @sbc100 (#22863)
I can get stuff working now
Except this one error that I see in the console
As y'all can see I can still run stuff with this error
The text was updated successfully, but these errors were encountered: