sqitchers / homebrew-sqitch

Homebrew Formulas for Sqitch
22 stars 10 forks source link

Templates are not installed under perlbrew #2

Closed theory closed 6 years ago

theory commented 11 years ago

From @heikkil in theory/sqitch#92:

I tried installing sqitch using homebrew (failed, not explored) and cpanm from perlbrew. The installation with perlbrew cpanm went without problems: all tests pass. However, the first tried command on command line, add, failed with "Cannot find deploy template"

Exactly the same happend when I cloned the repo. I am doing this on Mac OS X 10.7.5 and using Perl 10.5.18.0 from perlbrew. OS X does not have GNU gettext so it first has to be installed with homebrew and the binaries added to path: export PATH=/usr/local/Cellar/gettext/0.18.2/bin:$PATH . After that dzilla is able to build a distribution tarball that installs cleanly with cpanm.

Manually copying the templates, cp $REPOHOME/etc/templates $HOME/.sqitch/, fixes the problem.

The etc-path within sqitch seems to be totally wrong and couse of all the trouble: $ sqitch --etc-path .../../etc/sqitch

My hunch is that perlbrew installation has not been tested at all and that etc is not implemented in best possible way.

joevandyk commented 10 years ago

I think I'm getting this same issue with the ppm install method as well. My --etc-path is a directory that doesn't exist.

theory commented 10 years ago

@joevandyk Will likely have to ask the ActivePerl folks what needs to change there…

charlesj commented 9 years ago

Is there a solution to this now? I just completed an install this morning and was walking through the tutorial and ran into this. I'm on windows, running on activeperl, against postgres.

theory commented 9 years ago

@charlesj What's the output of sqitch --etc-path? If you copy the etc directory in the source repository to that spot it should start working properly.

theory commented 9 years ago

BTW, I switched to Strawberry Perl for testing Sqitch on Windows last week. It takes a lot longer to install Sqitch (everything gets built from source), but then all the files are where they belong, including the template files.

charlesj commented 9 years ago

@theory the output of that command was a directory that didn't exist. Instead of going further down that rabbit hole, I instead uninstalled ActivePerl and installed Strawberry Perl. It wasn't too bad to install Sqitch - everything worked out of the box, and I was able to continue down the tutorial. I ran into unrelated problems, but was able to successfully deploy out the schema change to the database, so I'm really happy. The lesson in this case seems to be: use Strawberry Perl on Windows.

theory commented 9 years ago

Yeah, I'm finding Strawberry easier to deal with, as well, so I've added it to the home page.

theory commented 6 years ago

The new formula, released yesterday for v0.9998, explicitly sets the path to the etc directory on build, and the templates should all be installed there:

Build.PL --quiet --install_base #{prefix} --etcdir #{etc}/sqitch
> ls -l $(/usr/local/bin/sqitch --etc-path)/templates/deploy
total 128
-r--r--r--  1 david  admin  221 Aug 20 12:57 exasol.tmpl
-r--r--r--  1 david  admin  221 Aug 20 12:57 firebird.tmpl
-r--r--r--  1 david  admin  229 Aug 20 12:57 mysql.tmpl
-r--r--r--  1 david  admin  212 Aug 20 12:57 oracle.tmpl
-r--r--r--  1 david  admin  229 Aug 20 12:57 pg.tmpl
-r--r--r--  1 david  admin  239 Sep  6 16:36 snowflake.tmpl
-r--r--r--  1 david  admin  229 Aug 20 12:57 sqlite.tmpl
-r--r--r--  1 david  admin  212 Aug 20 12:57 vertica.tmpl