From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: bug#40881: References to time zones should not be kept Date: Sun, 26 Apr 2020 16:23:48 -0400 Message-ID: <20200426202348.GA1187@jasmine.lan> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="lrZ03NoBR/3+SXJZ" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:55056) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSnop-0006UR-DM for bug-guix@gnu.org; Sun, 26 Apr 2020 16:24:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSnoo-00071j-P7 for bug-guix@gnu.org; Sun, 26 Apr 2020 16:24:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51728) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jSnoo-00071d-Cj for bug-guix@gnu.org; Sun, 26 Apr 2020 16:24:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jSnoo-0005PL-8O for bug-guix@gnu.org; Sun, 26 Apr 2020 16:24:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:55048) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSnoj-0006TA-RH for bug-guix@gnu.org; Sun, 26 Apr 2020 16:23:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSnog-0006yh-8e for bug-guix@gnu.org; Sun, 26 Apr 2020 16:23:57 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:34735) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSnof-0006rb-Jg for bug-guix@gnu.org; Sun, 26 Apr 2020 16:23:53 -0400 Received: from localhost (c-76-124-138-63.hsd1.pa.comcast.net [76.124.138.63]) by mail.messagingengine.com (Postfix) with ESMTPA id 4318D3280059 for ; Sun, 26 Apr 2020 16:23:50 -0400 (EDT) Content-Disposition: inline List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane-mx.org@gnu.org Sender: "bug-Guix" To: 40881@debbugs.gnu.org --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Time zones of Earth are changed several times per year, both for future and past dates. In order to ensure that our clocks display the correct time, Guix needs to keep our time zone package (tzdata) up to date. However, the current situation makes this impractical, because changing tzdata causes ~1400 package rebuilds per-architecture (`guix refresh -l tzdata`). We should make sure that packages which use time zones look up the time zones dynamically, at run-time, rather than recording a store reference to the tzdata package, which will be obsolete in months, at the latest. I used `guix graph --type=reverse-package tzdata` to start, and found that the main culprit here is bluez, which depends on tzdata via libical. Using the attached patch, we can make libical look up time zones at runtime with the $TZDIR environment variable. Bluez still builds with this; I'm not sure what it does with libical and if it still works correctly. However, this makes evolution-data-server test suite fail. I'm not sure how to fix evolution-data-server correctly. The fine points of looking up time zones in evolution-data-server were already discussed: --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-gnu-libical-Dynamically-bind-the-time-zones-with-TZD.patch" >From 29bd8e4b8fcd332f110dc6d7bb99755300b76299 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Thu, 16 Apr 2020 15:50:40 -0400 Subject: [PATCH] gnu: libical: Dynamically bind the time zones with TZDIR. * gnu/packages/patches/libical-honor-TZDIR.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/calendar.scm (libical)[source]: Use it. [arguments]: Remove the 'patch-paths' phase. [inputs]: Remove tzdata. --- gnu/local.mk | 1 + gnu/packages/calendar.scm | 24 +++---------- .../patches/libical-honor-TZDIR.patch | 36 +++++++++++++++++++ 3 files changed, 42 insertions(+), 19 deletions(-) create mode 100644 gnu/packages/patches/libical-honor-TZDIR.patch diff --git a/gnu/local.mk b/gnu/local.mk index 9f212434a9..0b7569b245 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1075,6 +1075,7 @@ dist_patch_DATA = \ %D%/packages/patches/jsoncpp-fix-inverted-case.patch \ %D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \ %D%/packages/patches/kdbusaddons-kinit-file-name.patch \ + %D%/packages/patches/libical-honor-TZDIR.patch \ %D%/packages/patches/libnftnl-dont-check-NFTNL_FLOWTABLE_SIZE.patch \ %D%/packages/patches/libvirt-create-machine-cgroup.patch \ %D%/packages/patches/libziparchive-add-includes.patch \ diff --git a/gnu/packages/calendar.scm b/gnu/packages/calendar.scm index 81b2b436c1..701cd7d6aa 100644 --- a/gnu/packages/calendar.scm +++ b/gnu/packages/calendar.scm @@ -119,6 +119,8 @@ the library for handling time zones and leap seconds.") (base32 "1z33wzaazbd7drl6qbh1750whd78xl2cg0gjnxyya9m83vgndgha")) (patches + (append + (search-patches "libical-honor-TZDIR.patch") ;; Add a patch slated for 3.0.8 which preserves backwards- ;; compatibility in the icalattach_new_from_data() function, ;; which accidentally changed in 3.0.7 and could break some uses. @@ -132,34 +134,18 @@ the library for handling time zones and leap seconds.") (file-name "libical-3.0.7-preserve-icalattach-api.patch") (sha256 (base32 - "0v8qcxn8a6sh78grzxd61j9478928dx38l5mf8mkdrbxv47vmvvp"))))))) + "0v8qcxn8a6sh78grzxd61j9478928dx38l5mf8mkdrbxv47vmvvp")))))))) (build-system cmake-build-system) (arguments '(#:tests? #f ; test suite appears broken - #:configure-flags '("-DSHARED_ONLY=true") - #:phases - (modify-phases %standard-phases - (add-before 'configure 'patch-paths - (lambda* (#:key inputs #:allow-other-keys) - ;; TODO: libical 3.1.0 supports using TZDIR instead of a hard-coded - ;; zoneinfo database. When that is released we can drop - ;; the tzdata dependency. - (let ((tzdata (assoc-ref inputs "tzdata"))) - (substitute* "src/libical/icaltz-util.c" - (("\\\"/usr/share/zoneinfo\\\",") - (string-append "\"" tzdata "/share/zoneinfo\"")) - (("\\\"/usr/lib/zoneinfo\\\",") "") - (("\\\"/etc/zoneinfo\\\",") "") - (("\\\"/usr/share/lib/zoneinfo\\\"") ""))) - #t))))) + #:configure-flags '("-DSHARED_ONLY=true"))) (native-inputs `(("gtk-doc" ,gtk-doc) ("perl" ,perl) ("pkg-config" ,pkg-config))) (inputs `(("glib" ,glib) - ("libxml2" ,libxml2) - ("tzdata" ,tzdata))) + ("libxml2" ,libxml2))) (propagated-inputs ;; In Requires.private of libical.pc. `(("icu4c" ,icu4c))) diff --git a/gnu/packages/patches/libical-honor-TZDIR.patch b/gnu/packages/patches/libical-honor-TZDIR.patch new file mode 100644 index 0000000000..c8c6edcd83 --- /dev/null +++ b/gnu/packages/patches/libical-honor-TZDIR.patch @@ -0,0 +1,36 @@ +Make libical look for the time zone database in the directory pointed to +by TZDIR. + +Patch copied from nixpkgs: + +https://github.com/NixOS/nixpkgs/blob/19.09/pkgs/development/libraries/libical/respect-env-tzdir.patch + +--- a/src/libical/icaltz-util.c ++++ b/src/libical/icaltz-util.c +@@ -94,9 +94,9 @@ + static const char *zdir = NULL; + + static const char *search_paths[] = { ++ "/etc/zoneinfo", + "/usr/share/zoneinfo", + "/usr/lib/zoneinfo", +- "/etc/zoneinfo", + "/usr/share/lib/zoneinfo" + }; + +@@ -178,6 +178,15 @@ + const char *fname = ZONES_TAB_SYSTEM_FILENAME; + size_t i, num_search_paths; + ++ const char *env_tzdir = getenv ("TZDIR"); ++ if (env_tzdir) { ++ sprintf (file_path, "%s/%s", env_tzdir, fname); ++ if (!access (file_path, F_OK|R_OK)) { ++ zdir = env_tzdir; ++ return; ++ } ++ } ++ + num_search_paths = sizeof(search_paths) / sizeof(search_paths[0]); + for (i = 0; i < num_search_paths; i++) { + snprintf(file_path, MAXPATHLEN, "%s/%s", search_paths[i], fname); -- 2.26.2 --lrZ03NoBR/3+SXJZ--