Closed aseyboldt closed 1 year ago
I believe your diagnosis is correct. I have two thoughts:
On:
but if, say, someone would want to load the library using a different interface, that interface would then have to do that...
I believe that the dll_load_path is specific to Python as an additional security feature. To my knowledge $PATH is used elsewhere, so I don’t believe this would be an issue?
I believe that the dll_load_path is specific to Python as an additional security feature. To my knowledge $PATH is used elsewhere, so I don’t believe this would be an issue?
I'll try with the branch from the PR. If this is in fact an issue, I guess we could also expose the function? ie as a verify_library_path
or so, that only does something on windows?.
Since the last release my CI tests for nutpie fail on windows. If my remote debugging is right, this is due to the changes introduced in #118. This adds some code that is executed in
__init__
, ie right at import time, where it callsos.add_dll_directory
with contents of the~/.bridgestan
directory. But if this runs on a fresh install, where stan was not downloaded already, this fails with a FileNotFound error.Some logs from the CI:
https://github.com/pymc-devs/nutpie/actions/runs/5419095619/jobs/9851843966#step:8:335
If my interpretation of this is correct, this could be fixed by delaying the call to
_windows_path_setup
until after bridgestan is downloaded, ie by setting a flag to False at import time, and checking that flag each time a model is compiled. (strictly speaking it would be enough to check when a shared lib is loaded, but if, say, someone would want to load the library using a different interface, that interface would then have to do that...)