!lTqhfnNvIkcEackxxk:matrix.org

Nix Bindings

70 Members
Nix C API https://github.com/NixOS/nix/blob/master/doc/manual/src/c-api.md, language-specific bindings, and their use cases (currently broken link: https://nixos.org/manual/nix/unstable/c-api)19 Servers

Load older messages


SenderMessageTime
29 May 2025
@roberthensing:matrix.orgRobert Hensing (roberth)ok14:20:09
@o-santi:matrix.orgLeonardo Santiagoyep, apparently it worked14:30:58
@o-santi:matrix.orgLeonardo Santiagonope, false positive, tested on old nix version14:35:18
@o-santi:matrix.orgLeonardo Santiago just to confirm, indeed the bump made the jump from gcc13 to gcc14 and it seems to be inline with this gentoo forum error report: https://forums.gentoo.org/viewtopic-t-1172390-start-0.html 15:23:17
@o-santi:matrix.orgLeonardo Santiago * just to confirm, indeed the nixpkgs bump made the jump from gcc13 to gcc14 and it seems to be inline with this gentoo forum error report: https://forums.gentoo.org/viewtopic-t-1172390-start-0.html 15:23:52
@o-santi:matrix.orgLeonardo Santiago though I'm not entirely sure where this mismatch comes from. maybe the libclang I'm using in bindgen is equivalent to gcc13? I tried updating nixpkgs to latest but nothing worked 15:25:09
@o-santi:matrix.orgLeonardo Santiagohttps://github.com/llvm/llvm-project/issues/9661015:54:41
@o-santi:matrix.orgLeonardo Santiago this means that you're using bindgen with gcc, is that correct? 15:55:12
@o-santi:matrix.orgLeonardo Santiagoor, at least, linking it15:55:24
@roberthensing:matrix.orgRobert Hensing (roberth)correct - an unmodified bindgen, which uses clang as a library internally for code generation, whereas Nix is built with gcc16:23:39
@o-santi:matrix.orgLeonardo Santiagoand how do you make it link with gcc correctly? 16:25:45
@o-santi:matrix.orgLeonardo Santiago I've taken a look at your nci.nix and I thought it might be either the postConfigure script or the NIX_CC_UNWRAPPED part but none of these had any effect 16:26:26
@o-santi:matrix.orgLeonardo Santiago oh, I see the issue, the script seems to be correctly adding gcc into the include path, but it's gcc13, not the one used by nix 16:54:42
@o-santi:matrix.orgLeonardo Santiago and this is because I'm on nixos-24.11 not nixos-unstable! 16:57:00
@o-santi:matrix.orgLeonardo Santiago * and this is because I'm on nixos-24.11 not nixos-unstable, so updating it did not fast forward it enough 16:57:09
@o-santi:matrix.orgLeonardo Santiago finally 16:57:19
@o-santi:matrix.orgLeonardo Santiago * finally it works 16:57:22
@o-santi:matrix.orgLeonardo Santiago now I'm having trouble with libflake-c 19:52:30
@o-santi:matrix.orgLeonardo Santiago for instance, I cannot seem to simply call nix_flake_reference_and_fragment_from_string 19:53:58
@o-santi:matrix.orgLeonardo Santiago

it complains that

Error: nix::MissingExperimentalFeature: experimental Nix feature 'flakes' is disabled; add '--extra-experimental-features flakes' to enable it
NixInfo: error: experimental Nix feature 'flakes' is disabled; add '--extra-experimental-features flakes' to enable it
19:54:45
@o-santi:matrix.orgLeonardo Santiago I imagined this was because I didn't have any NixEvalState associated, as I'm simply trying to parse a flake reference, not evaluate it 19:55:21
@o-santi:matrix.orgLeonardo Santiago * I imagined this was because I didn't have any NixEvalState associated, as I'm simply trying to parse a flake reference, not evaluate it, and thus I didn't call nix_flake_settings_add_to_eval_state_builder 19:55:47
@o-santi:matrix.orgLeonardo Santiago fine, I tried hooking up flake_settings to my existing NixEvalStateBuilder, calling the add_to_eval-state_builder and .... nothing, still the same error 19:57:05
@o-santi:matrix.orgLeonardo Santiago * fine, I tried hooking up flake_settings to my existing NixEvalStateBuilder - even though there's no need when it is just for parsing, but I digress - called the add_to_eval-state_builder and .... nothing, still the same error 19:57:44
@o-santi:matrix.orgLeonardo Santiago calling (the equivalent of) nix_setting_set("extra-experimental-features", "flakes") complains about Error: Key does not exist - and I believe the whole point of the libflake-c is to not need to explicitly set it through this roundabout method anyway 20:00:27
@o-santi:matrix.orgLeonardo Santiago Robert Hensing (roberth): is this supposed to work? is there some setup I need to do before calling flake_reference_and_fragment_from_string? I do not see any libflake_init or anything like that, so I don't quite understand 20:01:44
@o-santi:matrix.orgLeonardo Santiago * fine, I tried hooking up flake_settings to my existing NixEvalStateBuilder - even though there should be no need when it is just for parsing, but I digress - called the add_to_eval-state_builder and .... nothing, still the same error 20:03:00
@o-santi:matrix.orgLeonardo SantiagoI cannot even understand where this error is being thrown from, it is happening when I call that specific function but I don't see anywhere inside it checking for the experimental feature20:08:45
1 Jun 2025
@seanthw:matrix.orgSean Thawe joined the room.23:48:58
4 Jun 2025
@deeok:matrix.orgmatrixrooms.info mod bot (does NOT read/send messages and/or invites; used for checking reported rooms) joined the room.15:21:03

Show newer messages


Back to Room ListRoom Version: 10