subversion: fails to build with `--perl` and perlbrew under superenv #15393

Closed
goodell opened this Issue Oct 10, 2012 · 11 comments

Comments

Projects
None yet
7 participants
Contributor

goodell commented Oct 10, 2012

Building with --env=std to disable superenv resolves the issue for now. Related background about perl location detection is available at issue #11619.

Contributor

codedreality commented Oct 10, 2012

Maybe it is the same what happens here #15379?
Due to superenv there are no more userpaths added to the formula. The formula has to explicit add them back with env :userpaths

Contributor

goodell commented Oct 10, 2012

@codedreality: sounds similar enough to me. The cause is almost certainly that PATH/PERLBREW_PATH/PERLBREW_ROOT/etc. are not ending up in the build environment because of superenv.

I don't know if the homebrew maintainers have a preference for how perl modules should be managed right now, or whether they have a preference for if/how perlbrew (or local::lib) should interact with the brave new world of superenv. The current wiki docs on the subject don't offer a solid story w.r.t. superenv.

Contributor

adamv commented Nov 1, 2012

@mxcl @MikeMcQuaid should I add env :std here or ought we fix something in superenv?

This bug stopped me from brewing Subversion for several weeks before I learned about --env=std. I'm sure there was a good reason for making the superenv changes, but it's a shame that so many effected recipes have still not been fixed.

Member

mxcl commented Nov 2, 2012

Can someone explain the problem for me please? Or maybe provide some error outputs.

Member

mxcl commented Nov 2, 2012

Does this effect brew'd perl, system perl, some other perl, all perls?

Contributor

goodell commented Nov 2, 2012

I don't have time right now to gather proper error outputs, but I can briefly describe what's happening. Though IIRC the error will end up looking a lot like the output that I originally posted in this comment on issue #11619

I have an untouched system perl (with modules in /Library/Perl) on a Lion system. In order to install perl modules, I use perlbrew and avoid using the system perl. Installing subversion with --perl with the default superenv prevents homebrew from seeing any of the env related to my perlbrew-installed perl, so it attempts to install the Svn::Client and friends into the system perl directories. This fails because I have (intentionally) not modified the permissions in /Library/Perl. Adding --env=std reinstates the perlbrew environment settings and allows the formula to install successfully.

Presumably similar behavior will occur with users who use local::lib, which is basically just a lighter-weight version of perlbrew. I have not tried a brew'd perl (from homebrew-dupes?), so I don't know if that will work correctly or not.

Is there a more up-to-date way to deal with perl modules with homebrew and superenv? Is brewed perl the answer? Should we be doing something more like what is recommended in this blog post?

Contributor

mistydemeo commented Nov 2, 2012

@mxcl --perl (and --python, --ruby, etc.) options should probably trigger env :userpaths.

Contributor

mbcoguno commented Nov 28, 2012

Interpreter redirector tools, such as perlbrew, rvm, pythonbrew, etc., are add contents to PATH using their own shell scripts from their own folders. Their shell scripts make sure their bin path is on top of the PATH folder (before /usr/bin and /usr/local/bin). Although superenv's env :userpaths add user's PATH, superenv still looking system's perl, python, and ruby first (because /usr/bin always first, brewed python is only one exception), and then installing formula try to use system's interpreter related library, then throw the error.

It's hard to read interpreter redirector tools' shell script to the superenv system, maybe move /usr/bin and /usr/local/bin(in ordered) to PATH latest order in env :userpaths is the better idea.

Contributor

adamv commented Feb 10, 2013

So do we want to trigger user paths, or do we want to only try to link against system Perl?

adamv was assigned Feb 10, 2013

Contributor

adamv commented Feb 10, 2013

We can add an explicit option to the formula to trigger user paths.

adamv closed this in 179516f Apr 19, 2013

@handyman5 handyman5 pushed a commit to handyman5/homebrew that referenced this issue Oct 7, 2013

@adamv adamv subversion: building bindings triggers user paths
Closes #15393.
8902372

xu-cheng 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.