TimeZone database

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

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@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@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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@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@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@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

--
Ian Partridge

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@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@si.org <mailto:si@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@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@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

--
Ian Partridge
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

- Tony

···

On Jul 6, 2017, at 9:36 AM, Youming Lin <ylin@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@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@swift.org>
To: Ian Partridge <ian@poncho.org.uk>
Cc: swift-corelibs-dev <swift-corelibs-dev@swift.org>
Date: 07/06/2017 10:31 AM
Subject: Re: [swift-corelibs-dev] TimeZone database
Sent by: swift-corelibs-dev-bounces@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@swift.org <mailto:swift-corelibs-dev@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@si.org <mailto:si@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@swift.org <mailto:swift-corelibs-dev@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@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

--
Ian Partridge
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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@IBM, Kitura developer
Austin, TX
GitHub: @youming-lin

            <swift-corelibs-dev@swift.org>

···

From: Tony Parker via swift-corelibs-dev
To: Ian Partridge <ian@poncho.org.uk>
Cc: swift-corelibs-dev <swift-corelibs-dev@swift.org>
Date: 07/06/2017 10:31 AM
Subject: Re: [swift-corelibs-dev] TimeZone database
Sent by: swift-corelibs-dev-bounces@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@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@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@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@swift.org
                  https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

I've only poked this briefly, but it looks like
CFCopySystemVersionString() might give the info we'd need?

···

On 6 July 2017 at 16:28, Tony Parker <anthony.parker@apple.com> wrote:

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@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@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@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@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

--
Ian Partridge

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:

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@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@us.ibm.com <mailto:ylin@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@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@swift.org <mailto:swift-corelibs-dev@swift.org>>
To: Ian Partridge <ian@poncho.org.uk <mailto:ian@poncho.org.uk>>
Cc: swift-corelibs-dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>>
Date: 07/06/2017 10:31 AM
Subject: Re: [swift-corelibs-dev] TimeZone database
Sent by: swift-corelibs-dev-bounces@swift.org <mailto:swift-corelibs-dev-bounces@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@swift.org <mailto:swift-corelibs-dev@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@si.org <mailto:si@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@swift.org <mailto:swift-corelibs-dev@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@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

--
Ian Partridge
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

Just picking this up again.. is a solution imminent? My hack is

diff --git a/CoreFoundation/NumberDate.subproj/CFTimeZone.c
b/CoreFoundation/NumberDate.subproj/CFTimeZone.c
index 434203ab43..86ab6ecb71 100644
--- a/CoreFoundation/NumberDate.subproj/CFTimeZone.c
+++ b/CoreFoundation/NumberDate.subproj/CFTimeZone.c
@@ -33,6 +33,7 @@
#endif
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED
#include <tzfile.h>
+#define TZDIR "/usr/share/zoneinfo"
#elif DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_FREEBSD
#ifndef TZDIR
#define TZDIR "/usr/share/zoneinfo" /* Time zone object file directory */

which gets the tests running again on Sierra but I guess breaks on High Sierra.

Thanks,
Ian

···

On 6 July 2017 at 16:28, Tony Parker <anthony.parker@apple.com> wrote:

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@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@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@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@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

--
Ian Partridge

On 6 July 2017 at 16:31, Tony Parker via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

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@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@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@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@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

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

--
Ian Partridge

Hm, good question - we do have our ‘bootstrap’ directory which includes some time zone headers, but those are the ones from unicode and not tzfile.h.

- Tony

···

On Jul 6, 2017, at 11:42 AM, Alex Blewitt <alblue@apple.com> wrote:

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:

swift-corelibs-foundation/CFTimeZone.c at 2611dcd0d9b91fecace537838294bd85f0220503 · apple/swift-corelibs-foundation · GitHub

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@swift.org <mailto:swift-corelibs-dev@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@us.ibm.com <mailto:ylin@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@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@swift.org <mailto:swift-corelibs-dev@swift.org>>
To: Ian Partridge <ian@poncho.org.uk <mailto:ian@poncho.org.uk>>
Cc: swift-corelibs-dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>>
Date: 07/06/2017 10:31 AM
Subject: Re: [swift-corelibs-dev] TimeZone database
Sent by: swift-corelibs-dev-bounces@swift.org <mailto:swift-corelibs-dev-bounces@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@swift.org <mailto:swift-corelibs-dev@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@si.org <mailto:si@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@swift.org <mailto:swift-corelibs-dev@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@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

--
Ian Partridge
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

ylin@youming-mbpr:~/Swift/Kitura-Markdown$ docker run -it --rm ubuntu:16.04
find /usr -name zone.tab
ylin@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@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@IBM, Kitura developer
Austin, TX
GitHub: @youming-lin

···

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

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@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@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@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@swift.org>
            To: Ian Partridge <ian@poncho.org.uk>
            Cc: swift-corelibs-dev <swift-corelibs-dev@swift.org>
            Date: 07/06/2017 10:31 AM
            Subject: Re: [swift-corelibs-dev] TimeZone database
            Sent by: swift-corelibs-dev-bounces@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@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@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@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@swift.org

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

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

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

Looks like timezone files are in the ‘tzdata’ package. Maybe it got uninstalled or was never installed as part of the base. An ‘apt-get install tzdata’ might fix it.

Simon

···

On 6 Jul 2017, at 20:20, Youming Lin via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

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

ylin@youming-mbpr:~/Swift/Kitura-Markdown$ docker run -it --rm ubuntu:16.04 find /usr -name zone.tab
ylin@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@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@IBM, Kitura developer
Austin, TX
GitHub: @youming-lin

<graycol.gif>Alex Blewitt ---07/06/2017 01:42:22 PM---It looks like it's /usr/share/zoneinfo on all Ubuntu versions: alblue.local[~]$ docker run -it --rm

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

swift-corelibs-foundation/CFTimeZone.c at 2611dcd0d9b91fecace537838294bd85f0220503 · apple/swift-corelibs-foundation · GitHub

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@swift.org <mailto:swift-corelibs-dev@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@us.ibm.com <mailto:ylin@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@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@swift.org <mailto:swift-corelibs-dev@swift.org>>
To: Ian Partridge <ian@poncho.org.uk <mailto:ian@poncho.org.uk>>
Cc: swift-corelibs-dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>>
Date: 07/06/2017 10:31 AM
Subject: Re: [swift-corelibs-dev] TimeZone database
Sent by: swift-corelibs-dev-bounces@swift.org <mailto:swift-corelibs-dev-bounces@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@swift.org <mailto:swift-corelibs-dev@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@si.org <mailto:si@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@swift.org <mailto:swift-corelibs-dev@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@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

--
Ian Partridge
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

No solution is imminent - we may need to come up with a more portable workaround.

- Tony

···

On Jul 10, 2017, at 5:48 AM, Ian Partridge <ian@poncho.org.uk> wrote:

Just picking this up again.. is a solution imminent? My hack is

diff --git a/CoreFoundation/NumberDate.subproj/CFTimeZone.c
b/CoreFoundation/NumberDate.subproj/CFTimeZone.c
index 434203ab43..86ab6ecb71 100644
--- a/CoreFoundation/NumberDate.subproj/CFTimeZone.c
+++ b/CoreFoundation/NumberDate.subproj/CFTimeZone.c
@@ -33,6 +33,7 @@
#endif
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED
#include <tzfile.h>
+#define TZDIR "/usr/share/zoneinfo"
#elif DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_FREEBSD
#ifndef TZDIR
#define TZDIR "/usr/share/zoneinfo" /* Time zone object file directory */

which gets the tests running again on Sierra but I guess breaks on High Sierra.

Thanks,
Ian

On 6 July 2017 at 16:28, Tony Parker <anthony.parker@apple.com> wrote:

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@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@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@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@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

--
Ian Partridge

On 6 July 2017 at 16:31, Tony Parker via swift-corelibs-dev > <swift-corelibs-dev@swift.org> wrote:

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@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@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@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@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

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

--
Ian Partridge

For what it’s worth, a temporary workaround that’s working fine for me is just to create a symlink at /var/db/timezone/zoneinfo to point to /usr/share/zoneinfo on my Sierra machine. Obviously, this may not be a solution one can implement if you don’t fully control the machine in question (CI servers, etc), but it seems to work great for me hacking on swift-corelibs-foundation and running all the tests!

Thanks,
Robert

···

On Jul 10, 2017, at 12:01 PM, Tony Parker via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

No solution is imminent - we may need to come up with a more portable workaround.

- Tony

On Jul 10, 2017, at 5:48 AM, Ian Partridge <ian@poncho.org.uk> wrote:

Just picking this up again.. is a solution imminent? My hack is

diff --git a/CoreFoundation/NumberDate.subproj/CFTimeZone.c
b/CoreFoundation/NumberDate.subproj/CFTimeZone.c
index 434203ab43..86ab6ecb71 100644
--- a/CoreFoundation/NumberDate.subproj/CFTimeZone.c
+++ b/CoreFoundation/NumberDate.subproj/CFTimeZone.c
@@ -33,6 +33,7 @@
#endif
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED
#include <tzfile.h>
+#define TZDIR "/usr/share/zoneinfo"
#elif DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_FREEBSD
#ifndef TZDIR
#define TZDIR "/usr/share/zoneinfo" /* Time zone object file directory */

which gets the tests running again on Sierra but I guess breaks on High Sierra.

Thanks,
Ian

On 6 July 2017 at 16:28, Tony Parker <anthony.parker@apple.com> wrote:

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@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@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@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@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

--
Ian Partridge

On 6 July 2017 at 16:31, Tony Parker via swift-corelibs-dev >> <swift-corelibs-dev@swift.org> wrote:

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@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@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@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@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

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

--
Ian Partridge

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

Thanks for pointing me to the package. Turns out it was intentional:

A caveat to Swift developers using official Docker Ubuntu images in the
future.

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

···

From: Simon Evans <si@si.org>
To: Youming Lin <ylin@us.ibm.com>
Cc: Alex Blewitt <alblue@apple.com>, Ian Partridge
            <ian@poncho.org.uk>, swift-corelibs-dev
            <swift-corelibs-dev@swift.org>
Date: 07/06/2017 03:20 PM
Subject: Re: [swift-corelibs-dev] TimeZone database

Looks like timezone files are in the ‘tzdata’ package. Maybe it got
uninstalled or was never installed as part of the base. An ‘apt-get install
tzdata’ might fix it.

Simon

      On 6 Jul 2017, at 20:20, Youming Lin via swift-corelibs-dev < swift-corelibs-dev@swift.org> wrote:

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

      ylin@youming-mbpr:~/Swift/Kitura-Markdown$ docker run -it --rm
      ubuntu:16.04 find /usr -name zone.tab
      ylin@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@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@IBM, Kitura developer
      Austin, TX
      GitHub: @youming-lin

      <graycol.gif>Alex Blewitt ---07/06/2017 01:42:22 PM---It looks like
      it's /usr/share/zoneinfo on all Ubuntu versions: alblue.local[~]$
      docker run -it --rm

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

      swift-corelibs-foundation/CFTimeZone.c at 2611dcd0d9b91fecace537838294bd85f0220503 · apple/swift-corelibs-foundation · GitHub

      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@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@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@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@swift.org>
                              To: Ian Partridge <ian@poncho.org.uk>
                              Cc: swift-corelibs-dev <
                              swift-corelibs-dev@swift.org>
                              Date: 07/06/2017 10:31 AM
                              Subject: Re: [swift-corelibs-dev] TimeZone
                              database
                              Sent by: swift-corelibs-dev-bounces@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@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@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@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@swift.org
                           https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

                                                      --
                                                      Ian Partridge
                                                      _______________________________________________

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

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

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

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

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

We have a list of required packages in our README.md - we could add tzdata to that.

- Tony

···

On Jul 6, 2017, at 1:48 PM, Youming Lin via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

Thanks for pointing me to the package. Turns out it was intentional:
Latest ubuntu 16.04 does not have the 'tzdata' package installed in the base image · Issue #2863 · docker-library/official-images · GitHub

A caveat to Swift developers using official Docker Ubuntu images in the future.

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

<graycol.gif>Simon Evans ---07/06/2017 03:20:57 PM---Looks like timezone files are in the ‘tzdata’ package. Maybe it got uninstalled or was never install

From: Simon Evans <si@si.org>
To: Youming Lin <ylin@us.ibm.com>
Cc: Alex Blewitt <alblue@apple.com>, Ian Partridge <ian@poncho.org.uk>, swift-corelibs-dev <swift-corelibs-dev@swift.org>
Date: 07/06/2017 03:20 PM
Subject: Re: [swift-corelibs-dev] TimeZone database

Looks like timezone files are in the ‘tzdata’ package. Maybe it got uninstalled or was never installed as part of the base. An ‘apt-get install tzdata’ might fix it.

Simon
On 6 Jul 2017, at 20:20, Youming Lin via swift-corelibs-dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>> wrote:
That's odd. Maybe my ubuntu:16.04 image is outdated or something, but here are my outputs:

ylin@youming-mbpr:~/Swift/Kitura-Markdown$ docker run -it --rm ubuntu:16.04 find /usr -name zone.tab
ylin@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@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@IBM, Kitura developer
Austin, TX
GitHub: @youming-lin

<graycol.gif>Alex Blewitt ---07/06/2017 01:42:22 PM---It looks like it's /usr/share/zoneinfo on all Ubuntu versions: alblue.local[~]$ docker run -it --rm

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

swift-corelibs-foundation/CFTimeZone.c at 2611dcd0d9b91fecace537838294bd85f0220503 · apple/swift-corelibs-foundation · GitHub

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@swift.org <mailto:swift-corelibs-dev@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@us.ibm.com <mailto:ylin@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@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@swift.org <mailto:swift-corelibs-dev@swift.org>>
To: Ian Partridge <ian@poncho.org.uk <mailto:ian@poncho.org.uk>>
Cc: swift-corelibs-dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>>
Date: 07/06/2017 10:31 AM
Subject: Re: [swift-corelibs-dev] TimeZone database
Sent by: swift-corelibs-dev-bounces@swift.org <mailto:swift-corelibs-dev-bounces@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@swift.org <mailto:swift-corelibs-dev@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@si.org <mailto:si@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@swift.org <mailto:swift-corelibs-dev@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@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

--
Ian Partridge
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

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

@Tony_Parker Could you fix the Readme link please. (or just remove the link)

@tkrajacic, you've replied to a post from 11 months ago, which can't be edited (as far as I know), and doesn't contain a README.md link.

https://lists.swift.org/pipermail/swift-corelibs-dev/Week-of-Mon-20170703/001246.html

Oh, sorry! Stupid me. Didn't see the date. :man_facepalming: