GNU bug report logs - #31484
[PATCH] gnu: icu4c: Patch zoneinfo directory.

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Thu, 17 May 2018 12:59:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 31484 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#31484; Package guix-patches. (Thu, 17 May 2018 12:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Baines <mail <at> cbaines.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 17 May 2018 12:59:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: icu4c: Patch zoneinfo directory.
Date: Thu, 17 May 2018 13:58:34 +0100
Replace the hardcoded /usr/share/zoneinfo file with a reference to the tzdata
package.

* gnu/packages/icu4c.scm (icu4c)[inputs]: Add tzdata.
[arguments]: Add a patch-zoneinfo-directory phase.
---
 gnu/packages/icu4c.scm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm
index 57e8fffb3..d34b61745 100644
--- a/gnu/packages/icu4c.scm
+++ b/gnu/packages/icu4c.scm
@@ -22,6 +22,7 @@
 
 (define-module (gnu packages icu4c)
   #:use-module (gnu packages)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages perl)
   #:use-module (guix licenses)
   #:use-module (guix packages)
@@ -45,7 +46,8 @@
              (base32 "065l3n0q9wqaw8dz20x82srshhm6i987fr9ync5xf9mr6n7ylwzh"))))
    (build-system gnu-build-system)
    (inputs
-    `(("perl" ,perl)))
+    `(("perl" ,perl)
+      ("tzdata" ,tzdata)))
    (arguments
     `(#:configure-flags
       '("--enable-rpath"
@@ -58,7 +60,13 @@
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'chdir-to-source
-          (lambda _ (chdir "source") #t)))))
+          (lambda _ (chdir "source") #t))
+        (add-after 'chdir-to-source 'patch-zoneinfo-directory
+          (lambda* (#:key inputs #:allow-other-keys)
+            (substitute* "common/putil.cpp"
+              (("\\/usr\\/share\\/zoneinfo")
+               (string-append (assoc-ref inputs "tzdata")
+                              "/share/zoneinfo"))))))))
    (synopsis "International Components for Unicode")
    (description
     "ICU is a set of C/C++ and Java libraries providing Unicode and
-- 
2.16.3





Information forwarded to guix-patches <at> gnu.org:
bug#31484; Package guix-patches. (Sat, 19 May 2018 20:22:01 GMT) Full text and rfc822 format available.

Message #8 received at 31484 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Christopher Baines <mail <at> cbaines.net>
Cc: Leo Famulari <leo <at> famulari.name>, 31484 <at> debbugs.gnu.org
Subject: Re: [bug#31484] [PATCH] gnu: icu4c: Patch zoneinfo directory.
Date: Sat, 19 May 2018 22:21:42 +0200
Hello,

Christopher Baines <mail <at> cbaines.net> skribis:

> Replace the hardcoded /usr/share/zoneinfo file with a reference to the tzdata
> package.
>
> * gnu/packages/icu4c.scm (icu4c)[inputs]: Add tzdata.
> [arguments]: Add a patch-zoneinfo-directory phase.

Good catch.

I wonder if icu4c should instead depend on ‘tzdata-for-tests’, which is
changed less frequently to avoid full rebuilds?  Maybe Leo can comment.

I hope icu4c also honors the TZDIR environment variable, which would
allow users to have it refer to the latest version.  Do you know if
that’s the case?

Last thing: this would probably be for ‘core-updates-next’.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31484; Package guix-patches. (Mon, 21 May 2018 17:16:02 GMT) Full text and rfc822 format available.

Message #11 received at 31484 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Christopher Baines <mail <at> cbaines.net>, 31484 <at> debbugs.gnu.org
Subject: Re: [bug#31484] [PATCH] gnu: icu4c: Patch zoneinfo directory.
Date: Mon, 21 May 2018 13:15:14 -0400
[Message part 1 (text/plain, inline)]
On Sat, May 19, 2018 at 10:21:42PM +0200, Ludovic Courtès wrote:
> Hello,
> 
> Christopher Baines <mail <at> cbaines.net> skribis:
> 
> > Replace the hardcoded /usr/share/zoneinfo file with a reference to the tzdata
> > package.
> >
> > * gnu/packages/icu4c.scm (icu4c)[inputs]: Add tzdata.
> > [arguments]: Add a patch-zoneinfo-directory phase.

Thanks for noticing this, Chris.

> I wonder if icu4c should instead depend on ‘tzdata-for-tests’, which is
> changed less frequently to avoid full rebuilds?  Maybe Leo can comment.

tzdata-for-tests is meant to be used by packages that don't need current
time zone info. Thus, "for test suites only". We added tzdata-for-tests
to make it cheaper to update tzdata.

If icu4c needs current time zone info, it should not use
tzdata-for-tests. Chris, can you give more context about how icu4c uses
time zone information?

> I hope icu4c also honors the TZDIR environment variable, which would
> allow users to have it refer to the latest version.  Do you know if
> that’s the case?

Yeah, it would be great if icu4c could just use TZDIR, which would allow
us to continue updating the time zones relatively frequently... if icu4c
actually needs the time zone database.

Already, we have problems keeping them up to date because too many
packages depend on them, and that's a problem for Guix users (clocks
will be wrong in some time zones). If we let icu4c depend on tzdata,
then we will only be able to update the time zones during core-updates,
which is not frequent enough. Currently, we can at least update tzdata
on 'staging' braches.

It indicates two general problems, IMO:

1) the lack of build farm capacity
2) it should be possible to update the time zone database without
rebuilding packages (the packages should use TZDIR)

I wonder what is done in Nixpkgs...
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31484; Package guix-patches. (Tue, 22 May 2018 12:08:02 GMT) Full text and rfc822 format available.

Message #14 received at 31484 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Leo Famulari <leo <at> famulari.name>
Cc: Christopher Baines <mail <at> cbaines.net>, 31484 <at> debbugs.gnu.org
Subject: Re: [bug#31484] [PATCH] gnu: icu4c: Patch zoneinfo directory.
Date: Tue, 22 May 2018 14:06:53 +0200
Heya,

Leo Famulari <leo <at> famulari.name> skribis:

> It indicates two general problems, IMO:
>
> 1) the lack of build farm capacity
> 2) it should be possible to update the time zone database without
> rebuilding packages (the packages should use TZDIR)

I think tzdata is an example where dynamic composition (i.e., TZDIR) is
what we should use.  That way we can update tzdata as frequently as we
want.

For the case where TZDIR is unset, programs can still use
tzdata-for-tests, which could be slightly outdated, but I consider it a
“degraded” mode and I think it’s fine.

> I wonder what is done in Nixpkgs...

It may be that the majority of their users don’t live in the regions
affected by recent timezone changes…

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31484; Package guix-patches. (Thu, 24 May 2018 16:32:02 GMT) Full text and rfc822 format available.

Message #17 received at 31484 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Christopher Baines <mail <at> cbaines.net>, 31484 <at> debbugs.gnu.org
Subject: Re: [bug#31484] [PATCH] gnu: icu4c: Patch zoneinfo directory.
Date: Thu, 24 May 2018 12:30:58 -0400
[Message part 1 (text/plain, inline)]
On Tue, May 22, 2018 at 02:06:53PM +0200, Ludovic Courtès wrote:
> For the case where TZDIR is unset, programs can still use
> tzdata-for-tests, which could be slightly outdated, but I consider it a
> “degraded” mode and I think it’s fine.

Okay, I'll rename it tzdata-old in core-updates to better describe the
full range of use cases.

> > I wonder what is done in Nixpkgs...
> 
> It may be that the majority of their users don’t live in the regions
> affected by recent timezone changes…

Yes, and these last minute changes tend not to affect the wealthier
parts of the world, where such problems would have a greater impact.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31484; Package guix-patches. (Mon, 11 Jun 2018 18:19:01 GMT) Full text and rfc822 format available.

Message #20 received at 31484 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Leo Famulari <leo <at> famulari.name>, 31484 <at> debbugs.gnu.org
Subject: Re: [bug#31484] [PATCH] gnu: icu4c: Patch zoneinfo directory.
Date: Mon, 11 Jun 2018 19:18:30 +0100
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Hello,
>
> Christopher Baines <mail <at> cbaines.net> skribis:
>
>> Replace the hardcoded /usr/share/zoneinfo file with a reference to the tzdata
>> package.
>>
>> * gnu/packages/icu4c.scm (icu4c)[inputs]: Add tzdata.
>> [arguments]: Add a patch-zoneinfo-directory phase.
>
> Good catch.
>
> I wonder if icu4c should instead depend on ‘tzdata-for-tests’, which is
> changed less frequently to avoid full rebuilds?  Maybe Leo can comment.
>
> I hope icu4c also honors the TZDIR environment variable, which would
> allow users to have it refer to the latest version.  Do you know if
> that’s the case?

All I remember about this was that I don't think it fixed the problem I
was trying to solve :) I had the patch in a stash for a while before
submitting it.

I don't even know what icu4c actually does, so I'm not very well placed
to look at this further, but I'm glad you and Leo seem to be getting
something from it :)
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 7 years and 2 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.