diff mbox

[1/1] postgresql: add host-zic dependency

Message ID 1398181285-4260-1-git-send-email-ps.report@gmx.net
State Accepted
Commit cb4e64e5fb8973489082118cc4f1858e5cedef8c
Headers show

Commit Message

Peter Seiderer April 22, 2014, 3:41 p.m. UTC
Fixes zic related build failure [1], patch suggested by
Yann E. MORIN [2].

[1] http://autobuild.buildroot.net/results/9ec69f92a48c1adc50bdb3096008243d842c27e6/
[2] http://lists.busybox.net/pipermail/buildroot/2014-April/094767.html

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 package/postgresql/postgresql.mk | 3 +++
 1 file changed, 3 insertions(+)

Comments

Thomas Petazzoni April 22, 2014, 3:52 p.m. UTC | #1
Dear Peter Seiderer,

On Tue, 22 Apr 2014 17:41:25 +0200, Peter Seiderer wrote:

> diff --git a/package/postgresql/postgresql.mk b/package/postgresql/postgresql.mk
> index 11b167a..2606e25 100644
> --- a/package/postgresql/postgresql.mk
> +++ b/package/postgresql/postgresql.mk
> @@ -29,6 +29,9 @@ endif
>  ifeq ($(BR2_PACKAGE_TZDATA),y)
>  	POSTGRESQL_DEPENDENCIES += tzdata
>  	POSTGRESQL_CONF_OPT += --with-system-tzdata=/usr/share/zoneinfo
> +else
> +	POSTGRESQL_DEPENDENCIES += host-zic
> +	POSTGRESQL_CONF_ENV += ZIC=$$(ZIC)
>  endif

I'm not entirely sure to understand how this works. If
BR2_PACKAGE_TZDATA is not enabled, where will host-zic find the
time-zone informations?

Thomas
Yann E. MORIN April 22, 2014, 4:41 p.m. UTC | #2
Thomas, All,

On 2014-04-22 17:52 +0200, Thomas Petazzoni spake thusly:
> Dear Peter Seiderer,
> 
> On Tue, 22 Apr 2014 17:41:25 +0200, Peter Seiderer wrote:
> 
> > diff --git a/package/postgresql/postgresql.mk b/package/postgresql/postgresql.mk
> > index 11b167a..2606e25 100644
> > --- a/package/postgresql/postgresql.mk
> > +++ b/package/postgresql/postgresql.mk
> > @@ -29,6 +29,9 @@ endif
> >  ifeq ($(BR2_PACKAGE_TZDATA),y)
> >  	POSTGRESQL_DEPENDENCIES += tzdata
> >  	POSTGRESQL_CONF_OPT += --with-system-tzdata=/usr/share/zoneinfo
> > +else
> > +	POSTGRESQL_DEPENDENCIES += host-zic
> > +	POSTGRESQL_CONF_ENV += ZIC=$$(ZIC)
> >  endif
> 
> I'm not entirely sure to understand how this works. If
> BR2_PACKAGE_TZDATA is not enabled, where will host-zic find the
> time-zone informations?

host-zin only builds the 'zic' program, which pacakge can access using
$(ZIC), so host-zip (our package) does not need the tz-data itslef.

But postgresql needs the time zone info. It can use either the system
ones, or it has a limited set bundled in its source tree, in:
    postgresql-9.3.3/src/timezone/data/

That's what the error message hints at:

    When cross-compiling, either use the option --with-system-tzdata to use
    existing time-zone data, or set the environment variable ZIC to a zic
    program to use during the build.

Regards,
Yann E. MORIN.
Thomas Petazzoni April 22, 2014, 6:21 p.m. UTC | #3
Dear Yann E. MORIN,

On Tue, 22 Apr 2014 18:41:08 +0200, Yann E. MORIN wrote:

> host-zin only builds the 'zic' program, which pacakge can access using
> $(ZIC), so host-zip (our package) does not need the tz-data itslef.

Right.

> 
> But postgresql needs the time zone info. It can use either the system
> ones, or it has a limited set bundled in its source tree, in:
>     postgresql-9.3.3/src/timezone/data/

What I'm worried about here is *precisely* that even though we build
our own host-zic, it might end up time zone infos from the host system.
And nowhere we check that these are available/sane/etc.

So I think we should either (1) ensure that PostgreSQL only uses its
one limited set of time zone data when --with-system-data is *not*
passed, or (2) always build with tzdata.

> That's what the error message hints at:
> 
>     When cross-compiling, either use the option --with-system-tzdata to use
>     existing time-zone data, or set the environment variable ZIC to a zic
>     program to use during the build.

Yes, I've read this error message. But I'm worried that just pointing
ZIC to a zic program is papering over the fact that we in this case
rely on the time zone info from the host system.

Thomas
diff mbox

Patch

diff --git a/package/postgresql/postgresql.mk b/package/postgresql/postgresql.mk
index 11b167a..2606e25 100644
--- a/package/postgresql/postgresql.mk
+++ b/package/postgresql/postgresql.mk
@@ -29,6 +29,9 @@  endif
 ifeq ($(BR2_PACKAGE_TZDATA),y)
 	POSTGRESQL_DEPENDENCIES += tzdata
 	POSTGRESQL_CONF_OPT += --with-system-tzdata=/usr/share/zoneinfo
+else
+	POSTGRESQL_DEPENDENCIES += host-zic
+	POSTGRESQL_CONF_ENV += ZIC=$$(ZIC)
 endif
 
 ifeq ($(BR2_PACKAGE_OPENSSL),y)