kubo / rust-oracle

Oracle driver for Rust
191 stars 44 forks source link

static linking possible? #23

Closed arve0 closed 4 years ago

arve0 commented 4 years ago

Hi! Thanks for the library. Is it possible to statically link the oracle instant client?

According to this stackoverflow post about the same in go it seems possible, but I'm new to linking binaries.

What I have tried so far?

tatref commented 4 years ago

Hi,

Doc says it's not supported: https://docs.oracle.com/en/database/oracle/oracle-database/18/rnrdm/linux-platform-issues.html#GUID-D76F3CA5-B23B-4C08-88B2-F9D3DE3A19E3

Older versions (11.2) said you'd need to generate the .a: https://docs.oracle.com/cd/E11882_01/install.112/e24339/post_inst_task.htm#HPCLI1340

kubo commented 4 years ago

@arve0

Is it possible to statically link the oracle instant client?

No. Rust-oracle uses ODPI-C, which loads Oracle client libraries at runtime by using dlopen on Unix or LoadLibrary on Windows. In addition Oracle client static libraries are not supported as follows.

@tatref Thanks for the usable links. I checked more.

Oracle Database Client Installation Guide for Linux (Oracle 12.1, Oracle 11.2) has "Generating the Client Static Library" section. However Release Notes for Linux says it isn't supported.

Oracle 12.1 Release Notes for Linux

You must use the dynamic Oracle client libraries to link the client code on Linux. Do not link the static Oracle client libraries.

Oracle 11.2 Release Notes for Linux

The use of the client static library is not supported.

The "Generating the Client Static Library" section are not found since Oracle 12.2.