nix-doc
nix-doc copied to clipboard
Undefined symbol error on plugin load on NixOS
After following the README's instructions for installing nix-doc plugin on NixOS, nixos-rebuild switch
yields the following error:
error: builder for '/nix/store/6iz597466f3qm63jplh5qk2w41mq1njs-nix.conf.drv' failed with exit code 1;
last 2 log lines:
> Checking that Nix can read nix.conf...
> error: could not dynamically open plugin file '/nix/store/5rwhk2lw7rl8k53rhlaxpvwch0s05fr0-nix-doc-0.5.1/lib/libnix_doc_plugin.so': /nix/store/5rwhk2lw7rl8k53rhlaxpvwch0s05fr0-nix-doc-0.5.1/lib/libnix_doc_plugin.so: undefined symbol: _ZN3nix9EvalState12callFunctionERNS_5ValueES2_S2_RKNS_3PosE
System info:
- NixOS version: 22.05.20211214.a2e281f (Quokka)
- nix version: nix (Nix) 2.5.0pre20211206_d1aaa7e
I believe that this is a mismatch between the nix version that nix-doc was built with and the version of Nix on the system due to using Nix unstable. Might have to add an overlay to set the version that goes into the nix-doc package.
Had the same error when trying to load the plugin in linux with nix 2.4.
Check that you're using the latest version of nixpkgs. They pinned it to an older Nix version for a period of time before I fixed the plug-in and submitted a version that works with 2.4.
For some reason this issue didn't get linked: https://github.com/NixOS/nixpkgs/issues/237637
I am actually properly looking into that instance of it now, and my suspicion is that it is related to the systemd-boot builder getting called prior to the new /etc being activated. Overall take now: this is total hot trash, and I don't think this is avoidable without more aggressive tactics. In particular, said more aggressive tactics will probably need to take the form of figuring out how to defer the dynamic linker error until builtins.doc is actually called. Doing so would eliminate any further recurrences of this issue forever.
Or to check that the version of Nix is correct before continuing loading.
Fixed in 0.5.10