Thread: initdb / pg_version

initdb / pg_version

From
"Patrick Welche"
Date:
I just spent some time trying to work out why PG_VERSION contained 6.6 rather
than 7.0 in my freshly initdb'd directory. End result: I don't understand
why after doing a make in src/bin/pg_version, doing a make install recompiles
pg_version even though it was just made. This leads to the problem that I
do the first make as prlw1, then the make install as postgres. As make install
insists on relinking pg_version even though it is up to date, postgres tries
to write pg_version to prlw1's src directory which fails, so it doesn't
install. (I suspect that the general trend is to do everything as user
postgres, but there must be something up with the Makefile..)

Any thoughts to fix the build process?

Cheers,

Patrick


Re: [HACKERS] initdb / pg_version

From
Tom Lane
Date:
"Patrick Welche" <prlw1@newn.cam.ac.uk> writes:
> I just spent some time trying to work out why PG_VERSION contained 6.6
> rather than 7.0 in my freshly initdb'd directory. End result: I don't
> understand why after doing a make in src/bin/pg_version, doing a make
> install recompiles pg_version even though it was just made.

You know, I'd always assumed that it was done that way deliberately
to put an up-to-date build date into pg_version ... but on looking
at the code, pg_version doesn't know anything about its build date.
It just cares about the PG_VERSION string.

> Any thoughts to fix the build process?

The dependency on a phony submake target is the problem;
need to put in real dependencies for version.o instead.
Might be easier if version.c were removed from .../utils
and put in bin/pg_version.
        regards, tom lane


Re: [HACKERS] initdb / pg_version

From
"Patrick Welche"
Date:
Tom Lane wrote:
> 
> The dependency on a phony submake target is the problem;
> need to put in real dependencies for version.o instead.
> Might be easier if version.c were removed from .../utils
> and put in bin/pg_version.

Agreed, though not sure what is best. utils/version.c defines
 ValidatePgVersion SetPgVersion

exported in include/version.h. The only source files which reference them
are:

backend/postmaster/postmaster.c uses ValidatePgVersion
bin/pg_version/pg_version.c     uses SetPgVersion
backend/utils/init/postinit.c   uses ValidatePgVersion

Now, postmaster and postinit don't have the same problem as pg_version
as they both link against SUBSYS.o rather than version.o. I also note that
there are lots of mentions of version.o in backend/Makefile that I don't
follow.

Cheers,

Patrick


Re: [HACKERS] initdb / pg_version

From
Peter Eisentraut
Date:
On Wed, 15 Dec 1999, Patrick Welche wrote:

> Any thoughts to fix the build process?

Oh yeah. It's on my wish/todo list. But I just looked at some of those
things the other day and it looks like for a complete solution, much of
the makefiles will simply need to be scrapped and rewritten. So I don't
expect to bother with that soon.

The latest weirdness I experienced was in fact that the clean target
compiled half the source before deciding to delete it ...

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



Re: [HACKERS] initdb / pg_version

From
Tom Lane
Date:
Peter Eisentraut <e99re41@DoCS.UU.SE> writes:
> Oh yeah. It's on my wish/todo list. But I just looked at some of those
> things the other day and it looks like for a complete solution, much of
> the makefiles will simply need to be scrapped and rewritten.

Perhaps GNU automake would give a good running start on the problem.
        regards, tom lane


Re: [HACKERS] initdb / pg_version

From
Peter Eisentraut
Date:
On 1999-12-16, Tom Lane mentioned:

> Peter Eisentraut <e99re41@DoCS.UU.SE> writes:
> > Oh yeah. It's on my wish/todo list. But I just looked at some of those
> > things the other day and it looks like for a complete solution, much of
> > the makefiles will simply need to be scrapped and rewritten.
> 
> Perhaps GNU automake would give a good running start on the problem.

Aah, I was going to suggest that but feared too many people being
reluctant to adding more GNU stuff and learning another macro set, but now
that you said it it's fair game. :) I agree we should investigate that
sometime.

-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden