This repository has been archived by the owner. It is now read-only.

rrdtool Perl Library Module #12090

Closed
chleggett opened this Issue May 5, 2012 · 10 comments

Comments

Projects
None yet
8 participants
@chleggett

chleggett commented May 5, 2012

I am trying to create a formula for smokeping which will depend on the rrdtool formula. Specifically the RRDs perl module.

I am having trouble confirming that the RRDs perl module is installed correctly by the rrdtool formula.

Can anyone else test and confirm?

Let me know.

Thanks.

@jacknagel

This comment has been minimized.

Contributor

jacknagel commented May 5, 2012

@adamv @Sharpie

Currently the rrdtool formula does this

    opoo "Using system Ruby. RRD module will be installed to /Library/Ruby/..." if which_ruby == "/usr/bin/ruby"
    opoo "Using system Perl. RRD module will be installed to /Library/Perl/..." if which_perl == "/usr/bin/perl"

    args = ["--disable-dependency-tracking", "--prefix=#{prefix}", "--mandir=#{man}"]
    args << "--enable-perl-site-install" if which_perl == "/usr/bin/perl"
    args << "--enable-ruby-site-install" if which_ruby == "/usr/bin/ruby"

instead of installing things into its keg. Thoughts?

@adamv

This comment has been minimized.

Contributor

adamv commented May 6, 2012

Right, this was kind of a cop-out in the first place.

I don't use this software with or without a Ruby module to have more insight.

@mistydemeo mistydemeo closed this in 393941d Jun 1, 2012

@mistydemeo

This comment has been minimized.

Contributor

mistydemeo commented Jun 1, 2012

@jacknagel This actually doesn't work, since which returns a Pathname object, so a comparison with a string would never return true.

Fix in 393941d.

@chleggett Can you confirm whether this fixes it for you?

@jacknagel

This comment has been minimized.

Contributor

jacknagel commented Jun 1, 2012

Ah, it used to be a string, but when I updated it to use the which helper I didn't update the conditionals. Thanks.

chrismetcalf added a commit to chrismetcalf/homebrew that referenced this issue Jun 18, 2012

rrdtool: Don't compare Pathname to string
rrdtool was trying to compare Pathname paths to strings, which would never
return true as intended.

Hopefully fixes Homebrew#12090.

Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Sep 12, 2012

rrdtool: Don't compare Pathname to string
rrdtool was trying to compare Pathname paths to strings, which would never
return true as intended.

Hopefully fixes Homebrew#12090.

snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012

rrdtool: Don't compare Pathname to string
rrdtool was trying to compare Pathname paths to strings, which would never
return true as intended.

Hopefully fixes Homebrew#12090.
@leedo

This comment has been minimized.

leedo commented Dec 21, 2012

I've run into a similar issue... I have a perl installed in my home directory, and it is the default perl in my $PATH.

which perl
/Users/leedo/perl5/perlbrew/perls/perl-5.16.2/bin/perl

Yet when I brew install rrdtool it defaults to installing the module to the system perl. I think this could be handled better, or at least print out some instructions for installing the module for other installations.

Some more info:

[leedo@trillian rrdtool-1.4.7]$ brew --config
HOMEBREW_VERSION: 0.9.3
HEAD: 1b5f55486f2835558726169a6315bd7311eb8c4a
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.8.2-x86_64
Xcode: 4.5.2
CLT: 4.5.0.0.1.1249367152
LLVM-GCC: build 2336
Clang: 4.1 build 421
X11: 2.7.2 => /opt/X11
System Ruby: 1.8.7-358
Perl: /Users/leedo/perl5/perlbrew/perls/perl-5.16.2/bin/perl
Python: /usr/bin/python
Ruby: /Users/leedo/.rbenv/shims/ruby
@Sharpie

This comment has been minimized.

Contributor

Sharpie commented Dec 21, 2012

Yet when I brew install rrdtool it defaults to installing the module to the system perl. I think this could be handled better, or at least print out some instructions for installing the module for other installations.

Nowadays, brew explicitly strips the PATH down to a pre-set list during install. This reduces our support burden by removing a big source of broken, outdated and misnamed binaries.

If you want to play with fire, pass the --env=std option when installing to disable this behavior---but be aware that we may decline to provide support for anything that happens when brew is operating in this mode.

@hollie

This comment has been minimized.

Contributor

hollie commented Jul 31, 2013

I experience the same situation as leedo. Some more background information: a tool called 'perlbrew' enables you to install a private perl version in your home folder. This enables you to install a Perl version that is completely separate from the system Perl. This is nice if you require another version of Perl and if you don't want to make changes to the system Perl.

Your 'private' Perl versions are installed in ~/perl5/perlbrew/...

However, I don't succeed in installing RRDtool for this Perl version using this recipe.

I already tried passing the --env=std option to brew when installing but I get:

Error: Unknown command: --env=std

I have two questions:

  • how can I install the RRDs Perl binding in my own Perl (which is available from 'which perl')
  • on a more supportive note: can this be documented a bit better because I imagine quite some people are interested in this (I can add the documentation if I know the answer to my first question)
nessie:xpl-logger lieven$ brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew
HEAD: f08a098f44d456f1dad6b3c04779a5ad1fed7d1a
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.8.4-x86_64
Xcode: 4.6.3
CLT: 4.6.0.0.1.1365549073
LLVM-GCC: build 2336
Clang: 4.2 build 425
X11: 2.7.4 => /opt/X11
System Ruby: 1.8.7-358
Perl: /Users/lieven/perl5/perlbrew/perls/perl-5.16.0/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
@hollie

This comment has been minimized.

Contributor

hollie commented Jul 31, 2013

Update: apparently the command to set the env to std is:

brew install rrdtool --env=std

This time this recipe correctly detects and uses the locally-installed perl. To install it, first remove the installation that used the system Perl:

brew uninstall rrdtool

Then apply the first command in this post to install the recipe for the correct Perl version. Now the module is installed under

/usr/local/lib/perl

After setting the environment variable PERL5LIB like this

setenv PERL5LIB=/usr/local/lib/perl

All is working fine for me.

@samueljohn

This comment has been minimized.

Contributor

samueljohn commented Jul 31, 2013

At some point we should update ruby and perl support to be en par with python, so that using custom perls would work in superenv, too.
Absolutely correct as you describe it @hollie. Brew formulae should install language bindings to $(brew --prefix)/lib/<language><optional_version>/ and you have to set PERL5LIB or PYTHONPATH to use these bindings from an external interpreter.

@hollie

This comment has been minimized.

Contributor

hollie commented Jul 31, 2013

I've sent in a pull request to document this in the warning message that is generated when you brew rrdtool. #21564

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.