You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation prioritizes a force_build option from a NIF project "project_a" (as used in the example project) over the config :rustler_precompiled, :force_build, project_a: true config defined in "project_b" (which uses "project_a" as a dependency).
The intention was to prioritize the config that is set directly from the module definition. But thinking now, your proposal makes sense. We could make the application config a priority in case it is set, otherwise we leave as it is. WDYT?
And would you mind to send a PR?
Hm, now that I thought about it again, I must say that your current implementation actually appears to be more intuitive to me. Using the option if provided in the module and else falling back to the application config might actually be more predictable in how the force_build option works.
So I'll backpedal here and advocate for that it should be solved on the NIF Module level. 😅
Just as a reference, for the rustler_precompiled example app that would be something like:
Activity
philss commentedon Jul 11, 2024
The intention was to prioritize the config that is set directly from the module definition. But thinking now, your proposal makes sense. We could make the application config a priority in case it is set, otherwise we leave as it is. WDYT?
And would you mind to send a PR?
paulgoetze commentedon Jul 12, 2024
👍 Yes, I think that makes sense, I'll send a PR.
paulgoetze commentedon Jul 12, 2024
Hm, now that I thought about it again, I must say that your current implementation actually appears to be more intuitive to me. Using the option if provided in the module and else falling back to the application config might actually be more predictable in how the
force_buildoption works.So I'll backpedal here and advocate for that it should be solved on the NIF Module level. 😅
Just as a reference, for the rustler_precompiled example app that would be something like:
which only passes the
force_buildoption if the ENV var is actually given (here as "1" or "true", but this logic is then up to the NIF creator).