gonix
                                
                                 gonix copied to clipboard
                                
                                    gonix copied to clipboard
                            
                            
                            
                        Update go bindings to version merged into nixos/nix
Opening this for discussion, currently it builds but has one test failure related to paths (leading . is stripped).
I looked through this and the code is very clean, great job. Accessing the strings is so much nicer with the new API, too.
@marcusramberg do you think there's anything else worth doing there or you're good with flipping the draft bit on this and merging it in?
@marcusramberg do you think there's anything else worth doing there or you're good with flipping the draft bit on this and merging it in?
I think the only concern I have is the failing test for path. It's unclear to me why it's returning /foo/bar for ./foo/bar input. ( https://github.com/farcaller/gonix/pull/2/files#diff-864944c880a2e4db1b8f93f33a58303d840fb4b6c50147cc2f915c6d48f7bf2cL173)
I think this is blocked by https://github.com/NixOS/nix/issues/10613. If it's "nix_init_path_from_absolute_path_string" indeed, then our test is broken.
I suggest we update the test case to use the absolute paths and merge this. We can revisit the behavior once https://github.com/NixOS/nix/issues/10613 makes progress.
oki. I just tested updating the flake to nix master, and there's a new failure in the primop test:
❯ go test                                                                                                                                                                              devenv-shell-env
--- FAIL: ExampleRegisterGlobalPrimOp (0.00s)
got:
<nil>
want:
6
--- FAIL: ExampleState_NewPrimOp (0.00s)
panic: failed to call: nix error: error:
       … while calling the 'helloworlder' builtin
       error: Error from builtin function: Value already initialized. Variables are immutable [recovered]
        panic: failed to call: nix error: error:
       … while calling the 'helloworlder' builtin
       error: Error from builtin function: Value already initialized. Variables are immutable
I'll try to address that and change the test this weekend, and undraft the PR?
Updated the deps again today, and seems the issue was fixed upstream. All tests pass now.
Seems the fix was NixOS/nix@a942a34 (#10767)
Thank you so much for all the work you've put into this! 🥳