Incorrect filesize and timestamps for JavaScript backend
The JavaScript backend still has some bugs when filling the stat
data used in the FileStatus
data structure:
Some issues I've found:
- the time fields (
st_atime
/st_mtime
/st_ctime
) fields are filled assuming that the size reported by theconfigure
script is for wholetimespec
struct, which results in 32 bit for the seconds + 32 bit for nanoseconds. In realitystat.st_mtime
is actually defined to bestat.st_mtim.tv_sec
and should be 64 bit. - the large field
st_size
is filled in the wrong order, resulting in the wrong size being decoded.
I'm working on a fix and adding a test that tests these basic file properties so that we can find them in a simple test (instead in something strange going wrong in cabal/backpack tests)