sqitchers / homebrew-sqitch

Homebrew Formulas for Sqitch
22 stars 10 forks source link

sqitch_oracle fails to build on OSX #15

Closed chiefgecko closed 5 years ago

chiefgecko commented 9 years ago

sqitch_mysql builds on OSX Yosemite sqitch_pg builds on OSX Yosemite sqitch_sqitch_oracle/DBD::Oracle fails to build on OSX Yosemite

myself@me.local [/Users/myself]
$ env | egrep "^DYLD|^PATH=|^ORACLE_[BH]"
ORACLE_BASE=/opt/oracle/base
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/oracle/base/product/11204/instantclient_11_2
DYLD_LIBRARY_PATH=/opt/oracle/base/product/11204/instantclient_11_2
ORACLE_HOME=/opt/oracle/base/product/11204/instantclient_11_2
myself@me.local [/Users/myself]
$ which sqlplus
/opt/oracle/base/product/11204/instantclient_11_2/sqlplus
myself@me.local [/Users/myself]
$ l $ORACLE_HOME/*dylib
lrwxr-xr-x 1 root wheel 20 Aug 31 21:08 /opt/oracle/base/product/11204/instantclient_11_2/libclntsh.dylib -> libclntsh.dylib.11.1
-r-xr-xr-x@ 1 root wheel 13744 Jan 7 2014 /opt/oracle/base/product/11204/instantclient_11_2/libheteroxa11.dylib
-r-xr-xr-x@ 1 root wheel 2817872 Jan 29 2014 /opt/oracle/base/product/11204/instantclient_11_2/libnnz11.dylib
lrwxr-xr-x 1 root wheel 18 Aug 31 21:08 /opt/oracle/base/product/11204/instantclient_11_2/libocci.dylib -> libocci.dylib.11.1
-rwxrwxrwx@ 1 root wheel 118707148 Apr 10 2014 /opt/oracle/base/product/11204/instantclient_11_2/libociei.dylib
-r-xr-xr-x@ 1 root wheel 159004 Jan 7 2014 /opt/oracle/base/product/11204/instantclient_11_2/libocijdbc11.dylib
-r-xr-xr-x@ 1 root wheel 1365444 Jan 27 2014 /opt/oracle/base/product/11204/instantclient_11_2/libsqlplus.dylib
-r-xr-xr-x@ 1 root wheel 1504252 Jan 7 2014 /opt/oracle/base/product/11204/instantclient_11_2/libsqlplusic.dylib
myself@me.local [/Users/myself]
$ file $(which sqlplus)
/opt/oracle/base/product/11204/instantclient_11_2/sqlplus: Mach-O 64-bit executable x86_64
myself@me.local [/Users/myself]
$ brew info sqitch
theory/sqitch/sqitch: stable 0.9993, HEAD
http://sqitch.org/
/usr/local/Cellar/sqitch/0.9993 (243 files, 3.0M) *
Built from source
From: https://github.com/theory/homebrew-sqitch/blob/master/Formula/sqitch.rb
==> Dependencies
Required: sqitch_dependencies ✔
myself@me.local [/Users/myself]
$ brew install sqitch_oracle
==> Installing sqitch_oracle from theory/homebrew-sqitch
==> Downloading file:///usr/local/README.md
Already downloaded: /Library/Caches/Homebrew/sqitch_oracle-0.9993.md
==> cpanm --local-lib '/usr/local/Cellar/sqitch_oracle/0.9993' --notest DBD::Oracle
--> Working on DBD::Oracle
Fetching http://www.cpan.org/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz ... OK
Configuring DBD-Oracle-1.74 ... OK
Building DBD-Oracle-1.74 ... ! Installing DBD::Oracle failed. See /private/tmp/sqitch_oracle20150831-34500-5cqjrl/.brew_home/.cpanm/work/1441080994.34514/build.log for details. Retry with --force to force install it.
FAIL

READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
https://github.com/theory/homebrew-sqitch/issues

myself@me.local [/Users/myself]
$ l /private/tmp/sqitch_oracle20150831-34500-5cqjrl/.brew_home/.cpanm/work/1441080994.34514/build.log
ls: /private/tmp/sqitch_oracle20150831-34500-5cqjrl/.brew_home/.cpanm/work/1441080994.34514/build.log: No such file or directory
myself@me.local [/Users/myself]
$ uname -a
Darwin me.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
myself@me.local [/Users/myself]
$
theory commented 9 years ago

Can't do much without that log, but I suspect it's not finding the instantclient stuff. What happens if you try to build it manually? Or just run cpan DBD::Oracle?

chiefgecko commented 9 years ago

Seems to work.

myself@me.local [/Users/myself]
$ which cpanm
/usr/local/bin/cpanm
myself@me.local [/Users/myself]
$ cpanm DBD::Oracle
!
! Can't write to /Library/Perl/5.18 and /usr/local/bin: Installing modules to /Users/myself/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /Library/Perl/5.18 and /usr/local/bin)
!   - Configure local::lib your existing local::lib in this shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!         cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
--> Working on DBD::Oracle
Fetching http://www.cpan.org/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz ... OK
Configuring DBD-Oracle-1.74 ... OK
Building and testing DBD-Oracle-1.74 ... OK
Successfully installed DBD-Oracle-1.74
1 distribution installed
myself@me.local [/Users/myself]
$ brew install sqitch_oracle
==> Installing sqitch_oracle from theory/homebrew-sqitch
==> Downloading file:///usr/local/README.md
Already downloaded: /Library/Caches/Homebrew/sqitch_oracle-0.9993.md
==> cpanm --local-lib '/usr/local/Cellar/sqitch_oracle/0.9993' --notest DBD::Oracle
--> Working on DBD::Oracle
Fetching http://www.cpan.org/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz ... OK
Configuring DBD-Oracle-1.74 ... OK
Building DBD-Oracle-1.74 ... ! Installing DBD::Oracle failed. See /private/tmp/sqitch_oracle20150901-65103-1pw1f21/.brew_home/.cpanm/work/1441157861.65124/build.log for details. Retry with --force to force install it.
FAIL

READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
  https://github.com/theory/homebrew-sqitch/issues

myself@me.local [/Users/myself]
$ l /private/tmp/sqitch_oracle20150901-65103-1pw1f21/.brew_home/.cpanm/work/1441157861.65124/build.log
ls: /private/tmp/sqitch_oracle20150901-65103-1pw1f21/.brew_home/.cpanm/work/1441157861.65124/build.log: No such file or directory
myself@me.local [/Users/myself]
$
theory commented 9 years ago

Hrm. Then maybe ORACLE_HOME is not getting passed through to brew? I don't know.

theory commented 5 years ago

I managed to track this down while working on the new formula, release yesterday for v0.9998. Turns out, Homebrew filters out all variables unless the star with HOMEBREW_. So I added the HOMEBREW_ORACLE_HOME environment variable:

export HOMEBREW_ORACLE_HOME=/oracle/instantclient_12_2
brew install sqitch --with-oracle-support

Details here.

chiefgecko commented 5 years ago

Confirmed

myself@me.local [/Users/myself]
$ (export HOMEBREW_ORACLE_HOME=$ORACLE_HOME; brew install sqitch --with-oracle-support)
==> Installing sqitch from sqitchers/sqitch
==> Installing dependencies for sqitchers/sqitch/sqitch: perl, cpanminus
==> Installing sqitchers/sqitch/sqitch dependency: perl
==> Downloading https://homebrew.bintray.com/bottles/perl-5.28.0.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring perl-5.28.0.mojave.bottle.tar.gz
==> Caveats
By default non-brewed cpan modules are installed to the Cellar. If you wish
for your modules to persist across updates we recommend using `local::lib`.

You can set that up like this:
  PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib
  echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"' >> ~/.bash_profile
==> Summary
🍺  /usr/local/Cellar/perl/5.28.0: 2,456 files, 63.1MB
==> Installing sqitchers/sqitch/sqitch dependency: cpanminus
==> Downloading https://github.com/miyagawa/cpanminus/archive/1.7044.tar.gz
==> Downloading from https://codeload.github.com/miyagawa/cpanminus/tar.gz/1.7044
######################################################################## 100.0%
🍺  /usr/local/Cellar/cpanminus/1.7044: 6 files, 379.6KB, built in 4 seconds
==> Installing sqitchers/sqitch/sqitch --with-oracle-support
==> Downloading http://cpan.cpantesters.org/authors/id/D/DW/DWHEELER/App-Sqitch-0.9998.tar.gz
######################################################################## 100.0%
==> cpanm --local-lib instutil --quiet --notest Menlo::CLI::Compat Module::Build
==> perl Build.PL --quiet --install_base /usr/local/Cellar/sqitch/0.9998 --etcdir /usr/local/etc/sqitch --with oracle
==> ./Build bundle
==> Oracle Support Notes
Oracle support requires the Oracle Instant Client Basic, SQL*Plus,
and SDK packages.

- Found Basic:    /usr/local/oracle/base/product/1220/instantclient_12_2/libclntsh.dylib
- Found SDK:      /usr/local/oracle/base/product/1220/instantclient_12_2/sdk/include
- Found SQL*Plus: /usr/local/oracle/base/product/1220/instantclient_12_2/sqlplus

  Make sure SQL*Plus is in your $PATH or tell Sqitch where to find
  it by running:

      sqitch config --user engine.oracle.client /usr/local/oracle/base/product/1220/instantclient_12_2/sqlplus

🍺  /usr/local/Cellar/sqitch/0.9998: 2,736 files, 31.5MB, built in 2 minutes 47 seconds
==> Caveats
==> perl
By default non-brewed cpan modules are installed to the Cellar. If you wish
for your modules to persist across updates we recommend using `local::lib`.

You can set that up like this:
  PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib
  echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"' >> ~/.bash_profile
myself@me.local [/Users/myself]
$ 
theory commented 5 years ago

Hey, thanks for taking the time three years later to check it out, @chiefgecko!