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(
1420070400,
1577836800));` once again returns 11 results instead of 1.
```
cat test.hack
<<__EntryPoint>>
function main(): void {
var_dump(new DateTimeZone('America/Los_Angeles')->getTransitions(
1420070400,
1577836800));
}
```
```
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