Update bindings to be compatible with Nix 2.30, and package with Nix#4
Update bindings to be compatible with Nix 2.30, and package with Nix#4cottand wants to merge 3 commits intofarcaller:masterfrom
Conversation
|
I do also plan to follow up and add the new Flake C API too to my fork, if this PR goes well I will also upstream that here |
2f6fbcd to
7cbc608
Compare
|
I checked out your branch and tried building, but I'm seeing this test failure: (this is on aarch64-linux if that matters) |
|
thanks for checking! I had built on ARM darwin only, and on linux calling I have amended the test to print the error properly, and also added |
|
Btw, seems 2.31 is going to be the next stable version, any reason we're not targetting that? NixOS/nixpkgs#440681 |
result
Outdated
| @@ -0,0 +1 @@ | |||
| /nix/store/la7026kj53y7dmy963ly5b1jx37sn4il-gonix No newline at end of file | |||
There was a problem hiding this comment.
This probably shouldn't have been included in the commit.
There was a problem hiding this comment.
absolutely, my bad.
I also included it in the gitignore
Oh I see, it's not in 25.05. Maybe we could get it backported.. |
|
I can target 2.31 by using https://github.com/NixOS/nix as a flake input rather than It also doesn't seem like there are significant C API changes between |
Brings lib up-to-date so it is compatible with the new C API since Nix 2.24 (now in Nix 2.30!), which now uses the new typdef
nix_value.In order to do this, I also implemented a couple things on the side
nix develop .)CStrings (still many more to go)Because of the new API are a few non-backwards compatible changes:
errorfrom Go, which will get correctly handled on the Nix side*Value, you should now callSetInt(),SetString(), etc on a*Valuethat is provided to you (see C example or Go tests)InitPluginsis gone - I could not get this to work, it seems Nix is not providing it anymore even though it is in the C API header files (although it is not in the docs)GetSettingandSetSettingare often returningkey error, even though the API is unchanged. I am not sure this is a problem in this library, but could not find much in the Nix changelog either.I am not a CGO FFI expert, so there may be incorrect assumptions!