You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nix fails to build with the following error message when using a version of nlohmann's json library that includes the binary type feature.
builder for '/nix/store/cd3a1sxaq9idl129bvgbgrazpfnpp792-nix-3.0pre20200829_f156513.drv' failed with exit code 2; last 10 log lines:
from src/libexpr/json-to-value.cc:4:
/nix/store/a15crh4aa98283pmx0gxzchgi39547qf-nlohmann_json-3.9.1/include/nlohmann/detail/input/binary_reader.hpp:289:113: error: 'nlohmann::json_sax<nlohmann::basic_json<> >' is not an accessible base of 'nlohmann::detail::binary_reader<nlohmann::basic_json<>, nlohmann::detail::iterator_input_adapter<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >, nix::JSONSax>::json_sax_t' {aka 'nix::JSONSax'}
289 | return get_number<std::int32_t, true>(input_format_t::bson, len) && get_bson_binary(len, value) && sax->binary(value);
CXX src/nix/repl.o
CXX src/libexpr/nixexpr.o
CXX src/nix/registry.o
CXX src/nix/profile.o
CXX src/nix/ping-store.o
make: *** [mk/patterns.mk:3: src/libexpr/json-to-value.o] Error 1
make: *** Waiting for unfinished jobs....
Steps To Reproduce
nix run -I nixpkgs=channel:nixos-unstable nixpkgs.nixpkgs-review -c nixpkgs-review pr 97266
Expected behavior
Builds
nix-env --version output
nix-env (Nix) 2.3.6
Additional context
This was caused by changes to the Sax class in version 3.8.0 to accommodate a new internal type called "binary" which handles binary input/output from binary filetypes (such as CBOR and BSON). You'll need to implement a binary method in the nix::JSONSax class. I do not think you are currently using binary types, so you can just implement a "do nothing" version safely. There are examples of this in the nlohmann JSON tests.
The text was updated successfully, but these errors were encountered:
Describe the bug
Nix fails to build with the following error message when using a version of nlohmann's json library that includes the binary type feature.
Steps To Reproduce
nix run -I nixpkgs=channel:nixos-unstable nixpkgs.nixpkgs-review -c nixpkgs-review pr 97266
Expected behavior
Builds
nix-env --version
outputnix-env (Nix) 2.3.6
Additional context
This was caused by changes to the Sax class in version 3.8.0 to accommodate a new internal type called "binary" which handles binary input/output from binary filetypes (such as CBOR and BSON). You'll need to implement a
binary
method in thenix::JSONSax
class. I do not think you are currently using binary types, so you can just implement a "do nothing" version safely. There are examples of this in the nlohmann JSON tests.The text was updated successfully, but these errors were encountered: