Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Oracle instant Client libraries #310876

Open
ElrohirGT opened this issue May 11, 2024 · 0 comments
Open

Missing Oracle instant Client libraries #310876

ElrohirGT opened this issue May 11, 2024 · 0 comments

Comments

@ElrohirGT
Copy link
Contributor

ElrohirGT commented May 11, 2024

Describe the bug

When I install oracle instant client I expected the /lib directory to contain some libraries, instead it's empty as shown in the screenshot section.

This makes it so that when I try to use the oracle driver for rust it fails with:

Error: DpiError(DbError { code: 0, offset: 0, message: "DPI-1047: Cannot locate a 64-bit Oracle Client library: \"libclntsh.so: cannot open shared object file: No such file or directory\". See https://oracle.github.io/odpi/doc/installation.html#linux for help", fn_name: "dpiContext_createWithParams", action: "load library" })

Steps To Reproduce

Steps to reproduce the behavior:

  1. Copy the following flake:
{
  inputs = {
    naersk.url = "github:nix-community/naersk/master";
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    utils.url = "github:numtide/flake-utils";
  };

  outputs = {
    self,
    nixpkgs,
    utils,
    naersk,
  }:
    utils.lib.eachDefaultSystem (
      system: let
        pkgs = import nixpkgs {
          inherit system;
          config = {allowUnfree = true;};
        };
        naersk-lib = pkgs.callPackage naersk {};
      in {
        defaultPackage = naersk-lib.buildPackage ./db_innit;
        devShell = with pkgs;
          mkShell {
            buildInputs = [
              cargo
              rustc
              rustfmt
              pre-commit
              rustPackages.clippy
            ];
            packages = [
              oracle-instantclient
            ];
            RUST_SRC_PATH = rustPlatform.rustLibSrc;
            # ORACLE_HOME = pkgs.oci-cli;
            # ORACLE_HOME = pkgs.oracle-instantclient;
            LD_LIBRARY_PATH = "${pkgs.oracle-instantclient}/lib";
          };
      }
    );
}
  1. Create an example rust project and add the oracle crate.
  2. Try to connect to a sample DB with:
use oracle::Connection;

fn main() -> Result<(), Box<dyn Error>> {
    println!("Conectand a la DB...");
    let conn = Connection::connect(
        "admin",
        "12345678",
        "//dbHost:dbPort/dbService",
    )?;
    println!("Conexión obtenida!");
}

Expected behavior

EDIT: added link in normally.

I expected the oracle instant client to have all libraries it offers when installed normally.

Screenshots

image

Additional context

Add any other context about the problem here.

Notify maintainers

@dylanmtaylor

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.87, NixOS, 23.11 (Tapir), 23.11.20240421.a5e4bbc`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a 👍 reaction to issues you find important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant