[swift-corelibs-dev] TimeZone database

Youming Lin ylin at us.ibm.com
Thu Jul 6 14:15:24 CDT 2017


That's odd. Maybe my ubuntu:16.04 image is outdated or something, but here
are my outputs:

ylin at youming-mbpr:~/Swift/Kitura-Markdown$ docker run -it --rm ubuntu:16.04
find /usr -name zone.tab
ylin at youming-mbpr:~/Swift/Kitura-Markdown$ docker run -it --rm ubuntu:14.04
find /usr -name zone.tab
/usr/share/zoneinfo/zone.tab

The file is found in ubuntu:14.04 but not in ubuntu:16.04.

Here are my images:

ylin at youming-mbpr:~/Swift/Kitura-Markdown$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED
SIZE
ubuntu              16.04               7b9b13f7b9c0        4 weeks ago
118MB
ubuntu              14.04               132b7427a3b4        4 weeks ago
188MB

Thanks,

Youming Lin
IBM Cloud, Swift at IBM, Kitura developer
Austin, TX
GitHub: @youming-lin



From:	Alex Blewitt <alblue at apple.com>
To:	Tony Parker <anthony.parker at apple.com>
Cc:	Youming Lin <ylin at us.ibm.com>, Ian Partridge
            <ian at poncho.org.uk>, swift-corelibs-dev
            <swift-corelibs-dev at swift.org>
Date:	07/06/2017 01:42 PM
Subject:	Re: [swift-corelibs-dev] TimeZone database
Sent by:	alblue at apple.com



It looks like it's /usr/share/zoneinfo on all Ubuntu versions:

alblue.local[~]$ docker run -it --rm ubuntu:14.04 find /usr -name zone.tab
/usr/share/zoneinfo/zone.tab
alblue.local[~]$ docker run -it --rm ubuntu:16.04 find /usr -name zone.tab
/usr/share/zoneinfo/zone.tab
alblue.local[~]$ docker run -it --rm ubuntu:16.10 find /usr -name zone.tab
/usr/share/zoneinfo/zone.tab

This is the same that's coming from CFTimeZone.c:

https://github.com/apple/swift-corelibs-foundation/blob/2611dcd0d9b91fecace537838294bd85f0220503/CoreFoundation/NumberDate.subproj/CFTimeZone.c#L36-L39

Is it possible that the MacOS header is being included and defining TZDIR
before the CFTimeZone.c file is compiled?

Alex

      On 6 Jul 2017, at 19:22, Tony Parker via swift-corelibs-dev <
      swift-corelibs-dev at swift.org> wrote:

      Is the path to zoneinfo different on the Ubuntu docker image?

      - Tony

            On Jul 6, 2017, at 9:36 AM, Youming Lin <ylin at us.ibm.com>
            wrote:



            We were seeing this on Travis too. Specifically, on a Travis
            matrix build using Swift 3.1.1 on a Ubuntu 16.04 docker image
            running inside a Travis 14.04 VM.

            The issue was specific to the Ubuntu 16.04 docker image; when I
            tested in Ubuntu 16.04 OS as a guest VM, the issue went away.

            Thanks,

            Youming Lin
            IBM Cloud, Swift at IBM, Kitura developer
            Austin, TX
            GitHub: @youming-lin

            <graycol.gif>Tony Parker via swift-corelibs-dev ---07/06/2017
            10:31:15 AM---Yes, we’re discussing this one internally too and
            trying to figure out what the right answer is. May

            From: Tony Parker via swift-corelibs-dev <
            swift-corelibs-dev at swift.org>
            To: Ian Partridge <ian at poncho.org.uk>
            Cc: swift-corelibs-dev <swift-corelibs-dev at swift.org>
            Date: 07/06/2017 10:31 AM
            Subject: Re: [swift-corelibs-dev] TimeZone database
            Sent by: swift-corelibs-dev-bounces at swift.org





            Yes, we’re discussing this one internally too and trying to
            figure out what the right answer is. Maybe the best solution
            for now is to find a good mechanism to check the underlying
            version of the OS and split it out into a function as you
            suggest.

            - Tony
                        On Jul 6, 2017, at 7:37 AM, Ian Partridge via
                        swift-corelibs-dev <swift-corelibs-dev at swift.org>
                        wrote:

                        Good shout Simon, you are right. I'm on Sierra.
                        Compare and contrast:

                        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/tzfile.h

                        #define TZDIR "/usr/share/zoneinfo"

                        /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/tzfile.h

                        #define TZDIR "/var/db/timezone/zoneinfo"

                        so I guess if I installed the High Sierra beta it
                        would work OK.

                        I hacked CF to force it to use /usr/share/zoneinfo
                        and TestFoundation
                        is much happier, but that's not a solution.

                        On 6 July 2017 at 15:20, Simon Evans <si at si.org>
                        wrote:
                                    Ian

                                    I also saw this error, I think its
                                    because the TZDIR is different in the
                                    headers shipped with Xcode 9. Maybe the
                                    location of the timezone directory was
                                    moved between Sierra and High Sierra.
                                    What version of macOS are you testing
                                    on?

                                    If it has indeed moved between 10.12
                                    and 10.13 it may require a runtime
                                    version check to dynamically return
                                    TZDIR.

                                    Simon

                                                On 6 Jul 2017, at 15:09,
                                                Ian Partridge via
                                                swift-corelibs-dev <
                                                swift-corelibs-dev at swift.org
                                                > wrote:

                                                Hi,

                                                I'm seeing quite a lot of
                                                tests failing when running
                                                the
                                                TestFoundation target in
                                                Xcode. The failures are
                                                timezone related.
                                                Most simply, the code

                                                let timeZone = TimeZone
                                                (abbreviation: "GMT")

                                                is returning nil.

                                                Walking through the CF code
                                                which sets things up, it
                                                seems to be
                                                trying to read the timezone
                                                database from
                                                /var/db/timezone/zoneinfo/zone.tab
 which doesn't exist on my macOS
                                                system.

                                                /usr/share/zoneinfo/zone.tab
 is there and seems to be the right
                                                location (?), but CF is
                                                picking up TZDIR from
                                                tzfile.h which says:

                                                #define TZDIR
                                                "/var/db/timezone/zoneinfo"

                                                Any thoughts? I feel like
                                                I'm missing something
                                                obvious and have gone
                                                too far down the rabbit
                                                hole.

                                                --
                                                Ian Partridge
                                                _______________________________________________

                                                swift-corelibs-dev mailing
                                                list
                                                swift-corelibs-dev at swift.org

                                                https://lists.swift.org/mailman/listinfo/swift-corelibs-dev



                        --
                        Ian Partridge
                        _______________________________________________
                        swift-corelibs-dev mailing list
                        swift-corelibs-dev at swift.org
                        https://lists.swift.org/mailman/listinfo/swift-corelibs-dev
            _______________________________________________
            swift-corelibs-dev mailing list
            swift-corelibs-dev at swift.org
            https://lists.swift.org/mailman/listinfo/swift-corelibs-dev




      _______________________________________________
      swift-corelibs-dev mailing list
      swift-corelibs-dev at swift.org
      https://lists.swift.org/mailman/listinfo/swift-corelibs-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20170706/3eeee1cf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20170706/3eeee1cf/attachment.gif>


More information about the swift-corelibs-dev mailing list