Обсуждение: BUG #3614: pg_config returns incorrect information for includedir-server
The following bug has been logged online: Bug reference: 3614 Logged by: Michael Akinde Email address: michael.akinde@met.no PostgreSQL version: 8.2.4 Operating system: linux/Fedora Core 5 Description: pg_config returns incorrect information for includedir-server Details: Postgres server is configured and installed to prefix=~/local/pgsql Running: pg_config --includedir-server Returns: ~/local/pgsql/include/postgresql/server However, the server files are in fact installed to: ~/local/pgsql/include/server This is a problem for the compilation/installation of packages that utilize this option - e.g., postgis. This issue seems to be general to many of the paths returned - pg_config inserts /postgresql/ - while the actual installation directory does not include this path.
"Michael Akinde" <michael.akinde@met.no> writes: > This issue seems to be general to many of the paths returned - pg_config > inserts /postgresql/ - while the actual installation directory does not > include this path. Hmm ... works fine for me in both 8.2.5 and HEAD, which means either we fixed it since 8.2.4 (but I see nothing relevant in the CVS logs), or there's something relevant you didn't mention. One thing to be aware of is that pg_config's path output is not just hardwired strings; the paths are computed relative to the location of the pg_config executable. So if you'd moved the executable from where it was supposed to be installed, possibly that would explain it. If that's not it, could we see the complete output of pg_config, especially the full list of configure options? I'm also wondering if you tried a VPATH build; if so, what were the full paths of the source and build directories? (That one's just grasping at a straw; I don't *think* VPATH should have anything to do with this...) regards, tom lane
Re: BUG #3614: pg_config returns incorrect information for includedir-server
От
Alvaro Herrera
Дата:
Tom Lane wrote: > "Michael Akinde" <michael.akinde@met.no> writes: > > This issue seems to be general to many of the paths returned - pg_config > > inserts /postgresql/ - while the actual installation directory does not > > include this path. > > Hmm ... works fine for me in both 8.2.5 and HEAD, which means either > we fixed it since 8.2.4 (but I see nothing relevant in the CVS logs), > or there's something relevant you didn't mention. > > One thing to be aware of is that pg_config's path output is not just > hardwired strings; the paths are computed relative to the location of > the pg_config executable. So if you'd moved the executable from where > it was supposed to be installed, possibly that would explain it. > > If that's not it, could we see the complete output of pg_config, > especially the full list of configure options? I'm also wondering if > you tried a VPATH build; if so, what were the full paths of the source > and build directories? (That one's just grasping at a straw; I don't > *think* VPATH should have anything to do with this...) There is a trick in the Makefile somewhere for appending a "postgresql" when the path does not contain "postgres" or "pgsql". Maybe pg_config is neglecting to add that? Hmm, now that I think about it, maybe the problem is a mixture of the Makefile doing that and pg_config not doing it (or the other way around), by means of having moved the installation elsewhere (say if it was --prefix=/usr/pgsql and then moved into /usr, or vice versa). -- Alvaro Herrera Valdivia, Chile ICBM: S 39º 49' 18.1", W 73º 13' 56.4" "Changing the world ... one keyboard at a time!" (www.DVzine.org)
Alvaro Herrera <alvherre@commandprompt.com> writes: > Hmm, now that I think about it, maybe the problem is a mixture of the > Makefile doing that and pg_config not doing it (or the other way > around), by means of having moved the installation elsewhere (say if it > was --prefix=/usr/pgsql and then moved into /usr, or vice versa). Could be, but I don't want to speculate in advance of being able to reproduce it ... regards, tom lane
Re: BUG #3614: pg_config returns incorrect information for includedir-server
От
Michael Akinde
Дата:
Tom Lane wrote: > Hmm ... works fine for me in both 8.2.5 and HEAD, which means either > we fixed it since 8.2.4 (but I see nothing relevant in the CVS logs), > or there's something relevant you didn't mention. > > One thing to be aware of is that pg_config's path output is not just > hardwired strings; the paths are computed relative to the location of > the pg_config executable. So if you'd moved the executable from where > it was supposed to be installed, possibly that would explain it. > I didn't move any executables manually, so I don't think that's it. I did take a look through the pg_config source files, so I can see how the path could be mangled if, e.g., I was somehow calling a pg_config in the wrong location. I also checked pg_config_paths.h, which contained the correct paths. Unfortunately, I'm pretty sure that the pg_config being used was the correct one. I was particularly alert to this issue, as my first suspicion was that it could be some other installation of postgres that was "interfering" with my installation. I trawled through the environment variables pretty thoroughly (and changed them about), for this reason, but didn't find anything to lead me to suspect this to be the case - other than the problem persisting. It disappeared, finally, after I uninstalled postgres, removed all files and then rebuilt everything from scratch, and reinstalled. > If that's not it, could we see the complete output of pg_config, > especially the full list of configure options? I'm also wondering if > you tried a VPATH build; if so, what were the full paths of the source > and build directories? (That one's just grasping at a straw; I don't > *think* VPATH should have anything to do with this...) > No VPATH build. Since rebuilding that particular build, (and more recently upgrading 8.2.5 yesterday), I have not been able to reproduce the bug (unfortunately, I didn't think to save any of the old files when rebuilding). So, for the moment, I have nothing to add on this issue. Regards, Michael A.