Module: wine Branch: master Commit: 563ef82416e9059f29c10eab2e48fa324170a4fb URL: https://gitlab.winehq.org/wine/wine/-/commit/563ef82416e9059f29c10eab2e48fa3...
Author: Brendan Shanks bshanks@codeweavers.com Date: Wed Apr 24 13:08:52 2024 -0700
widl: Use hardcoded build time in TLB custom data.
This makes builds reproducible, and matches the current MIDL behavior (except that MIDL's string representation will vary with the build machine timezone).
---
tools/widl/write_msft.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c index 31e340e6bcd..b9a3d6664f2 100644 --- a/tools/widl/write_msft.c +++ b/tools/widl/write_msft.c @@ -2757,7 +2757,6 @@ int create_msft_typelib(typelib_t *typelib) const statement_t *stmt; const attr_t *attr; time_t cur_time; - char *time_override; unsigned int version = 7 << 24 | 555; /* 7.00.0555 */ static const struct uuid midl_time_guid = {0xde77ba63,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}}; static const struct uuid midl_version_guid = {0xde77ba64,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}}; @@ -2813,11 +2812,13 @@ int create_msft_typelib(typelib_t *typelib) } }
- /* midl adds two sets of custom data to the library: the current unix time - and midl's version number */ - time_override = getenv( "WIDL_TIME_OVERRIDE"); - cur_time = time_override ? atol( time_override) : time(NULL); - sprintf(info_string, "Created by WIDL version %s at %s", PACKAGE_VERSION, ctime(&cur_time)); + /* midl adds three sets of custom data to the library: + * - 2147483647 (INT_MAX, previously the current Unix time) + * - midl's version number + * - a string representation of those + */ + cur_time = 2147483647; + sprintf(info_string, "Created by WIDL version %s at %s", PACKAGE_VERSION, asctime(gmtime(&cur_time))); set_custdata(msft, &midl_info_guid, VT_BSTR, info_string, &msft->typelib_header.CustomDataOffset); set_custdata(msft, &midl_time_guid, VT_UI4, &cur_time, &msft->typelib_header.CustomDataOffset); set_custdata(msft, &midl_version_guid, VT_UI4, &version, &msft->typelib_header.CustomDataOffset);