
Ok, so it seems like it works on Linux, but not FreeBSD. To explain the situation a little bit: The compiled object files (.o) are linked together in an archive file (.a) by the `ar` program (similar to `tar`). The file entries in the .a file by default contain timestamps of the files, which usually means the mtime (last modification time). The build only looks at the .a file as a whole, and if its contents changed from the last build, it has to relink. Of course if a timestamp inside the .a changed, that's treated as "the .a file is different". Newer versions of `ar` have a -D option to avoid putting the mtimes of the .o files into the archive. But not all platforms supported by GHC/cabal support this flag. That's why we implemented a manual method to wipe the timestamps (set them to 0), so that they can no longer have an effect on the build. Seems like that doesn't work for FreeBSD. That's a shame, because we did take special care to make sure that it works cross-platform. You could help debug it: First, create an issue on cabal's Github so that we can track the bug, and explain the problem there and paste the output. Then try to find the craeated .a file (the -v outputs should help you where it is, something like libHSyourlibrary.a or similar), and observe how its contents change across different builds (you could use `cmp` to check if the files are byte-identical or something like `diff -u <(xxd firstbuild.a) <(xxd secondbuild.a)` to view the contents as a hex diff). Then try to see if this program I wrote: http://hackage.haskell.org/package/ar-timestamp-wiper makes the two .a files byte-identical. That will probably help us find the issue and get relinking-avoidance also on the BSDs. On 11/11/14 13:01, Semen Trygubenko / Семен Тригубенко wrote:
So it seems that what I've observed is FreeBSD-specific — FreeBSD rebuild outputs have extra "Linking ..." messages in them…