Switch to separate setting for loading shared libraries globally#3054
Switch to separate setting for loading shared libraries globally#3054hoodmane wants to merge 7 commits intopyodide:mainfrom
Conversation
|
How do you determine if a .so needs to be loaded globally? Also |
|
Yeah |
Well it happens when Ideally we would also fix everything to link properly and not need anything to be global. This would be particularly helpful for the command line runner. |
|
Thanks for the work!
Yes that would be ideal. It looks like the most problematic library is CLAPACK for now. |
|
Yeah I'm a bit confused about this PR, since I don't reproduce a lot of the CI failures locally. If you feel inclined @ryanking13 you could take it over. |
|
I think this is more or less a prerequisite for #3098 to work well. |
I'll see if I can fix this. I also tried to get rid of global shared lib loading a few months ago but failed back then. |
|
I have looked into this for a few days, and I am not sure loading a dependent shared library locally (and exposing its symbols to a specific module) is possible without a large modification in emscripten codebase. Emscripten resolves symbol from:
which means if a module (.so) needs to look for an external symbol, it has to be loaded globally. |
I don't believe this is correct. See for instance the comment just above that:
I think it is possible for one module to use a symbol from another even if the other module isn't in global scope. But the exact behavior is pretty confusing. |
We have 16 shared libraries (7 for testing purposes, 9 "real" ones), but most of them do not need to be loaded globally, only 3 of them need it and two of the three are tests. This PR adds a new
globalsetting to handle this. Hopefully we can gradually reduce how many libraries need to be loaded globally since global loading is a maintenance hazard.Checklists