From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 26 16:24:00 2020 Received: (at submit) by debbugs.gnu.org; 26 Apr 2020 20:24:00 +0000 Received: from localhost ([127.0.0.1]:35041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSnom-0005P3-5j for submit@debbugs.gnu.org; Sun, 26 Apr 2020 16:24:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:58419) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSnok-0005Ou-Jo for submit@debbugs.gnu.org; Sun, 26 Apr 2020 16:23:59 -0400 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 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 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 compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id DF5921C7; Sun, 26 Apr 2020 16:23:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 26 Apr 2020 16:23:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name; h=date:from:to:subject:message-id:mime-version:content-type; s= mesmtp; bh=sL3aj+lOp8Kgx751HyWQDJZpGI5PjrXSieEqlPgdycA=; b=0hGoI rwQcDXxrKCxD39dQ2u9IPPNSuzfuKj+XwnJppiU3vKfbG2rLddL9ZY0qOXoZJLjt xX+8u3nBpuMv4A0lTVwzE7NF7K6StONMnqCdaUkqURnARx1FqrhNagB4AiD6iFbt 5x+cGztxTp4Tos8YLQLpx5/x+SV2hFjGMOBTvU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=sL3aj+lOp8Kgx751HyWQDJZpGI5Pj rXSieEqlPgdycA=; b=oWzNj51kFyoXzQ3+p46nUEafxJZHKdPYvSiVR/NzAmNqD FQwMRZuDqWUjZvCNLby+pkU91roWaQ7/QhlK2r8znzwIjhHopn5pGztWw8qGSLas 1Isda7eLvYUHwbdzgkljW+BAf+pGRP1msYFBqfOfn/2ZUsD8bjqlRrXUd8coFkFN ZKu+Uaq0ztWo4cSRnux9YEmVi0GMObXKEtLLe+Q5K6/qX1WaqwPavbeRwm5Er15D a8eycdmHR95FxxymIcV21hVgCU6ORVTZUAwSQ0v/SMRX260ooSCK89IrqbvrxzGR BTBIYwfADjsKC2E8HYupVHHkG9P+H50CbO5RmsNpQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrheejgddugeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkgggtugesmhdtreertd dtvdenucfhrhhomhepnfgvohcuhfgrmhhulhgrrhhiuceolhgvohesfhgrmhhulhgrrhhi rdhnrghmvgeqnecuffhomhgrihhnpehgnhhurdhorhhgnecukfhppeejiedruddvgedrud efkedrieefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mheplhgvohesfhgrmhhulhgrrhhirdhnrghmvg X-ME-Proxy: 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) Date: Sun, 26 Apr 2020 16:23:48 -0400 From: Leo Famulari To: bug-guix@gnu.org Subject: References to time zones should not be kept Message-ID: <20200426202348.GA1187@jasmine.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline Received-SPF: pass client-ip=64.147.123.24; envelope-from=leo@famulari.name; helo=wout1-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/26 15:49:44 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.123.24 X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --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--