Skip to content

Conversation

@davy39
Copy link
Contributor

@davy39 davy39 commented Oct 23, 2025

I tried to build xeus-ocaml with Emscripten 4x, but it throws error with undefined method.

It may be redundant with MAIN_MODULE=1

Anyway, without it it builds and works fine, and and so does it with emscripten 3.73.

Error with Emscripten 4x with this method
@DerThorsten
Copy link
Member

DerThorsten commented Oct 24, 2025

For emscripten-4x experiments I used my personal branch where I also removed it
main...DerThorsten:xeus:emscripten4x

Not 100% sure if we can remove it for 3.1.73. I assume xeus-ocaml does not try to load any dlopen at runtime, and historically we need that getDylinkMetadata symbol when using dlopen.

@JohanMabille JohanMabille merged commit c9920e3 into jupyter-xeus:main Oct 24, 2025
9 checks passed
@JohanMabille
Copy link
Member

Arf I was too eager to merge and did it before you edit your comment. Anyway, since it was preventing a kernel to build, let's keep it as is, and we can still fix downstream kernels by adding this method in the post.js file.

@DerThorsten
Copy link
Member

@davy39 btw for emscripten-4x we switch to -f-wasm-exceptions, so even with that PR here landed, you still cannot use the main branch for emscripten-4x.

@davy39
Copy link
Contributor Author

davy39 commented Oct 24, 2025

@davy39 btw for emscripten-4x we switch to -f-wasm-exceptions, so even with that PR here landed, you still cannot use the main branch for emscripten-4x.

I did build without it, but I'll keep that in mind, and maybe make a new new branch for 4x

@DerThorsten
Copy link
Member

@davy39 btw for emscripten-4x we switch to -f-wasm-exceptions, so even with that PR here landed, you still cannot use the main branch for emscripten-4x.

I did build without it, but I'll keep that in mind, and maybe make a new new branch for 4x

I assume it works if you also not use -f-wasm-exeptions in your kernel, but one of the goals of the 4x migration is to use -f-wasm-exeptions everywhere

@davy39
Copy link
Contributor Author

davy39 commented Oct 24, 2025

OK, I think I'll just wait for xeus and xeus-lite from emscripten-forge-4x to include -f-wasm-exeptions to see the difference.

@DerThorsten
Copy link
Member

@davy39 there is already that channel for emscripten-forge-4x https://prefix.dev/channels/emscripten-forge-4x
For that experimental channel, I used my forks / branches for emscripten-4x which already use -f-wasm-exceptions. But all of that is not very stable yet.

@davy39
Copy link
Contributor Author

davy39 commented Oct 24, 2025

I've seen this channel coming from emscripten-4x branch.
The thing is that xeus and xeus-lite from this channel still include WasmBuildOptions.cmake and ...Targets.cmake with -fexceptions.
So I won't get -fwasm-exceptions by building xeus-ocaml against them.

@DerThorsten
Copy link
Member

DerThorsten commented Oct 24, 2025

@davy39 damn you are right...thats a bug...I think when I compiled my xeus-python prototype with -f-wasm-exceptions I just not included these options in the xeus-python kernel.
I'll delete these packages and will uploaded fixed ones soonish

@DerThorsten
Copy link
Member

@davy39 I just deleted the broken pkgs and uploaded

xeus-5.2.3-h0b0027f_5.tar.bz2
xeus-lite-4.0.0-h0b0027f_3.tar.bz2

I checked the targets and wasm-options, they are now using -fwasm-exceptions!

@davy39
Copy link
Contributor Author

davy39 commented Oct 24, 2025

Just sharing experience :
First it didn't build due to the lack of --bind flag in new WasmBuildOptions.cmake.
Adding that flag in my CMakeLists fixes the build, but then my kernel fails with
Error: Dynamic linking error: cannot resolve symbol invoke_ii

That's beyond my understanding...

@DerThorsten
Copy link
Member

Just sharing experience : First it didn't build due to the lack of --bind flag in new

I removed that while making xeus-python work, since there and handled that in the kernel itself

WasmBuildOptions.cmake. Adding that flag in my CMakeLists fixes the build, but then my kernel fails with Error: Dynamic linking error: cannot resolve symbol invoke_ii

That's beyond my understanding...

That means your kernel drags in -fexceptions instead -fwasm-exceptions

@davy39
Copy link
Contributor Author

davy39 commented Oct 24, 2025

Could that's be because of my javascript --pre-js xocaml.bc.js ?

@DerThorsten
Copy link
Member

I think you need to pass -f-wasm-exception as compile and linker arg in the kernel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants