-
Notifications
You must be signed in to change notification settings - Fork 32
Allow third party Zig modules #500
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
Allow third party Zig modules #500
Conversation
This commit adds support to use external Zig libraries in Ziggy Pydust by passing a list a of imports to PythonModuleOptions and calling addImport for each module in the lib and libtest.
I open this PR as a draft because I am getting this error when trying to use Ziggy Pydust with these modifications, take a look at the Zig error message:
And I do not know how to fix that properly, maybe I forgot to add the lib somewhere? Or is it just some Zig detail I let pass (given that I am not very good with Zig)? I would appreciate some help, and would love to help implement this feature. The project I tried to build and got the error above is this one: https://github.com/ivansantiagojr/mdz/tree/using-fork-ziggy-pydust |
To register here (and possibly get help from the community), the compilation error described above only happens in the |
Workaround: I noticed that in the generated How could I make the project get this file from the installed Ziggy Pydust instead of my current project? Any ideas @jburgy @robert3005 |
@ivansantiagojr your issue is likely related to this discord thread (see this minimal repro if you can't access the discord thread). Note that I raised ziglang/translate-c#47 and found a work-around. Reading this reply (as well as ziglang/zig#24497), I understand now that zig has two
Let me know what you prefer and how I can help you with it. |
Oh, I didn't know there was a discord server. Thanks for letting me know and for the tips! I will investigate a little more and try those alternatives you listed locally, probably another PR should be open to solve that. |
I think if we have #526 we do not need this? |
@robert3005, we'll need both, actually. This PR allows us to use third party modules, and #526 only reverts the strategy to use C modules. In order for the code of this branch to work, we need #526 to be merged first. Sorry for not making it clearer earlier! |
This PR makes a suggestion of feature to allow Ziggy Pydust users to add third party modules.
To achieve this, I add a list of imports to
PythonModuleOptions
and then iterated this list callinglib.addImport
for each module. The same was made forlibtest
.I also added basic docs giving an example of how to use that, so feel free to consult it and analyze if this suggestion is a good way to address the issue ziglang/zig#474 .