From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bengt Richter Subject: bug#36870: date bug Date: Wed, 31 Jul 2019 06:20:47 +0000 Message-ID: <20190731062047.GA831@PhantoNv4ArchGx.localdomain> Reply-To: Bengt Richter Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:60566) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsjZg-0002LR-JW for bug-guix@gnu.org; Wed, 31 Jul 2019 04:03:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsjZf-0003tJ-4g for bug-guix@gnu.org; Wed, 31 Jul 2019 04:03:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42697) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsjZf-0003t8-0u for bug-guix@gnu.org; Wed, 31 Jul 2019 04:03:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hsjZd-0001pe-Uf for bug-guix@gnu.org; Wed, 31 Jul 2019 04:03:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:55351) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hshzE-0002LP-Qb for bug-guix@gnu.org; Wed, 31 Jul 2019 02:21:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hshzC-0004do-Iv for bug-guix@gnu.org; Wed, 31 Jul 2019 02:21:20 -0400 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.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 36870@debbugs.gnu.org Hi Ludovic, Please excuse my direct mail and speculative shot at CC-ing bug-guix ;-/ (Hope to get my email stuff in order RSN :) Bug: The plain old date command seems confused about zone info, as you can see from the following: Bottom line: I would look for a regex that erroneously excludes embedded forward slashes in forming the TZ key used to look up the localtime date info in tables like /gnu/store/xml1s9r9vp98amhyyn3q85p5xls3nivf-tzdata-2019a/share/zoneinfo/tzdata.zi The date bug ripples into lots of dependents, such as "who -b" that first made me notice, and lots more -- really need to fix! ;-) $ $ echo $TZ # my current zone America/Los_Angeles $ # plain America without following slash does not exist in the table, so how does date punt then? Insert key itself as %Z? $ egrep -m3 '^Z America([^/]|$)' /gnu/store/xml1s9r9vp98amhyyn3q85p5xls3nivf-tzdata-2019a/share/zoneinfo/tzdata.zi $ egrep -m3 '^Z America([^/]|$)' /gnu/store/xml1s9r9vp98amhyyn3q85p5xls3nivf-tzdata-2019a/share/zoneinfo/tzdata.zi $ egrep -m3 '^Z America([/]|$)' /gnu/store/xml1s9r9vp98amhyyn3q85p5xls3nivf-tzdata-2019a/share/zoneinfo/tzdata.zi Z America/Danmarkshavn -1:14:40 - LMT 1916 Jul 28 Z America/Scoresbysund -1:27:52 - LMT 1916 Jul 28 Z America/Godthab -3:26:56 - LMT 1916 Jul 28 $ egrep -m3 '^Z America/Los' /gnu/store/xml1s9r9vp98amhyyn3q85p5xls3nivf-tzdata-2019a/share/zoneinfo/tzdata.zi Z America/Los_Angeles -7:52:58 - LMT 1883 N 18 12:7:2 $ Earlier experiments, to get to above speculation, taken from emacs M-x shell: (Many examples below contrast the /usr/bin/ versions from arch linux with those redirected by guix profile links (more details follow)) ------------------------------------------------------------- [19:13 ~/bs]$ PS1='$ ' # minimize prompt overhead $ $ # first noticed in wrong directory name I generate $ # based on who -b -- which in turn depends on date $ # which has the bug (produces UTC, but more to it): $ date -Is 2019-07-31T02:22:29+00:00 $ /usr/bin/date -Is 2019-07-30T19:22:48-07:00 $ date --version date (GNU coreutils) 8.30 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David MacKenzie. $ /usr/bin/date --version date (GNU coreutils) 8.31 Copyright (C) 2019 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David MacKenzie. $ # but the real clue is from plain date, which mangles output order and TZ info: $ date Wed Jul 31 02:24:30 America 2019 $ /usr/bin/date Tue 30 Jul 2019 07:24:45 PM PDT $ which -a env /home/bokr/.guix-profile/bin/env /usr/bin/env $ env|grep TZ TZ=America/Los_Angeles $ /usr/bin/env|grep TZ TZ=America/Los_Angeles $ uname -a Linux PhantoNv4ArchGx 5.1.15-arch1-1-ARCH #1 SMP PREEMPT Tue Jun 25 04:49:39 UTC 2019 x86_64 GNU/Linux $ uname -rv 5.1.15-arch1-1-ARCH #1 SMP PREEMPT Tue Jun 25 04:49:39 UTC 2019 $ grep -m1 'model name' /proc/cpuinfo model name : Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz $ ## BTW, for me, arch linux with kernel 5.2.x went glacial with unk busyness $ ## and forced me to stay for now with 5.1.15 as "foreign distro" for my guix, which is $ guix --version guix (GNU Guix) 34e549d813113fc57213202fd5e4b885d95d0913 Copyright (C) 2019 the Guix authors License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. $ guix describe Generation 6 Jul 11 2019 08:41:53 (current) guix 34e549d repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: 34e549d813113fc57213202fd5e4b885d95d0913 $ $ ## I should probably do a pull and see if this has been fixed already, so, will do that... $ 2019-07-30 19:51:35 [ ] going for pull.. ------------------------------------------------------------- Well, that didn't fix it, unless reboot is required ... $ guix describe Generation 7 Jul 31 2019 03:25:55 (current) guix 274ba54 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: 274ba54e535b811acca02e42cffd45f0f625d142 $ date Wed Jul 31 03:44:28 America 2019 $ /usr/bin/date Tue 30 Jul 2019 08:44:42 PM PDT $ date '+%F %T %z %Z' 2019-07-31 03:45:44 +0000 America $ /usr/bin/date '+%F %T %z %Z' 2019-07-30 20:46:12 -0700 PDT $ file /etc/localtime /etc/localtime: symbolic link to /usr/share/zoneinfo/Europe/Stockholm $ # but TZ env variable usually overrides (seemingly, in my setup), and I am $ # currently in Seattle zone, and I change TZ in ~/.bash_profile to current $ env|grep TZ TZ=America/Los_Angeles $ /usr/bin/env|grep TZ TZ=America/Los_Angeles $ date --version $ date --version date (GNU coreutils) 8.30 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David MacKenzie. $ /usr/bin/date --version date (GNU coreutils) 8.31 Copyright (C) 2019 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David MacKenzie. $ --------------------------------------- Hard to believe the 8.30 to 8.31 version difference accounts for the problem. HTH, Regards, Bengt Richter