Thread: building pgsql-interfaces...

building pgsql-interfaces...

From
Mark Dzmura
Date:
Hi:

I have for some months been regularly building a local copy of pgsql-interfaces by updating our
local tree from the Postgresql anonymous CVS server...

Recently, someone modified the JDBC builds so that they refer to a file,

    "../../../src/Makefile.global"

(and possibly some others as well...)

We check out ONLY the pgsql-interfaces module from CVS (because it's all
we have disk space for right now), the result being that we have files only
below

    pgsql/src/interfaces

in our local tree...

I modified our directory structure to mirror the "official" one, then tried
to check out "pgsql/src/Makefile.global" from the CVS server, and it
doesn't seem to exist.   Perhaps it is built at compile time??

How can we get our builds to work again without getting the ENTIRE
postgresql source tree ??

(( I offer as a suggestion that Peter/et al move to using the Java Apache project's
"Ant" package for doing Java-only builds... It is so much faster and cleaner
to build under Ant (everything is compiled under a single JVM) and maintanence
of the build.xml file is so much cleaner than hopeless makefiles...

If there is interest, I will take a stab at creating a build.xml for the JDBC driver...))

Thanks,
Mark Dzmura

p.s. I recently upgraded to JBuilder 4 from JBuilder 3/3.5, and am running
it on a Red Hat Linux 6.2 system using the Sun/Blackdown 1.3 Final JVM.
I noticed that whatever issues prevented the old Borland JDBC Explorer from
working are still extant - I can see multiple copies of SYSTEM tables, but
tables created by a user do not show up...   Any ideas on this????



Attachment

RE: building pgsql-interfaces...

From
Peter Mount
Date:
Yes I did. It's because we need the version number, and as advised by
others, getting it from Makefile.global is the best way as it means that
there is only one place to change it, rather than 

Makefile.global is created by configure.

I'll look into Ant, but I can see some possible problems, especially as we
have 3 versions of driver now (JDBC1.1, JDBC2 and JDBC2enterprise), and I'm
checking the JDBC2.1 specification at the moment.

Peter

-- 
Peter Mount
Enterprise Support Officer, Maidstone Borough Council
Email: petermount@maidstone.gov.uk
WWW: http://www.maidstone.gov.uk
All views expressed within this email are not the views of Maidstone Borough
Council


-----Original Message-----
From: Mark Dzmura [mailto:mdz@digital-mission.com]
Sent: Tuesday, October 17, 2000 7:14 AM
To: pgsql-interfaces@postgreSQL.org
Subject: [INTERFACES] building pgsql-interfaces...


Hi:

I have for some months been regularly building a local copy of
pgsql-interfaces by updating our
local tree from the Postgresql anonymous CVS server...

Recently, someone modified the JDBC builds so that they refer to a file,
   "../../../src/Makefile.global"

(and possibly some others as well...)

We check out ONLY the pgsql-interfaces module from CVS (because it's all
we have disk space for right now), the result being that we have files only
below
   pgsql/src/interfaces

in our local tree...

I modified our directory structure to mirror the "official" one, then tried
to check out "pgsql/src/Makefile.global" from the CVS server, and it
doesn't seem to exist.   Perhaps it is built at compile time??

How can we get our builds to work again without getting the ENTIRE
postgresql source tree ??

(( I offer as a suggestion that Peter/et al move to using the Java Apache
project's
"Ant" package for doing Java-only builds... It is so much faster and cleaner
to build under Ant (everything is compiled under a single JVM) and
maintanence
of the build.xml file is so much cleaner than hopeless makefiles...

If there is interest, I will take a stab at creating a build.xml for the
JDBC driver...))

Thanks,
Mark Dzmura

p.s. I recently upgraded to JBuilder 4 from JBuilder 3/3.5, and am running
it on a Red Hat Linux 6.2 system using the Sun/Blackdown 1.3 Final JVM.
I noticed that whatever issues prevented the old Borland JDBC Explorer from
working are still extant - I can see multiple copies of SYSTEM tables, but
tables created by a user do not show up...   Any ideas on this????




Ant Packaging - Was: building pgsql-interfaces...

From
Christopher Cain
Date:
For what it's worth, I am very much in favor of migrating to Ant. Having worked
with it in other packages, I have found it to be an order of magnitude better
than Make for Java software. As mentioned, it is cleaner and much easier to
work with than makefiles. Of course, I can say all of this because unlike like
Peter, I have no idea what any of the complications are :-)

I would like to get some feedback on the idea, however, as I really do think
that Ant is a superior solution for Java projects. If there is any interest, I
would certainly be willing to help Mark out in getting an Ant distro of the
drivers up and running.

Peter Mount wrote:

> I'll look into Ant, but I can see some possible problems, especially as we
> have 3 versions of driver now (JDBC1.1, JDBC2 and JDBC2enterprise), and I'm
> checking the JDBC2.1 specification at the moment.

Mark Dzmura wrote:

> (( I offer as a suggestion that Peter/et al move to using the Java Apache
> project's
> "Ant" package for doing Java-only builds... It is so much faster and cleaner
> to build under Ant (everything is compiled under a single JVM) and
> maintanence
> of the build.xml file is so much cleaner than hopeless makefiles...
>
> If there is interest, I will take a stab at creating a build.xml for the
> JDBC driver...))



Re: Ant Packaging - Was: building pgsql-interfaces...

From
Peter Mount
Date:
On Tue, 17 Oct 2000, Christopher Cain wrote:

> For what it's worth, I am very much in favor of migrating to Ant. Having worked
> with it in other packages, I have found it to be an order of magnitude better
> than Make for Java software. As mentioned, it is cleaner and much easier to
> work with than makefiles. Of course, I can say all of this because unlike like
> Peter, I have no idea what any of the complications are :-)

There's three complications really.

1: We need to get the current version number out of the source. This is
used by DatabaseMetaData for some methods, and the current official way is
to get it out of Makefile.global. However, this is only in existence after
configure is run on the main source tree.

Prior to 7.1, this was done manually, and as there was several places to
do it, it was easily, and regularly missed.

2: The org.postgresql.Driver class is created dynamically. Partly to
include the version data, but also to include which implementation of
java.sql.Connection is needed for that particular version of the
driver. Ie, which one of the _three_ versions of the driver now in the
source - JDBC1.1, JDBC2 and JDBC2-Enterprise which match to either
JDK1.1.x, Java2SE and Java2EE respectively.

3: Currently make utilises a test class, utils.CheckVersion which is
compiliable on all JDK1.1 or later VM's and checks for the existence of
certain classes and parameters to check what true version of the JDK is in
existence. Make then uses this to build the correct version of
org.postgresql.Driver and the rest of the driver.

Now, some classes are only built for certain drivers. ie:

For the enterprise edition there are:
org.postgresql.PostgresqlDataSource
org.postgresql.xa.*

Unique to JDBC1 is org.postgresql.jdbc1.*

Unique to JDBC2 is org.postgresql.jdbc2.*
org.postgresql.largeobject.PGBlob
and some array implementation stuff I'm having trouble including from the
supplied patches (working on that one).

> I would like to get some feedback on the idea, however, as I really do think
> that Ant is a superior solution for Java projects. If there is any interest, I
> would certainly be willing to help Mark out in getting an Ant distro of the
> drivers up and running.

Make is dire for building Java projects, which is why I'd favour ANT if it
can deal with the three problems above. The last thing I want to see is
having to have three (possibly more) sets of source code where there are
lots of duplication, and we would loose the integrity of the driver pretty
fast (most of the driver is common to all versions).

Also, how platform independent is ANT? I currently test the builds under
Linux, and the various Windows entities (if you can call them an OS).

Peter

> Peter Mount wrote:
> 
> > I'll look into Ant, but I can see some possible problems, especially as we
> > have 3 versions of driver now (JDBC1.1, JDBC2 and JDBC2enterprise), and I'm
> > checking the JDBC2.1 specification at the moment.
> 
> Mark Dzmura wrote:
> 
> > (( I offer as a suggestion that Peter/et al move to using the Java Apache
> > project's
> > "Ant" package for doing Java-only builds... It is so much faster and cleaner
> > to build under Ant (everything is compiled under a single JVM) and
> > maintanence
> > of the build.xml file is so much cleaner than hopeless makefiles...
> >
> > If there is interest, I will take a stab at creating a build.xml for the
> > JDBC driver...))
> 

-- 
Peter T Mount peter@retep.org.uk http://www.retep.org.uk
PostgreSQL JDBC Driver http://www.retep.org.uk/postgres/
Java PDF Generator http://www.retep.org.uk/pdf/




Re: Ant Packaging - Was: building pgsql-interfaces...

From
Mark Dzmura
Date:
Peter Mount wrote:

> On Tue, 17 Oct 2000, Christopher Cain wrote:
>
> > For what it's worth, I am very much in favor of migrating to Ant. Having worked
> > with it in other packages, I have found it to be an order of magnitude better
> > than Make for Java software. As mentioned, it is cleaner and much easier to
> > work with than makefiles. Of course, I can say all of this because unlike like
> > Peter, I have no idea what any of the complications are :-)
>
> There's three complications really.
>
> 1: We need to get the current version number out of the source. This is
> used by DatabaseMetaData for some methods, and the current official way is
> to get it out of Makefile.global. However, this is only in existence after
> configure is run on the main source tree.
>
> Prior to 7.1, this was done manually, and as there was several places to
> do it, it was easily, and regularly missed.

Ant is typically invoked by a "build.sh" bash script (under Unix/Linux platforms - I
know there is an equivalent .bat file for windoze systems, but I don't build
in that environment.)

It is a piece of cake to invoke build.sh, passing down one or more
parameters, either on the make command line or as environment variables,
and from inside the script to pass the parameters to Ant with "-Dproperty=value"
phrases on the line which starts the Ant JVM.  These variables are accesible

So it's easy to get things like version numbers from the "make" world into Ant.

> 2: The org.postgresql.Driver class is created dynamically. Partly to
> include the version data, but also to include which implementation of
> java.sql.Connection is needed for that particular version of the
> driver. Ie, which one of the _three_ versions of the driver now in the
> source - JDBC1.1, JDBC2 and JDBC2-Enterprise which match to either
> JDK1.1.x, Java2SE and Java2EE respectively.
>

>
> 3: Currently make utilises a test class, utils.CheckVersion which is
> compiliable on all JDK1.1 or later VM's and checks for the existence of
> certain classes and parameters to check what true version of the JDK is in
> existence. Make then uses this to build the correct version of
> org.postgresql.Driver and the rest of the driver.
>

Ant has decent conditionals which should be sufficient

As a speed benchmark, Cocoon 1.8, with well over 100 Java source files,
builds in under 30 seconds on my PII/400 notebook w/ 128MB RAM
(and running lots of other stuff..)


>
> Now, some classes are only built for certain drivers. ie:
>
> For the enterprise edition there are:
> org.postgresql.PostgresqlDataSource
> org.postgresql.xa.*
>
> Unique to JDBC1 is org.postgresql.jdbc1.*
>
> Unique to JDBC2 is org.postgresql.jdbc2.*
> org.postgresql.largeobject.PGBlob
> and some array implementation stuff I'm having trouble including from the
> supplied patches (working on that one).
>
> > I would like to get some feedback on the idea, however, as I really do think
> > that Ant is a superior solution for Java projects. If there is any interest, I
> > would certainly be willing to help Mark out in getting an Ant distro of the
> > drivers up and running.
>
> Make is dire for building Java projects, which is why I'd favour ANT if it
> can deal with the three problems above. The last thing I want to see is
> having to have three (possibly more) sets of source code where there are
> lots of duplication, and we would loose the integrity of the driver pretty
> fast (most of the driver is common to all versions).
>

>
> Also, how platform independent is ANT? I currently test the builds under
> Linux, and the various Windows entities (if you can call them an OS).
>

Ant was built under Solaris.  Runs great on Linux (We use it exclusively for
Java - ditched make entirely for Java about 6 months ago).  As for Windows,
I can only say that the documentation talks as much about Windows as it does
about *nix platforms, and many developers using it seem to be using Windows...
No personal experience, though...  (windows being one of the impediments to
my complete happiness...)

regards,
mdz

> > Peter Mount wrote:
> >
> > > I'll look into Ant, but I can see some possible problems, especially as we
> > > have 3 versions of driver now (JDBC1.1, JDBC2 and JDBC2enterprise), and I'm
> > > checking the JDBC2.1 specification at the moment.
> >
> > Mark Dzmura wrote:
> >
> > > (( I offer as a suggestion that Peter/et al move to using the Java Apache
> > > project's
> > > "Ant" package for doing Java-only builds... It is so much faster and cleaner
> > > to build under Ant (everything is compiled under a single JVM) and
> > > maintanence
> > > of the build.xml file is so much cleaner than hopeless makefiles...
> > >
> > > If there is interest, I will take a stab at creating a build.xml for the
> > > JDBC driver...))
> >
>
> --
> Peter T Mount peter@retep.org.uk http://www.retep.org.uk
> PostgreSQL JDBC Driver http://www.retep.org.uk/postgres/
> Java PDF Generator http://www.retep.org.uk/pdf/

Attachment

Re: Ant Packaging - Was: building pgsql-interfaces...

From
Christopher Cain
Date:
Mark's assessment is pretty much mirrors my thinking. On several of the
projects I've installed, you simply pass the build parameters directly
to the shell file (i.e. "./build.sh jar" or "./build.sh docs"). In this
case, it would probably be something like "./build.sh jdbc2".

I, too, have only used Ant under Linux, but I was going to try a Tomcat
install (which usese Ant) on an NT machine soon anyway (just to test
compatibility, mind you ;-). I'll go ahead and do that today or tomorrow
and see if I run across any issues. I haven't seen any issues on any of
the Jakarta lists, however, so it should be fine.

At this point it sounds like there are no objections to at least
offering an Ant distro in addition to the make version (assuming
success, of course). N'est pas?

Mark Dzmura wrote:
> 
> Peter Mount wrote:
> 
> > On Tue, 17 Oct 2000, Christopher Cain wrote:
> >
> > > For what it's worth, I am very much in favor of migrating to Ant. Having worked
> > > with it in other packages, I have found it to be an order of magnitude better
> > > than Make for Java software. As mentioned, it is cleaner and much easier to
> > > work with than makefiles. Of course, I can say all of this because unlike like
> > > Peter, I have no idea what any of the complications are :-)
> >
> > There's three complications really.
> >
> > 1: We need to get the current version number out of the source. This is
> > used by DatabaseMetaData for some methods, and the current official way is
> > to get it out of Makefile.global. However, this is only in existence after
> > configure is run on the main source tree.
> >
> > Prior to 7.1, this was done manually, and as there was several places to
> > do it, it was easily, and regularly missed.
> 
> Ant is typically invoked by a "build.sh" bash script (under Unix/Linux platforms - I
> know there is an equivalent .bat file for windoze systems, but I don't build
> in that environment.)
> 
> It is a piece of cake to invoke build.sh, passing down one or more
> parameters, either on the make command line or as environment variables,
> and from inside the script to pass the parameters to Ant with "-Dproperty=value"
> phrases on the line which starts the Ant JVM.  These variables are accesible
> 
> So it's easy to get things like version numbers from the "make" world into Ant.
> 
> > 2: The org.postgresql.Driver class is created dynamically. Partly to
> > include the version data, but also to include which implementation of
> > java.sql.Connection is needed for that particular version of the
> > driver. Ie, which one of the _three_ versions of the driver now in the
> > source - JDBC1.1, JDBC2 and JDBC2-Enterprise which match to either
> > JDK1.1.x, Java2SE and Java2EE respectively.
> >
> 
> >
> > 3: Currently make utilises a test class, utils.CheckVersion which is
> > compiliable on all JDK1.1 or later VM's and checks for the existence of
> > certain classes and parameters to check what true version of the JDK is in
> > existence. Make then uses this to build the correct version of
> > org.postgresql.Driver and the rest of the driver.
> >
> 
> Ant has decent conditionals which should be sufficient
> 
> As a speed benchmark, Cocoon 1.8, with well over 100 Java source files,
> builds in under 30 seconds on my PII/400 notebook w/ 128MB RAM
> (and running lots of other stuff..)
> 
> >
> > Now, some classes are only built for certain drivers. ie:
> >
> > For the enterprise edition there are:
> > org.postgresql.PostgresqlDataSource
> > org.postgresql.xa.*
> >
> > Unique to JDBC1 is org.postgresql.jdbc1.*
> >
> > Unique to JDBC2 is org.postgresql.jdbc2.*
> > org.postgresql.largeobject.PGBlob
> > and some array implementation stuff I'm having trouble including from the
> > supplied patches (working on that one).
> >
> > > I would like to get some feedback on the idea, however, as I really do think
> > > that Ant is a superior solution for Java projects. If there is any interest, I
> > > would certainly be willing to help Mark out in getting an Ant distro of the
> > > drivers up and running.
> >
> > Make is dire for building Java projects, which is why I'd favour ANT if it
> > can deal with the three problems above. The last thing I want to see is
> > having to have three (possibly more) sets of source code where there are
> > lots of duplication, and we would loose the integrity of the driver pretty
> > fast (most of the driver is common to all versions).
> >
> 
> >
> > Also, how platform independent is ANT? I currently test the builds under
> > Linux, and the various Windows entities (if you can call them an OS).
> >
> 
> Ant was built under Solaris.  Runs great on Linux (We use it exclusively for
> Java - ditched make entirely for Java about 6 months ago).  As for Windows,
> I can only say that the documentation talks as much about Windows as it does
> about *nix platforms, and many developers using it seem to be using Windows...
> No personal experience, though...  (windows being one of the impediments to
> my complete happiness...)
> 
> regards,
> mdz
> 
> > > Peter Mount wrote:
> > >
> > > > I'll look into Ant, but I can see some possible problems, especially as we
> > > > have 3 versions of driver now (JDBC1.1, JDBC2 and JDBC2enterprise), and I'm
> > > > checking the JDBC2.1 specification at the moment.
> > >
> > > Mark Dzmura wrote:
> > >
> > > > (( I offer as a suggestion that Peter/et al move to using the Java Apache
> > > > project's
> > > > "Ant" package for doing Java-only builds... It is so much faster and cleaner
> > > > to build under Ant (everything is compiled under a single JVM) and
> > > > maintanence
> > > > of the build.xml file is so much cleaner than hopeless makefiles...
> > > >
> > > > If there is interest, I will take a stab at creating a build.xml for the
> > > > JDBC driver...))
> > >
> >
> > --
> > Peter T Mount peter@retep.org.uk http://www.retep.org.uk
> > PostgreSQL JDBC Driver http://www.retep.org.uk/postgres/
> > Java PDF Generator http://www.retep.org.uk/pdf/