NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.94k stars 1.53k forks source link

nix-store-c: `std::string_view` exposed as `const * char` in `nix_store_parse_path` #11995

Closed jsoo1 closed 2 days ago

jsoo1 commented 2 days ago

Describe the bug

parseStorePath takes a std::string_view, but the C external api exposes a const * char. Unless I'm missing something this effectively means that the C side has to re-implement a C++ std library type to correctly parse a store path.

I don't know what standards we want to have for C->C++ strings but I bet a * char + length encoding would work.

Expected behavior

There should be a C-encoded means of passing strings from C->C++.

Metadata

$ pkg-config --print-provides nix-store-c
nix-store-c = 2.24.10

Checklist


Add :+1: to issues you find important.

jsoo1 commented 2 days ago

Well, must be a me problem :shrug: .