Closed ElrohirGT closed 2 weeks ago
the libraries seems to be in the lib version of the package :
I don't know why these two packages are separate, I think there would be a solution to link the two ?
like adding the LD_LIBRARY_PATH
to the <id>-oracle-instantclient-21.10.0.0.0-lib
?
default = pkgs.mkShell {
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [pkgs.oracle-instantclient]};
'';
};
This works for me.
Thank you for your answers! Unfortunetly I no longer have access to any linux machine to tests the changes...
But I honestly think that's the solution. In the end the flake would look like this:
{
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 = lib.makeLibraryPath [oracle-instantclient];
};
}
);
}
I didn't know the packages could have a library path where all this stuff would be located! Nix sure has a lot of quirks. Where did you learn about the function makeLibraryPath
@aca ?
I found it from other pkg definitions. Just tried everything I found. I wish I can learn in better way.
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:
Steps To Reproduce
Steps to reproduce the behavior:
Copy the following flake:
fn main() -> Result<(), Box> {
println!("Conectand a la DB...");
let conn = Connection::connect(
"admin",
"12345678",
"//dbHost:dbPort/dbService",
)?;
println!("Conexión obtenida!");
}
Add a :+1: reaction to issues you find important.