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

/bin/gdal-config triggers warnings with Homebrew #352

Open
markcerqueira opened this issue Nov 8, 2016 · 14 comments
Open

/bin/gdal-config triggers warnings with Homebrew #352

markcerqueira opened this issue Nov 8, 2016 · 14 comments

Comments

@markcerqueira
Copy link

With Postgres 9.5.4.2 and Homebrew 1.1.0:

~ brew -v && brew doctor
Homebrew 1.1.0
Homebrew/homebrew-core (git revision 375a8; last commit 2016-11-07)
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Applications/Postgres.app/Contents/Versions/latest/bin/gdal-config
@jakob
Copy link
Member

jakob commented Nov 8, 2016

I don't see what the problem is? Postgres.app includes gdal, and it includes gdal-config so you can link it.

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue.

Is this causing an actual issue or are you just worried about the warning?

@markcerqueira
Copy link
Author

@jakob Just pointing out it throws a warning after updating. Aware that the warnings are just that: warnings. Just thought I'd let you know! :) Feel free to close.

@ionbaratol
Copy link

i am not very sure about this but after downgrading from Postgres 9.6 to 9.5 the left over gdal-config brakes rvm ruby installer

@jakob
Copy link
Member

jakob commented Dec 28, 2016

@ionbaratol Could you explain in more detail what you did? Why do you think gdal-config interferes with rvm?

@CarlosCD
Copy link

I am seeing the same warning.

Could this could be related to adding /Applications/Postgres.app/Contents/Versions/latest/bin to the path? .. to be able to use PostgreSQL's command line tools (psql, pg_dump, ...).

See postgres app's installation instructions (https://postgresapp.com):

...
3. Configure your $PATH to use the included command line tools (optional):
    sudo mkdir -p /etc/paths.d &&
    echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp
...

@romenigld
Copy link

romenigld commented Dec 12, 2017

Hello CarlosCD,
I do this:

sudo mkdir -p /etc/paths.d &&
echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp

Password:
/Applications/Postgres.app/Contents/Versions/latest/bin

So when I run brew doctor I have the same warning:

brew doctor                                                            
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Applications/Postgres.app/Contents/Versions/latest/bin/gdal-config

Warning: Your Xcode (9.1) is outdated.
Please update to Xcode 9.2 (or delete it).
Xcode can be updated from the App Store.

Can you help me with this please?

@danra
Copy link

danra commented Dec 14, 2018

Same brew doctor warning here.

Since you recommend adding /Applications/Postgres.app/Contents/Versions/latest/bin/ to $PATH for acess to the sql command line tools, and brew doesn't like *-config files in $PATH, it would be nice to have the command line tools provided (or linked) in a folder which doesn't contain this config file.

@jakob
Copy link
Member

jakob commented Dec 15, 2018

The warning says:

If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this.

Are you having any problems that you believe may be caused by the config files?

@FrancoTampieri
Copy link

FrancoTampieri commented Jun 24, 2020

I have the same issue here :/
I see a solution for pyenv here but I try and not works too
alias brew='env PATH="${PATH//$(pyenv root)\/shims://Applications\/Postgres.app\/Contents\/Versions\/latest\/bin:/}" brew'

@fhriley
Copy link

fhriley commented Aug 23, 2020

@FrancoTampieri

Change the script to this:

#!/bin/sh
# check if pyenv is available
# edit: fixed redirect issue in earlier version
if which pyenv >/dev/null 2>&1; then
  # assumes default location of brew in `/usr/local/bin/brew`
  TMPPATH="${PATH//$(pyenv root)\/shims:/}"
  TMPPATH="${TMPPATH/\/Applications\/Postgres.app\/Contents\/Versions\/latest\/bin:/}"
  /usr/bin/env PATH="${TMPPATH}" /usr/local/bin/brew "$@"
else
  /usr/local/bin/brew "$@"
fi

@FrancoTampieri
Copy link

@FrancoTampieri

Change the script to this:

#!/bin/sh
# check if pyenv is available
# edit: fixed redirect issue in earlier version
if which pyenv >/dev/null 2>&1; then
  # assumes default location of brew in `/usr/local/bin/brew`
  TMPPATH="${PATH//$(pyenv root)\/shims:/}"
  TMPPATH="${TMPPATH/\/Applications\/Postgres.app\/Contents\/Versions\/latest\/bin:/}"
  /usr/bin/env PATH="${TMPPATH}" /usr/local/bin/brew "$@"
else
  /usr/local/bin/brew "$@"
fi

Neah, sorry I have the same output:

(system)🍀 ~:francotampieri$ >brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Applications/Postgres.app/Contents/Versions/latest/bin/gdal-config
(system)🍀 ~:francotampieri$ >

@fhriley
Copy link

fhriley commented Aug 24, 2020

Either your environment is different than mine or you're doing something wrong. I'm using that exact script, and it works fine. It's just doing a simple search/replace of the offending paths.

What does which brew say?

EDIT: You're probably not using pyenv. Then you should do this:

#!/bin/sh
# assumes default location of brew in `/usr/local/bin/brew`
TMPPATH="${PATH/\/Applications\/Postgres.app\/Contents\/Versions\/latest\/bin:/}"
/usr/bin/env PATH="${TMPPATH}" /usr/local/bin/brew "$@"

@FrancoTampieri
Copy link

mmm no I'm using pyenv, but I have a script that modify the PROMPT and probably other enviroment configuration... I try reduce all to a clean install and I ask u what make the problem.

@jqgsninimo
Copy link

According to the answer, probably for Homebrew is not affected.

The culprit is indeed this line in HomeBrew:

https://github.com/Homebrew/homebrew/blob/master/Library/Homebrew/cmd/doctor.rb#L611

It's looking for a file that follows the convention *-config, which in this case, yours does. As already stated, it is not an error, just a warning. In order to solve the problem they would have to have a whitelist of all possibles which would not scale, so they are doing a best guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants