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

oracle-instantclient: 12.2.0.1.0 -> 19.3.0.0.0 #67206

Merged
merged 9 commits into from Aug 23, 2019

Conversation

flokli
Copy link
Contributor

@flokli flokli commented Aug 21, 2019

Motivation for this change

It's now possible to download Oracle Instant Client without having to
click a checkbox to agree to the license, and then log in with an Oracle
account to start the download, at least on Linux (for now).

Darwin still seems to be at 18.1 (and needs manual fetching).
Version numbers haven't been that aligned recently, so I refactored the derivation to support different version numbers and fetchers per platform.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Repro:

$(nix-build -E "with import /path/to/checkout {};python3.withPackages (p: [p.cx_oracle p.ptpython])")/bin/ptpython
import cx_Oracle
connection = cx_Oracle.connect("MAIN_USER/MAIN_PASSWORD@localhost/orclpdb1")

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will test once I get a chance.

@flokli
Copy link
Contributor Author

flokli commented Aug 21, 2019

Was able to build perlPackages.DBDOracle, phpPackages.oci8 and python3.pkgs.cx_oracle successfully.

Poked at the .so files on linux, and tried connecting through the python bindings. Looks good so far :-)

@aanderse, could you take a look at situation on darwin? At least the python bindings previously did work previously…

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After making the mentioned changes to your branch I was able to compile the following on darwin:

  • oracle-instantclient
  • php72Packages.oci8
  • php73Packages.oci8
  • python3.pkgs.cx_oracle

And without making any changes I was able to compile the following on linux:

  • oracle-instantclient
  • php72Packages.oci8
  • php73Packages.oci8
  • python3.pkgs.cx_oracle
  • perlPackages.DBDOracle
  • perldevelPackages.DBDOracle

perldevelPackages.DBDOracle had the following failure on darwin:

#   Failed test 'require DBDOracleTestLib;'
#   at t/00dbdoracletestlib.t line 11.
#     Tried to require 'DBDOracleTestLib'.
#     Error:  Can't load '/private/var/folders/3y/f246ctxd07g_ght97sqhlhs80000gp/T/nix-build-perl5.31.2-DBD-Oracle-1.80.drv-0/DBD-Oracle-1.76/blib/arch/auto/DBD/Oracle/Oracle.bundle' for module DBD::Oracle: dlopen(/private/var/folders/3y/f246ctxd07g_ght97sqhlhs80000gp/T/nix-build-perl5.31.2-DBD-Oracle-1.80.drv-0/DBD-Oracle-1.76/blib/arch/auto/DBD/Oracle/Oracle.bundle, 2): Library not loaded: @rpath/libclntsh.dylib.18.1
#   Referenced from: /private/var/folders/3y/f246ctxd07g_ght97sqhlhs80000gp/T/nix-build-perl5.31.2-DBD-Oracle-1.80.drv-0/DBD-Oracle-1.76/blib/arch/auto/DBD/Oracle/Oracle.bundle
#   Reason: image not found at /nix/store/q9dgm21xc01as964s5fj5kqyq9cs0ivs-perl-5.31.2/lib/perl5/5.31.2/darwin-2level/DynaLoader.pm line 197.
#  at t/lib/DBDOracleTestLib.pm line 29.

It's now possible to download Oracle Instant Client without having to
click a checkbox to agree to the license, and then log in with an Oracle
account to start the download, at least on Linux (for now).

Darwin still seems to be at 18.1, and version numbers haven't been that
aligned recently, so allow different version numbers per platform.
This wasn't about PECL::oci8 in first place, but DBD-Oracle.

In the current version of oracle-instantclient, a libclntsh.so is
shipped, so DBD-Oracle is happy.
libclntsh.so* and libocci.so* are symlinks to the latest version.

By using `install`, these are all dereferenced and duplicated.

Let's avoid that, and shrink the lib output from 621M to 226M.
@flokli
Copy link
Contributor Author

flokli commented Aug 22, 2019

I adressed all the changes, and could get perlPackages.DBDOracle to build on macos aswell - had to add ${oracle-instantclient.lib}/lib to the rpath of the resulting Oracle.bundle file. The tests now pass there, too.

@flokli flokli changed the title WIP: oracle-instantclient: 12.2.0.1.0 -> 19.3.0.0.0 oracle-instantclient: 12.2.0.1.0 -> 19.3.0.0.0 Aug 22, 2019
Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully tested connectivity to an oracle database using phpPackages.oci8. 👍

Thanks @flokli!

@aanderse aanderse merged commit 890196d into NixOS:master Aug 23, 2019
@flokli flokli deleted the oracle-instantclient-19.3 branch August 25, 2019 09:57
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-do-i-use-cx-oracle-to-connect-to-oracle-db/6944/1

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

Successfully merging this pull request may close these issues.

None yet

3 participants