Ecpg dependency

Started by Filip Janusalmost 6 years ago6 messages
#1Filip Janus
fjanus@redhat.com

Hello,
After upgrade from 11.2 to 12.2 I found, that build of ecpg component
depends on pgcommon_shlib and pgport_shlib. But build of ecpg
doesn't include build of pgcommon_shlib and pgport_shlib. That means, if I
want to build ecpg, first I need to build pgcommon_shlib and pgport_shlib
and after that I am able to build ecpg.

I would like to ask if this behavior is expected or not ? Because previous
version doesn't require this separate builds.

Thanks
Filip Januš

#2Bruce Momjian
bruce@momjian.us
In reply to: Filip Janus (#1)
1 attachment(s)
Re: Ecpg dependency

On Tue, Mar 10, 2020 at 01:47:14PM +0100, Filip Janus wrote:

Hello,
After upgrade from 11.2 to 12.2 I found, that build of ecpg component depends
on�pgcommon_shlib and�pgport_shlib.� But build of ecpg doesn't�include build
of�pgcommon_shlib and�pgport_shlib. That means, if I want to build ecpg, first
I need to build��pgcommon_shlib and�pgport_shlib and after that I am able to
build ecpg.

I would like to ask if this behavior is expected or not ? Because previous
version doesn't require this separate builds.

Ah, I see the problem, and this is a new bug in PG 12. The attached
patch fixes PG 12 and master.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +

Attachments:

ecpg.difftext/x-diff; charset=us-asciiDownload
diff --git a/src/interfaces/ecpg/pgtypeslib/Makefile b/src/interfaces/ecpg/pgtypeslib/Makefile
new file mode 100644
index 530b580..6ce129b
*** a/src/interfaces/ecpg/pgtypeslib/Makefile
--- b/src/interfaces/ecpg/pgtypeslib/Makefile
*************** OBJS = \
*** 38,43 ****
--- 38,45 ----
  
  all: all-lib
  
+ all-lib: | submake-libpgport
+ 
  # Shared library stuff
  include $(top_srcdir)/src/Makefile.shlib
  
#3Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#2)
Re: Ecpg dependency

On Sat, Mar 21, 2020 at 02:14:44PM -0400, Bruce Momjian wrote:

On Tue, Mar 10, 2020 at 01:47:14PM +0100, Filip Janus wrote:

Hello,
After upgrade from 11.2 to 12.2 I found, that build of ecpg component depends
on�pgcommon_shlib and�pgport_shlib.� But build of ecpg doesn't�include build
of�pgcommon_shlib and�pgport_shlib. That means, if I want to build ecpg, first
I need to build��pgcommon_shlib and�pgport_shlib and after that I am able to
build ecpg.

I would like to ask if this behavior is expected or not ? Because previous
version doesn't require this separate builds.

Ah, I see the problem, and this is a new bug in PG 12. The attached
patch fixes PG 12 and master.

+ all-lib: | submake-libpgport

Oh, I forgot to mention I got this line from
src/interfaces/libpq/Makefile:

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +
#4Noname
ilmari@ilmari.org
In reply to: Bruce Momjian (#3)
1 attachment(s)
Re: Ecpg dependency

Bruce Momjian <bruce@momjian.us> writes:

On Sat, Mar 21, 2020 at 02:14:44PM -0400, Bruce Momjian wrote:

On Tue, Mar 10, 2020 at 01:47:14PM +0100, Filip Janus wrote:

Hello,
After upgrade from 11.2 to 12.2 I found, that build of ecpg component depends
on pgcommon_shlib and pgport_shlib.  But build of ecpg doesn't include build
of pgcommon_shlib and pgport_shlib. That means, if I want to build ecpg, first
I need to build  pgcommon_shlib and pgport_shlib and after that I am able to
build ecpg.

I would like to ask if this behavior is expected or not ? Because previous
version doesn't require this separate builds.

Ah, I see the problem, and this is a new bug in PG 12. The attached
patch fixes PG 12 and master.

+ all-lib: | submake-libpgport

Oh, I forgot to mention I got this line from
src/interfaces/libpq/Makefile:

And that line is wrong, but my patch to fix it¹ seems to have fallen
between the cracks.

[1]: /messages/by-id/871rsa13ae.fsf@wibble.ilmari.org

Adding the dependency to `all-lib` only fixes it for serial builds. To
fix it properly, so it works with parallel builds (e.g. 'make -j4 -C
src/interfaces/ecpg', the dependency needs to be declared via
SHLIB_PREREQS, as attached

- ilmari
--
- Twitter seems more influential [than blogs] in the 'gets reported in
the mainstream press' sense at least. - Matt McLeod
- That'd be because the content of a tweet is easier to condense down
to a mainstream media article. - Calle Dybedahl

Attachments:

0001-Add-missing-libpgport-prereq-in-ecpg-s-pgtypeslib.patchtext/x-diffDownload
From fb9e077308433970588505604d79ab21e7b1404a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Sat, 21 Mar 2020 19:29:51 +0000
Subject: [PATCH] Add missing libpgport prereq in ecpg's pgtypeslib

---
 src/interfaces/ecpg/pgtypeslib/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/interfaces/ecpg/pgtypeslib/Makefile b/src/interfaces/ecpg/pgtypeslib/Makefile
index 530b580d7c..6094a8d08a 100644
--- a/src/interfaces/ecpg/pgtypeslib/Makefile
+++ b/src/interfaces/ecpg/pgtypeslib/Makefile
@@ -25,6 +25,8 @@ override CFLAGS += $(PTHREAD_CFLAGS)
 SHLIB_LINK_INTERNAL = -lpgcommon_shlib -lpgport_shlib
 SHLIB_LINK += $(filter -lintl -lm, $(LIBS))
 
+SHLIB_PREREQS = submake-libpgport
+
 SHLIB_EXPORTS = exports.txt
 
 OBJS = \
-- 
2.20.1

#5Bruce Momjian
bruce@momjian.us
In reply to: Noname (#4)
1 attachment(s)
Re: Ecpg dependency

On Sat, Mar 21, 2020 at 07:30:48PM +0000, Dagfinn Ilmari Manns�ker wrote:

Bruce Momjian <bruce@momjian.us> writes:

On Sat, Mar 21, 2020 at 02:14:44PM -0400, Bruce Momjian wrote:

On Tue, Mar 10, 2020 at 01:47:14PM +0100, Filip Janus wrote:

Hello,
After upgrade from 11.2 to 12.2 I found, that build of ecpg component depends
on�pgcommon_shlib and�pgport_shlib.� But build of ecpg doesn't�include build
of�pgcommon_shlib and�pgport_shlib. That means, if I want to build ecpg, first
I need to build��pgcommon_shlib and�pgport_shlib and after that I am able to
build ecpg.

I would like to ask if this behavior is expected or not ? Because previous
version doesn't require this separate builds.

Ah, I see the problem, and this is a new bug in PG 12. The attached
patch fixes PG 12 and master.

+ all-lib: | submake-libpgport

Oh, I forgot to mention I got this line from
src/interfaces/libpq/Makefile:

And that line is wrong, but my patch to fix it� seems to have fallen
between the cracks.

[1] /messages/by-id/871rsa13ae.fsf@wibble.ilmari.org

Adding the dependency to `all-lib` only fixes it for serial builds. To
fix it properly, so it works with parallel builds (e.g. 'make -j4 -C
src/interfaces/ecpg', the dependency needs to be declared via
SHLIB_PREREQS, as attached

Oh, good catch. I did not notice that patch before. Adding that change
to src/interfaces/ecpg/pgtypeslib/Makefile fixes the stand-alone
compile.

The attached patch does this, and changes libpq to use it too, so
parallel Make works there too.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +

Attachments:

ecpg.difftext/x-diff; charset=us-asciiDownload
diff --git a/src/interfaces/ecpg/pgtypeslib/Makefile b/src/interfaces/ecpg/pgtypeslib/Makefile
index 530b580d7c..ae79ead7a7 100644
--- a/src/interfaces/ecpg/pgtypeslib/Makefile
+++ b/src/interfaces/ecpg/pgtypeslib/Makefile
@@ -24,6 +24,7 @@ override CFLAGS += $(PTHREAD_CFLAGS)
 
 SHLIB_LINK_INTERNAL = -lpgcommon_shlib -lpgport_shlib
 SHLIB_LINK += $(filter -lintl -lm, $(LIBS))
+SHLIB_PREREQS = submake-libpgport
 
 SHLIB_EXPORTS = exports.txt
 
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index a06882651f..d4919970f8 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -85,13 +85,12 @@ endif
 ifeq ($(PORTNAME), win32)
 SHLIB_LINK += -lshell32 -lws2_32 -lsecur32 $(filter -leay32 -lssleay32 -lcomerr32 -lkrb5_32, $(LIBS))
 endif
+SHLIB_PREREQS = submake-libpgport
 
 SHLIB_EXPORTS = exports.txt
 
 all: all-lib
 
-all-lib: | submake-libpgport
-
 # Shared library stuff
 include $(top_srcdir)/src/Makefile.shlib
 backend_src = $(top_srcdir)/src/backend
#6Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#5)
Re: Ecpg dependency

On Sat, Mar 21, 2020 at 06:13:03PM -0400, Bruce Momjian wrote:

On Sat, Mar 21, 2020 at 07:30:48PM +0000, Dagfinn Ilmari Manns�ker wrote:

Bruce Momjian <bruce@momjian.us> writes:

On Sat, Mar 21, 2020 at 02:14:44PM -0400, Bruce Momjian wrote:
Oh, I forgot to mention I got this line from
src/interfaces/libpq/Makefile:

And that line is wrong, but my patch to fix it� seems to have fallen
between the cracks.

[1] /messages/by-id/871rsa13ae.fsf@wibble.ilmari.org

Adding the dependency to `all-lib` only fixes it for serial builds. To
fix it properly, so it works with parallel builds (e.g. 'make -j4 -C
src/interfaces/ecpg', the dependency needs to be declared via
SHLIB_PREREQS, as attached

Oh, good catch. I did not notice that patch before. Adding that change
to src/interfaces/ecpg/pgtypeslib/Makefile fixes the stand-alone
compile.

Patch applied and backpatched to PG 12. Thanks.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +