use ExternalProject_Add for timelib, and update to timelib 2021.07 (#8870)
commit5be1acd5313e0121bf3a14ea48cd5e3c63d4019b
authorScott Sandler <ssandler@slack-corp.com>
Thu, 2 Sep 2021 21:28:14 +0000 (2 14:28 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 2 Sep 2021 21:30:02 +0000 (2 14:30 -0700)
tree7cb13e262ecba059aa252f88d54cba6f485c55bb
parent72a59be46018a41f2e3c4e2a7026db8a767610ce
use ExternalProject_Add for timelib, and update to timelib 2021.07 (#8870)

Summary:
This is an attempt to fix https://github.com/facebook/hhvm/issues/8868. I was able to get hhvm to build with these patches and an updated timelib. Note it does add a new build dependency in `re2c` which was not a build dependency before.

This resolves the problem described in that issue, with these changes `var_dump(new DateTimeZone('America/Los_Angeles')->getTransitions(14200704001577836800));` once again returns 11 results instead of 1.
```
cat test.hack
<<__EntryPoint>>
function main(): void {
var_dump(new DateTimeZone('America/Los_Angeles')->getTransitions(14200704001577836800));

}
```

```
hhvm test.hack
varray(11) {
  darray(5) {
    ["ts"]=>
    int(1420070400)
    ["time"]=>
    string(24) "2015-01-01T00:00:00+0000"
    ["offset"]=>
    int(-28800)
    ["isdst"]=>
    bool(false)
    ["abbr"]=>
    string(3) "PST"
  }
  darray(5) {
    ["ts"]=>
    int(1425808800)
    ["time"]=>
    string(24) "2015-03-08T10:00:00+0000"
    ["offset"]=>
    int(-25200)
    ["isdst"]=>
    bool(true)
    ["abbr"]=>
    string(3) "PDT"
  }
  darray(5) {
    ["ts"]=>
    int(1446368400)
    ["time"]=>
    string(24) "2015-11-01T09:00:00+0000"
    ["offset"]=>
    int(-28800)
    ["isdst"]=>
    bool(false)
    ["abbr"]=>
    string(3) "PST"
  }
  darray(5) {
    ["ts"]=>
    int(1457863200)
    ["time"]=>
    string(24) "2016-03-13T10:00:00+0000"
    ["offset"]=>
    int(-25200)
    ["isdst"]=>
    bool(true)
    ["abbr"]=>
    string(3) "PDT"
  }
  darray(5) {
    ["ts"]=>
    int(1478422800)
    ["time"]=>
    string(24) "2016-11-06T09:00:00+0000"
    ["offset"]=>
    int(-28800)
    ["isdst"]=>
    bool(false)
    ["abbr"]=>
    string(3) "PST"
  }
  darray(5) {
    ["ts"]=>
    int(1489312800)
    ["time"]=>
    string(24) "2017-03-12T10:00:00+0000"
    ["offset"]=>
    int(-25200)
    ["isdst"]=>
    bool(true)
    ["abbr"]=>
    string(3) "PDT"
  }
  darray(5) {
    ["ts"]=>
    int(1509872400)
    ["time"]=>
    string(24) "2017-11-05T09:00:00+0000"
    ["offset"]=>
    int(-28800)
    ["isdst"]=>
    bool(false)
    ["abbr"]=>
    string(3) "PST"
  }
  darray(5) {
    ["ts"]=>
    int(1520762400)
    ["time"]=>
    string(24) "2018-03-11T10:00:00+0000"
    ["offset"]=>
    int(-25200)
    ["isdst"]=>
    bool(true)
    ["abbr"]=>
    string(3) "PDT"
  }
  darray(5) {
    ["ts"]=>
    int(1541322000)
    ["time"]=>
    string(24) "2018-11-04T09:00:00+0000"
    ["offset"]=>
    int(-28800)
    ["isdst"]=>
    bool(false)
    ["abbr"]=>
    string(3) "PST"
  }
  darray(5) {
    ["ts"]=>
    int(1552212000)
    ["time"]=>
    string(24) "2019-03-10T10:00:00+0000"
    ["offset"]=>
    int(-25200)
    ["isdst"]=>
    bool(true)
    ["abbr"]=>
    string(3) "PDT"
  }
  darray(5) {
    ["ts"]=>
    int(1572771600)
    ["time"]=>
    string(24) "2019-11-03T09:00:00+0000"
    ["offset"]=>
    int(-28800)
    ["isdst"]=>
    bool(false)
    ["abbr"]=>
    string(3) "PST"
  }
}
```

Pull Request resolved: https://github.com/facebook/hhvm/pull/8870

Reviewed By: binliu19

Differential Revision: D30377115

fbshipit-source-id: 8dff0c141c718c42d2f3d24e9288dd5133eedda4
CMake/HPHPSetup.cmake
hphp/runtime/base/timezone.cpp
third-party/CMakeLists.txt
third-party/timelib/CMakeLists.txt [new file with mode: 0644]
third-party/timelib/timelib-CMakeLists.txt [new file with mode: 0644]