Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feedgnuplot: change install location inside keg #66367 #66370

Conversation

mitchblank
Copy link
Contributor

Investigating recent bottling failures and found that feedgnuplot was failing due to brew test failing. The issue is that the test assumes that this formula installed its binary as

  .../Cellar/feedgnuplot/1.550/bin/feedgnuplot

but it was actually ending up at:

  .../Cellar/feedgnuplot/1.550/local/bin/feedgnuplot

I'm going to assume that brew test worked at some point and that the former is the correct place to install it. Hopefully I'm right about that; I am no perl expert. It seems that if you specify INSTALLDIRS=vendor when you build it that's what you get. Maybe the default INSTALLDIRS changed at some point and broke this formula?

This exact same problem affected pod2man (#66367) When investigating that failure I thought it was a one-off, but clearly there is some more systemic issue with perl package installation going on. I can't claim to fully understand what is going on so willing to listen to any theories people have.

cc @alyssais @chenrui333

@carlocab
Copy link
Member

carlocab commented Dec 6, 2020

My guess is that configure scripts changed at some point and started treating the default prefix as /usr, and a specified prefix is a sign to install in $prefix/local/bin. Still weird tho.

@Leont
Copy link

Leont commented Dec 7, 2020

My guess is that configure scripts changed at some point and started treating the default prefix as /usr, and a specified prefix is a sign to install in $prefix/local/bin. Still weird tho.

What's the output of perl -V:installsitebin -V:installvendorbin -V:installbin on this perl?

@carlocab
Copy link
Member

carlocab commented Dec 7, 2020

For the built-in macOS perl:

❯ which -a perl
/usr/bin/perl
❯ perl -V:installsitebin -V:installvendorbin -V:installbin
installsitebin='/usr/local/bin';
installvendorbin='/usr/local/bin';
installbin='/usr/bin';

@mitchblank
Copy link
Contributor Author

@Leont -- based on our conversation on some other PR, it is your recommendation that we should be passing INSTALL_BASE into MakeMaker rather than DESTDIR, PREFIX, etc, correct?

I just took a quick look at all of the formulae which use a Makefile.PL of some sort, and the vast majority of them do that. These are the exceptions which do a Makefile.PL followed by a make install but pass something other than INSTALL_BASE:

feedgnuplot.rb:    system "perl", "Makefile.PL", "prefix=#{prefix}"
mysql-sandbox.rb:    system "perl", "Makefile.PL", "PREFIX=#{libexec}"
pgformatter.rb:    system "perl", "Makefile.PL", "DESTDIR=."
st.rb:    system "perl", "Makefile.PL", "PREFIX=#{libexec}"
check_postgres.rb:    system "perl", "Makefile.PL", "PREFIX=#{prefix}"
pod2man.rb:    system "perl", "Makefile.PL", "PREFIX=#{prefix}",
pgbadger.rb:    system "perl", "Makefile.PL", "DESTDIR=#{buildpath}"
git-cal.rb:    system "perl", "Makefile.PL", "PREFIX=#{prefix}"

Additionally these do a Makefile.PL, pass something in but then don't do make install (instead manually copying files around after the build) So the stakes are potentially lower for these, but possible that a confused path still ended up being written into a file I guess:

exiftool.rb:    system "perl", "Makefile.PL"
wakeonlan.rb:    system "perl", "Makefile.PL"
ack.rb:      system "perl", "Makefile.PL", "DESTDIR=#{buildpath}"     (NOTE: only when building `HEAD`)

Is it your opinion that all of these should be using INSTALL_BASE instead?

@Leont
Copy link

Leont commented Dec 8, 2020

it is your recommendation that we should be passing INSTALL_BASE into MakeMaker rather than DESTDIR, PREFIX, etc, correct?

Yes. Actually in your particular case it may be better to set INSTALLSITESCRIPT, INSTALLSITEMAN1DIR, INSTALLSITEMAN3DIR and INSTALLSITELIB explicitly (and not set INSTALLDIRS), if you want precise control over where things get installed. That way, make install will do exactly what you want it to do.

@carlocab
Copy link
Member

carlocab commented Dec 8, 2020

Yes. Actually in your particular case it may be better to set INSTALLSITESCRIPT, INSTALLSITEMAN1DIR, INSTALLSITEMAN3DIR and INSTALLSITELIB explicitly (and not set INSTALLDIRS), if you want precise control over where things get installed.

Is this still needed even if the expected directory structure in the install prefix is fairly standard? That is, executables in $prefix/bin, libraries in $prefix/lib, manpages in prefix/share/man/man{1,2,3...}, etc?

mitchblank added a commit to mitchblank/homebrew-core that referenced this pull request Dec 27, 2020
As discussed with Homebrew#66370 (comment)
Big Sur's system perl changed how "PREFIX=" is treated as an install
destination.  The more explicit way to control MakeMaker is to set
INSTALL_BASE instead, which should result in consistent behavior
between different OS/X versions.
mitchblank added a commit to mitchblank/homebrew-core that referenced this pull request Dec 27, 2020
As discussed with Homebrew#66370 (comment)
Big Sur's system perl changed how "PREFIX=" is treated as an install
destination.  The more explicit way to control MakeMaker is to set
INSTALL_BASE instead, which should result in consistent behavior
between different OS/X versions.
mitchblank added a commit to mitchblank/homebrew-core that referenced this pull request Dec 27, 2020
As discussed with Homebrew#66370 (comment)
Big Sur's system perl changed how "PREFIX=" is treated as an install
destination.  The more explicit way to control MakeMaker is to set
INSTALL_BASE instead, which should result in consistent behavior
between different OS/X versions.
As discussed with Homebrew#66370 (comment)
Big Sur's system perl changed how "PREFIX=" is treated as an install
destination.  The more explicit way to control MakeMaker is to set
INSTALL_BASE instead, which should result in consistent behavior
between different OS/X versions.
@mitchblank mitchblank force-pushed the feedgnuplot-change-install-location branch from 67cf46c to 9bf2c46 Compare December 27, 2020 21:21
mitchblank added a commit to mitchblank/homebrew-core that referenced this pull request Dec 27, 2020
As discussed with Homebrew#66370 (comment)
Big Sur's system perl changed how "PREFIX=" is treated as an install
destination.  The more explicit way to control MakeMaker is to set
INSTALL_BASE instead, which should result in consistent behavior
between different OS/X versions.

Even on 10.X, this formula wasn't installing manpages in the correct
directory; that is now fixed.
BrewTestBot pushed a commit that referenced this pull request Dec 27, 2020
As discussed with #66370 (comment)
Big Sur's system perl changed how "PREFIX=" is treated as an install
destination.  The more explicit way to control MakeMaker is to set
INSTALL_BASE instead, which should result in consistent behavior
between different OS/X versions.

Closes #67819.

Signed-off-by: chenrui <chenrui333@gmail.com>
BrewTestBot pushed a commit that referenced this pull request Dec 27, 2020
As discussed with #66370 (comment)
Big Sur's system perl changed how "PREFIX=" is treated as an install
destination.  The more explicit way to control MakeMaker is to set
INSTALL_BASE instead, which should result in consistent behavior
between different OS/X versions.

Closes #67820.

Signed-off-by: chenrui <chenrui333@gmail.com>
BrewTestBot pushed a commit that referenced this pull request Dec 27, 2020
As discussed with #66370 (comment)
Big Sur's system perl changed how "PREFIX=" is treated as an install
destination.  The more explicit way to control MakeMaker is to set
INSTALL_BASE instead, which should result in consistent behavior
between different OS/X versions.

Closes #67818.

Signed-off-by: chenrui <chenrui333@gmail.com>
BrewTestBot pushed a commit that referenced this pull request Dec 28, 2020
* mysql-sandbox: install correctly on Big Sur
  As discussed with #66370 (comment)
  Big Sur's system perl changed how "PREFIX=" is treated as an install
  destination.  The more explicit way to control MakeMaker is to set
  INSTALL_BASE instead, which should result in consistent behavior
  between different OS/X versions.

  Even on 10.X, this formula wasn't installing manpages in the correct
  directory; that is now fixed.
* specify osx perl dependency
* stable is preferred over head
* fix syntax issue

Closes #67821.

Co-authored-by: chenrui <rui@meetup.com>
Signed-off-by: chenrui <chenrui333@gmail.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
@chenrui333 chenrui333 mentioned this pull request Dec 28, 2020
5 tasks
Formula/feedgnuplot.rb Outdated Show resolved Hide resolved
@chenrui333
Copy link
Member

it is interesting that this PR does not have the mandir audit error. 🤔

Co-authored-by: chenrui <rui@meetup.com>
mitchblank added a commit to mitchblank/homebrew-core that referenced this pull request Dec 28, 2020
As discussed with Homebrew#66370 (comment)
Big Sur's system perl changed how "PREFIX=" is treated as an install
destination.  The more explicit way to control MakeMaker is to set
INSTALL_BASE instead, which should result in consistent behavior
between different OS/X versions.
@mitchblank
Copy link
Contributor Author

Hmm, so on pre-11 the INSTALLSITEMAN1DIR maybe didn't work here?

==> brew audit feedgnuplot --online --git --skip-style
==> FAILED
feedgnuplot:
  * A top-level "man" directory was found
    Homebrew requires that man pages live under share.
    This can often be fixed by passing "--mandir=#{man}" to configure.
Error: 1 problem in 1 formula detected

...fine on 11.0 though :-/

BrewTestBot pushed a commit that referenced this pull request Dec 29, 2020
As discussed with #66370 (comment)
Big Sur's system perl changed how "PREFIX=" is treated as an install
destination.  The more explicit way to control MakeMaker is to set
INSTALL_BASE instead, which should result in consistent behavior
between different OS/X versions.

Closes #66367.

Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
@BrewTestBot
Copy link
Member

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@BrewTestBot BrewTestBot added the stale No recent activity label Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale No recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants