haskell / time

A time library
http://hackage.haskell.org/package/time
Other
120 stars 80 forks source link

test-unix fails on FreeBSD and MacOS #149

Closed Bodigrim closed 3 years ago

Bodigrim commented 3 years ago

I crafted GitHub Actions to demonstrate this: https://github.com/haskell/time/runs/1685500304?check_suite_focus=true#step:5:3201

AshleyYakeley commented 3 years ago

The test-unix suite tests two things: that formatTime works correctly, using GNU strftime as a reference, and that getTimeZone respects the TZ environment variable. These things don't exist on Windows, which is why they're in a separate suite.

It looks like the failures are caused by strftime behaving differently on BSD (and MacOS) than on GNU. Probably the simplest thing to do would be to not run the formatTime tests on non-GNU platforms.

Bodigrim commented 3 years ago

Yeah, it seems to be because of Glibc extensions (see https://man7.org/linux/man-pages/man3/strftime.3.html#NOTES) unsupported by BSD platforms.

(BTW I can raise a PR with these GitHub Actions, if you wish, or feel free to cherry-pick them yourself)

AshleyYakeley commented 3 years ago

Sure, make a PR for the GH Actions. Thanks!

AshleyYakeley commented 3 years ago

Fixed!