Why nix-index nix-locate do not find .so files?

Hi there,
I have a special case where nix-index and nix-locate didn’t help out.

Concretely I wanted to connect to oracle and my binary looks for libclntsh.so, which I want to point to via setting LD_LIBRARY_PATH accordingly.

Running nix-index followed by nix-locate libclntsh.so does not give any hit.

The file exists in nixpkgs

Looking around this issue How do I use cx_Oracle to connect to Oracle DB? mentions where the .so file are located, actually it is pkgs.oracle-instantclient.lib, i.e. the lib output.

Even after I included this into my configuration.nix, i.e. the package is build, nix-locate libclntsh.so does not show anything.

What can I do to find such files automatically within nix?

Are there ways with nix-index/nix-locate or other ways how I can find such dependencies without the use of google?
Why is nix-index/nix-locate not enough for this case?

That package is marked unfree, and therefore not built by hydra, therefore nix-index can’t retrieve any hints about its contents from hydra, and therefore it simply can’t be considered by nix-index.

5 Likes

thank you so much for the explanation! that makes sense

I guess then there is no other way but googling/duckduckgo, right?

For such situations, yes, there is currently no way knowing these programmatically.

You have to rely on your web search skills and rural knowledge in the forum and chats.

2 Likes

Wow i didn’t know this, a caveat indeed! :slight_smile:

The only other way i could thing of is to basically nix build every unfree package with the word oracle in it, and then search the /nix/store for the library you want.

a new tool nix-index-unfree that does this be might be worth writing at some stage. :slight_smile: lol

1 Like