-
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
Would it be possible to have a xxx__cdeps: ['malloc', 'free']
feature?
#15211
Comments
Great idea in general. If we can make it work it would be great. I have a coupe of notes:
|
The code feature here has now landed as of #18849. I still have a bunch of followup work which should eventually enable us to completely remove the reverse deps systems. |
We have this longstanding issue that if any JS function is to depend on a C function which is not depended on to by any other C function, one will need to add an explicit dependency between that JS and C function in the file
tools/deps_info.py
in the formWould it be possible for us to switch to a model where in the JS libraries, we'd annotate with a
foo__cdeps: ['malloc', 'free']
directive all the C functions that the given JS function depends on?The way this would work is that the all the JS library functions would be parsed for their
cdeps
directives beforehand so we'd know which C functions to keep alive for the build?That way we'd be able to delete the file
tools/deps_info.py
, and have user JS libraries live at the same expressiveness level as system JS libraries are.E.g. currently in my WebGPU bindings library project, I want to depend on function
malloc()
from my JS library functionwgpu_shader_module_get_compilation_info_async()
.The WebGPU bindings library is a general library, and I don't know if the application itself will depend on
malloc()
or not. The demos in that repository do not. So in order to make the library work, I need to edittools/deps_info.json
to add themalloc()
dependency in there - but I couldn't ask users to have to modify their Emscripten installations in order to be able to use the WebGPU library.A
wgpu_shader_module_get_compilation_info_async__cdeps: ['malloc'],
directive would fix this issue cleanly?The text was updated successfully, but these errors were encountered: