gonix icon indicating copy to clipboard operation
gonix copied to clipboard

Update go bindings to version merged into nixos/nix

Open marcusramberg opened this issue 1 year ago • 6 comments

Opening this for discussion, currently it builds but has one test failure related to paths (leading . is stripped).

marcusramberg avatar May 02 '24 08:05 marcusramberg

I looked through this and the code is very clean, great job. Accessing the strings is so much nicer with the new API, too.

farcaller avatar May 04 '24 19:05 farcaller

@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?

farcaller avatar May 10 '24 11:05 farcaller

@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)

marcusramberg avatar May 10 '24 12:05 marcusramberg

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.

farcaller avatar May 10 '24 13:05 farcaller

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.

farcaller avatar May 10 '24 13:05 farcaller

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?

marcusramberg avatar May 10 '24 13:05 marcusramberg

Updated the deps again today, and seems the issue was fixed upstream. All tests pass now.

marcusramberg avatar May 28 '24 22:05 marcusramberg

Seems the fix was NixOS/nix@a942a34 (#10767)

marcusramberg avatar May 28 '24 22:05 marcusramberg

Thank you so much for all the work you've put into this! 🥳

farcaller avatar May 31 '24 09:05 farcaller