From bcpierce at cis.upenn.edu Tue Nov 5 09:43:54 2013 From: bcpierce at cis.upenn.edu (Benjamin C. Pierce) Date: Tue, 5 Nov 2013 09:43:54 -0500 Subject: [Unison-hackers] Unison on a Synology DS412+ In-Reply-To: <524AF149.5010409@apiacoa.org> References: <524AF149.5010409@apiacoa.org> Message-ID: <018EABA1-ADD1-42E8-8DED-81524B05CD78@cis.upenn.edu> > A short digression before the real subject: a huge thanks to all the > unison developers for probably the most reliable software I've being using. Glad you're finding it useful! :-) > Unfortunately, inotify-compat.h is not included in the svn repository. > I've found a similar file in the ocaml-inotify repository > https://github.com/vincenthz/ocaml-inotify, but for some reason, it does > not compile on the DS412+. Probably a too old version of something. I > was however successful with a comparable header from inotify-tools, > here: > https://github.com/rvoicilas/inotify-tools/blob/master/libinotifytools/src/inotifytools/inotify-nosys.h. > So I would recommend to add to the svn repository something similar to > this old glibc workaround. I don't have it on my system either. If it's working for you, perhaps we should add the version you used to the repo, if it's license-compatible. > 3) selftest > A final note: while the obtained binary seems to work, selftest does > not. More precisely, I've got: > nas> ./unison -selftest > Contacting server... > Running internal tests... > fastercheckUNSAFE 1... > Test fastercheckUNSAFE 1 / 3b: > Expected R2 = > Dir [("x", File "f00")] > but found > Dir [("x", File "bar")] > > Fatal error: Self-test fastercheckUNSAFE 1 / 3b failed! > > Disturbingly, I've got the very same error on a standard ubuntu 12.04 > box (here this is with ocaml 3.12.1). I'm probably doing something wrong. On OSX (10.8), the -selftest goes through fine. So there seems to be a difference in the way the fastercheckUNSAFE option is behaving on linux. That is, indeed, worth investigating a bit. If you'd like to experiment, have a look at the test that's being run, in the file test.ml. Even without knowing OCaml, it should be fairly clear what's going on. If you do the same sequence of file modifications and syncs manually, do you get the same incorrect result? Best, - Benjamin From jerome.vouillon at pps.univ-paris-diderot.fr Wed Nov 6 11:27:55 2013 From: jerome.vouillon at pps.univ-paris-diderot.fr (=?ISO-8859-1?Q?J=E9r=F4me_Vouillon?=) Date: Wed, 06 Nov 2013 17:27:55 +0100 Subject: [Unison-hackers] Unison on a Synology DS412+ In-Reply-To: <018EABA1-ADD1-42E8-8DED-81524B05CD78@cis.upenn.edu> References: <524AF149.5010409@apiacoa.org> <018EABA1-ADD1-42E8-8DED-81524B05CD78@cis.upenn.edu> Message-ID: <527A6E0B.5060405@pps.univ-paris-diderot.fr> On 05/11/2013 15:43, Benjamin C. Pierce wrote: >> A short digression before the real subject: a huge thanks to all the >> unison developers for probably the most reliable software I've being using. > > Glad you're finding it useful! :-) > >> Unfortunately, inotify-compat.h is not included in the svn repository. >> I've found a similar file in the ocaml-inotify repository >> https://github.com/vincenthz/ocaml-inotify, but for some reason, it does >> not compile on the DS412+. Probably a too old version of something. I >> was however successful with a comparable header from inotify-tools, >> here: >> https://github.com/rvoicilas/inotify-tools/blob/master/libinotifytools/src/inotifytools/inotify-nosys.h. >> So I would recommend to add to the svn repository something similar to >> this old glibc workaround. > > I don't have it on my system either. If it's working for you, perhaps we should add the version you used to the repo, if it's license-compatible. I had planned to remove this compatibility code, as I did not expect it to be useful to anyone. This is why inotify_compat.h is not included in the svn repository. >> 3) selftest >> A final note: while the obtained binary seems to work, selftest does >> not. More precisely, I've got: >> nas> ./unison -selftest >> Contacting server... >> Running internal tests... >> fastercheckUNSAFE 1... >> Test fastercheckUNSAFE 1 / 3b: >> Expected R2 = >> Dir [("x", File "f00")] >> but found >> Dir [("x", File "bar")] >> >> Fatal error: Self-test fastercheckUNSAFE 1 / 3b failed! >> >> Disturbingly, I've got the very same error on a standard ubuntu 12.04 >> box (here this is with ocaml 3.12.1). I'm probably doing something wrong. > > On OSX (10.8), the -selftest goes through fine. So there seems to be a difference in the way the fastercheckUNSAFE option is behaving on linux. That is, indeed, worth investigating a bit. > > If you'd like to experiment, have a look at the test that's being run, in the file test.ml. Even without knowing OCaml, it should be fairly clear what's going on. If you do the same sequence of file modifications and syncs manually, do you get the same incorrect result? What happens is that the file is created and then modified within a second. As we use lstat with a one-second granularity, and the file size does not change, Unison misses the file update. I don't understand why it works on OSX. Regards, -- J?r?me From Fabrice.Rossi at apiacoa.org Fri Nov 8 04:44:17 2013 From: Fabrice.Rossi at apiacoa.org (Fabrice Rossi) Date: Fri, 08 Nov 2013 10:44:17 +0100 Subject: [Unison-hackers] Unison on a Synology DS412+ In-Reply-To: <527A6E0B.5060405@pps.univ-paris-diderot.fr> References: <524AF149.5010409@apiacoa.org> <018EABA1-ADD1-42E8-8DED-81524B05CD78@cis.upenn.edu> <527A6E0B.5060405@pps.univ-paris-diderot.fr> Message-ID: <527CB271.10702@apiacoa.org> Hi, Le 06/11/2013 17:27, J?r?me Vouillon a ?crit : > On 05/11/2013 15:43, Benjamin C. Pierce wrote: >>> [...] >>> So I would recommend to add to the svn repository something similar to >>> this old glibc workaround. >> >> I don't have it on my system either. If it's working for you, perhaps >> we should add the version you used to the repo, if it's >> license-compatible. If I'm not mistaken, it's a direct copy of an old version of some kernel header and it has been written John McCutchan (according to the copyright), the original author of inotify. So it's GPL v2. > I had planned to remove this compatibility code, as I did not expect it > to be useful to anyone. This is why inotify_compat.h is not included in > the svn repository. I would be glad if you could include (license permitting) the version I'm proposing as it seems to compile everywhere I've tested it. Synology tends to be extremely conservative at least for the libc. The last version of their system (DSM 4.3) released at the end of August this year is still based on linux 3.2.11 and on glibc 2.3.6 (strange coupling) on my hardware. Other hardwares include older kernels (2.6.32) and newer glibc... Anyway, numerous persons use Unison on those NAS and if you release unison 2.46.20 with the C based fsmonitor but without the workaround, they will probably complain :-). >> [..] >> On OSX (10.8), the -selftest goes through fine. So there seems to be >> a difference in the way the fastercheckUNSAFE option is behaving on >> linux. That is, indeed, worth investigating a bit. >> >> If you'd like to experiment, have a look at the test that's being run, >> in the file test.ml. Even without knowing OCaml, it should be fairly >> clear what's going on. If you do the same sequence of file >> modifications and syncs manually, do you get the same incorrect result? > > What happens is that the file is created and then modified within a > second. As we use lstat with a one-second granularity, and the file size > does not change, Unison misses the file update. I don't understand why > it works on OSX. I think I understand vaguely the test (thanks to the comments) so if you need me to test something, I can, but if I understand J?r?me's explanation, the test should actually not work, should it? Best regards, Fabrice