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
Describe the bug
The C API used in this library seems to be outdated. Given that the corresponding nix-c-bindings branch has been merged to master, it might be valuable to make sure it works with the newest version.
To Reproduce
Use python-nix with an up to date version of nix with C bindings, making sure to override the nix input to the newest version. The following flake uses the most up to date (2.22) version, but I've tested other versions that also don't work (tested with 2.21 and 2.20).
$ nix develop
$ python3
Python 3.11.6 (main, Oct 2 2023, 13:45:54) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license"for more information.
>>> import nix
>>> nix.eval('1 + 1')
Traceback (most recent call last):
File "<stdin>", line 1, in<module>
File "/nix/store/3rb1nsykazqlgbagx6f227sdx17w805g-python3-3.11.6-env/lib/python3.11/site-packages/nix/__init__.py", line 20, ineval
_store = Store()
^^^^^^^
File "/nix/store/3rb1nsykazqlgbagx6f227sdx17w805g-python3-3.11.6-env/lib/python3.11/site-packages/nix/store.py", line 40, in __init__
self._store = ffi.gc(lib.nix_store_open(url_c, params_c), lib.nix_store_unref)
^^^^^^^^^^^^^^^^^^^
File "/nix/store/3rb1nsykazqlgbagx6f227sdx17w805g-python3-3.11.6-env/lib/python3.11/site-packages/nix/wrap.py", line 55, in __getattr__
r: Any = wrap_ffi(getattr(self._thing, attr))
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: cffi library 'nix._nix_api_store' has no function, constant or global variable named 'nix_store_unref'. Did you mean: 'nix_store_free'?
>>>
Expected behavior
Output the number two.
Environment
NixOS 24.05.20240329.d8fe5e6 (Uakari)
Version of the code: master.
Additional context
This seems to be a name change of the function, from nix_store_unref to nix_store_free, though I'm not sure what else changed.
The text was updated successfully, but these errors were encountered:
o-santi
changed the title
Outdated functions C API
Outdated functions in C API
Apr 5, 2024
Describe the bug
The C API used in this library seems to be outdated. Given that the corresponding
nix-c-bindings
branch has been merged to master, it might be valuable to make sure it works with the newest version.To Reproduce
Use python-nix with an up to date version of nix with C bindings, making sure to override the nix input to the newest version. The following flake uses the most up to date (2.22) version, but I've tested other versions that also don't work (tested with 2.21 and 2.20).
Then, in a shell.
Expected behavior
Output the number two.
Environment
Additional context
This seems to be a name change of the function, from
nix_store_unref
tonix_store_free
, though I'm not sure what else changed.The text was updated successfully, but these errors were encountered: