Mailing List Archive

Problem with BRICOLAGE_PG_HOSTNAME and BRICOLAGE_PG_CONFIG_PATH
Howdy,

I recently wiped my laptop and was finally getting around to re-installing Bricolage on it today (OSX 10.7). Everything went pretty swimmingly … Bricolage is now running locally, which is great.

However, when I attempt to 'make dev' out of the directory where I git cloned to, I run into an error that I think is because the 'make dev' script is trying to use /usr/bin/psql vs. the more recent version I have installed in /Library/PostgreSQL/9.1/bin/psql

However, when I try to pass this to make dev like so:

sudo make dev BRICOLAGE_HTTPD_VERSION=apache2 BRICOLAGE_SSL=0 BRICOLAGE_PG_HOSTNAME="localhost" BRICOLAGE_PG_CONFIG_PATH="/Library/PostgreSQL/9.1/bin/pg_config"

it appears to simply ignore the options.

Also, when I 'make install' from the distribution directory, no matter what I pass to make install, the

DB_HOST
DB_PORT

options in the bricolage.conf are commented out.

I've worked around it, but the other thing that didn't seem to take in the 'make dev' step was the BRICOLAGE_PG_SUPERPASS … I had to enter the password about 15 times to get through the make dev process.

However, now that everything is linked up from /usr/local/bricolage to my git repository, Bricolage fails to start with

######################################################################

Cannot load Bricolage libraries. Please set the environment
variable BRICOLAGE_ROOT to the location of your Bricolage
installation or set the environment variable PERL5LIB to the
directory where Bricolage's libraries are installed.

The specific error encountered was as follows:

Can't locate Exception/Class.pm in @INC (@INC contains: /usr/local/bricolage/lib /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at /usr/local/bricolage/lib/Bric/Util/Fault.pm line 151.
BEGIN failed--compilation aborted at /usr/local/bricolage/lib/Bric/Util/Fault.pm line 151.
Compilation failed in require at /usr/local/bricolage/lib/Bric.pm line 54.
BEGIN failed--compilation aborted at /usr/local/bricolage/lib/Bric.pm line 54.
Compilation failed in require at /usr/local/bricolage/bin/bric_apachectl line 59.
######################################################################

No matter what I do -- exporting PERL5LIB or BRICOLAGE_ROOT -- I get the same error, and from the output above I can see that it's not appending the path to @INC My libraries are in /Users/phillipadsmith/perl5/perlbrew/perls/perl-5.14.2/lib

I didn't have this problem when I made and ran Bricolage via the distribution, i.e., not the development install.

Any thoughts / pointers appreciated.

(I'm also wondering if I can just symlink bin, comp, and lib from /usr/local/bricolage to my git repo and safely skip the whole 'make dev' step?

Phillip.

--
Phillip Smith
http://phillipadsmith.com
http://twitter.com/phillipadsmith
http://linkedin.com/in/phillipadsmith

Save our in-boxes! http://emailcharter.org
Re: Problem with BRICOLAGE_PG_HOSTNAME and BRICOLAGE_PG_CONFIG_PATH [ In reply to ]
On Mar 20, 2012, at 8:20 PM, Phillip Smith wrote:

> No matter what I do -- exporting PERL5LIB or BRICOLAGE_ROOT -- I get the same error, and from the output above I can see that it's not appending the path to @INC My libraries are in /Users/phillipadsmith/perl5/perlbrew/perls/perl-5.14.2/lib
>
> I didn't have this problem when I made and ran Bricolage via the distribution, i.e., not the development install.
>
> Any thoughts / pointers appreciated.

Did you run `perl Makefile.PL` first? That will make it use the same Perl throughout, and it sounds like it’s not doing that.

> (I'm also wondering if I can just symlink bin, comp, and lib from /usr/local/bricolage to my git repo and safely skip the whole 'make dev' step?

You could, yes. More of a PITA, though.

David
Re: Problem with BRICOLAGE_PG_HOSTNAME and BRICOLAGE_PG_CONFIG_PATH [ In reply to ]
On 2012-03-21, at 10:06 AM, David E. Wheeler wrote:

> On Mar 20, 2012, at 8:20 PM, Phillip Smith wrote:
>
>> No matter what I do -- exporting PERL5LIB or BRICOLAGE_ROOT -- I get the same error, and from the output above I can see that it's not appending the path to @INC My libraries are in /Users/phillipadsmith/perl5/perlbrew/perls/perl-5.14.2/lib
>>
>> I didn't have this problem when I made and ran Bricolage via the distribution, i.e., not the development install.
>>
>> Any thoughts / pointers appreciated.
>
> Did you run `perl Makefile.PL` first? That will make it use the same Perl throughout, and it sounds like it’s not doing that.

All working now…

Not sure what happened there. There were some other scripts I was running that were looking for perl in /usr/local/bin/ … so I symlinked my perlbrew perl binary to that location. However, when I checked, it wasn't linked, but instead had a copy of the file there. Odd.

Anyway, I deleted that binary and re-ran the whole thing ensuring that it was running from /Users/phillipadsmith/perl5/perlbrew/perls/perl-5.14.2/bin/perl and everything worked.

However, one odd thing, it put some crazy password for the 'bric' user into the .conf file. Looked like a hashed password or something? Once that was replaced with the real password everything worked fine.

Zero-to-installed time (minus the message to this list), including Apache2, mod_perl, etc., etc.: 2 hours, 30 minutes. Getting better all the time. :)

Phillip.

--
Phillip Smith
http://phillipadsmith.com
http://twitter.com/phillipadsmith
http://linkedin.com/in/phillipadsmith

Save our in-boxes! http://emailcharter.org
Re: Problem with BRICOLAGE_PG_HOSTNAME and BRICOLAGE_PG_CONFIG_PATH [ In reply to ]
On Mar 21, 2012, at 9:24 AM, Phillip Smith wrote:

> Not sure what happened there. There were some other scripts I was running that were looking for perl in /usr/local/bin/ … so I symlinked my perlbrew perl binary to that location. However, when I checked, it wasn't linked, but instead had a copy of the file there. Odd.
>
> Anyway, I deleted that binary and re-ran the whole thing ensuring that it was running from /Users/phillipadsmith/perl5/perlbrew/perls/perl-5.14.2/bin/perl and everything worked.
>
> However, one odd thing, it put some crazy password for the 'bric' user into the .conf file. Looked like a hashed password or something? Once that was replaced with the real password everything worked fine.

If you run it in QUIET mode it defaults to a random password. Looks like it’s because `ask_password()` requires that a password be input if the default is "NONE", so a random password gets around that. But if you trust all local connections (and there usually is no reason not to on a laptop), it should not matter.

You can set a superuser password with PG_SUPERPASS. I don't see a setting for the bricolage password, probably because it ought to be different for every installation? Would be nice to automate, though. Not sure why it isn’t. What happens if you set PGPASSWORD?

> Zero-to-installed time (minus the message to this list), including Apache2, mod_perl, etc., etc.: 2 hours, 30 minutes. Getting better all the time. :)

Cool.

David
Re: Problem with BRICOLAGE_PG_HOSTNAME and BRICOLAGE_PG_CONFIG_PATH [ In reply to ]
On 2012-03-21, at 10:50 AM, David E. Wheeler wrote:

> On Mar 21, 2012, at 9:24 AM, Phillip Smith wrote:
>
>> Not sure what happened there. There were some other scripts I was running that were looking for perl in /usr/local/bin/ … so I symlinked my perlbrew perl binary to that location. However, when I checked, it wasn't linked, but instead had a copy of the file there. Odd.
>>
>> Anyway, I deleted that binary and re-ran the whole thing ensuring that it was running from /Users/phillipadsmith/perl5/perlbrew/perls/perl-5.14.2/bin/perl and everything worked.
>>
>> However, one odd thing, it put some crazy password for the 'bric' user into the .conf file. Looked like a hashed password or something? Once that was replaced with the real password everything worked fine.
>
> If you run it in QUIET mode it defaults to a random password. Looks like it’s because `ask_password()` requires that a password be input if the default is "NONE", so a random password gets around that. But if you trust all local connections (and there usually is no reason not to on a laptop), it should not matter.
>
> You can set a superuser password with PG_SUPERPASS. I don't see a setting for the bricolage password, probably because it ought to be different for every installation? Would be nice to automate, though. Not sure why it isn’t. What happens if you set PGPASSWORD?

Well, basically how I got around all this was to:

+ make dist
+ perl Makefile.PL && make install in the dist directory, which goes through the verbose set-up
+ rm -r -f /usr/local/bricolage
+ move up to the git clone directory and perl Makefile.PL && make dev

… and that point, the make dev seems to have all of the information it needs, i.e., what I entered during make install for the distribution

I can't seem to get make dev to run in any mode other than quiet, which is a drag as it means I need to remember all of the arguments to pass it, e.g., apache2, no ssl, etc.

Phillip.

--
Phillip Smith
http://phillipadsmith.com
http://twitter.com/phillipadsmith
http://linkedin.com/in/phillipadsmith

Save our in-boxes! http://emailcharter.org
Re: Problem with BRICOLAGE_PG_HOSTNAME and BRICOLAGE_PG_CONFIG_PATH [ In reply to ]
On Mar 21, 2012, at 9:56 AM, Phillip Smith wrote:

> I can't seem to get make dev to run in any mode other than quiet, which is a drag as it means I need to remember all of the arguments to pass it, e.g., apache2, no ssl, etc.

That’s intentional, so installing won’t slow you down.

I have a bunch of aliases to make this simpler for me:

# Bricolage
alias btest="perl Makefile.PL; sudo make devtest TEST_VERBOSE=1 > $HOME/Desktop/bric_test.out 2>&1; tail -50 $HOME/Desktop/bric_test.out"
alias killa="sudo perl /usr/local/bricolage/bin/bric_apachectl stop"
alias kicka="sudo perl /usr/local/bricolage/bin/bric_apachectl restart"
alias starta="sudo perl /usr/local/bricolage/bin/bric_apachectl start"
alias build="/usr/local/bricolage/bin/bric_pgimport -u postgres -p postgres -d sharky -r -g castellan"
alias pbuilds="bbuild BRICOLAGE_HTTPD_VERSION=apache2 BRICOLAGE_DB_TYPE=Pg BRICOLAGE_SSL=1"
alias pbuilds1="bbuild BRICOLAGE_HTTPD_VERSION=apache BRICOLAGE_DB_TYPE=Pg BRICOLAGE_SSL=1"
alias mbuilds="bbuild BRICOLAGE_HTTPD_VERSION=apache2 BRICOLAGE_DB_TYPE=mysql BRICOLAGE_SSL=1"
alias mbuilds1="bbuild BRICOLAGE_HTTPD_VERSION=apache BRICOLAGE_DB_TYPE=mysql BRICOLAGE_SSL=1"
alias pbuild="bbuild BRICOLAGE_HTTPD_VERSION=apache2 BRICOLAGE_DB_TYPE=Pg BRICOLAGE_SSL=0"
alias pbuild1="bbuild BRICOLAGE_HTTPD_VERSION=apache BRICOLAGE_DB_TYPE=Pg BRICOLAGE_SSL=0"
alias mbuild="bbuild BRICOLAGE_HTTPD_VERSION=apache2 BRICOLAGE_DB_TYPE=mysql BRICOLAGE_SSL=0"
alias mbuild1="bbuild BRICOLAGE_HTTPD_VERSION=apache BRICOLAGE_DB_TYPE=mysql BRICOLAGE_SSL=0"

bbuild() {
killa
perl Makefile.PL
sudo make $@ BRICOLAGE_SSL_CERT=/etc/ssl/certs/servercert.pem BRICOLAGE_SSL_KEY=/etc/ssl/private/serverkey.pem dev
}

Best,

David
Re: Problem with BRICOLAGE_PG_HOSTNAME and BRICOLAGE_PG_CONFIG_PATH [ In reply to ]
On 2012-03-21, at 11:27 AM, David E. Wheeler wrote:

> On Mar 21, 2012, at 9:56 AM, Phillip Smith wrote:
>
>> I can't seem to get make dev to run in any mode other than quiet, which is a drag as it means I need to remember all of the arguments to pass it, e.g., apache2, no ssl, etc.
>
> That’s intentional, so installing won’t slow you down.
>
> I have a bunch of aliases to make this simpler for me:

Yep. Super helpful. :)

--
Phillip Smith
http://phillipadsmith.com
http://twitter.com/phillipadsmith
http://linkedin.com/in/phillipadsmith

Save our in-boxes! http://emailcharter.org