git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Outreachy][PATCH 2/2] Port helper/test-date.c to unit-tests/t-date.c

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 28, 2024, 16:35 UTC
Message-ID
<xmqqttkquxes.fsf@gitster.g>
In-Reply-To
<tpaamfc3g5mrrbfufyvxi67ja2ko2hiihrptwxkbmdx4qpid3f@7aashrngiscn>
Ghanshyam Thakkar <shyamthakkar001@gmail.com> writes:
Show 11 quoted lines
> I believe the issue might not be related to the setenv function, but rather
> with tzset(). As you can see here[1], when we set TZ before we call the
> unit-testing binaries, the tests which were failing (EST5 ones that I
> separated with t-datetest) pass on 'win test (0)', and the ones which
> were passing (UTC ones, t-date) fail. (Although some tests on linux are also
> failing, but that can be explained by the fact that t-date runs first
> and sets the TZ to UTC, afterwhich t-datetest runs and fails, although
> this is not conclusive). Therefore, I am almost certain that the issue
> is with changing the timezone during runtime on windows and not with setting
> TZ variable with setenv(). CC'ing Johannes to see if he has any insights
> on this.

Interesting. Sometime before I started working on Git, I learned that no program did tzset() after it started running to switch multiple timezones and worked correctly on many different variants of UNIXes (there were many of them back then), and because I never got interested in writing a world-clock program, I didn't know, and kind of surprised to learn that it works on some platforms (like Linux and macOS) to switch zones with tzset() these days ;-).

So, if Windows runtime is unhappy with the program calling tzset() more than once, I wouldn't be too surprised.

Thanks.
Previous: Ghanshyam ThakkarNext: Patrick Steinhardt
Message 4 of 10 in “date: refactor 64 bit prereq code into reusable functions”
  1. Achu LumaFeb 5, 2024
  2. [Outreachy][PATCH 2/2] Port helper/test-date.c to unit-tests/t-date.cAchu Luma, Feb 5, 2024
  3. Ghanshyam ThakkarMar 28, 2024
  4. Junio C HamanoMar 28, 2024
  5. Patrick SteinhardtMay 28, 2024
  6. Junio C HamanoMay 28, 2024
  7. Patrick SteinhardtMay 29, 2024
  8. Johannes SchindelinJun 27, 2024
  9. rsbecker@nexbridge.comFeb 5, 2024
  10. Christian CouderFeb 6, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.