From bcpierce at seas.upenn.edu Sun Sep 28 12:48:06 2014 From: bcpierce at seas.upenn.edu (bcpierce at seas.upenn.edu) Date: Sun, 28 Sep 2014 12:48:06 -0400 Subject: [Unison-hackers] [unison-svn] r530 - in trunk/src: . ubase Message-ID: <201409281648.s8SGm6UQ002980@yaws.seas.upenn.edu> Author: bcpierce Date: 2014-09-28 12:48:05 -0400 (Sun, 28 Sep 2014) New Revision: 530 Modified: trunk/src/Makefile.OCaml trunk/src/RECENTNEWS trunk/src/globals.mli trunk/src/mkProjectInfo.ml trunk/src/ubase/depend trunk/src/ubase/util.ml Log: * Incorporate a small patch from Christopher Zimmermann to replace the Uprintf module (which doesn't work with OCaml 4.02) with equivalent functionality from the standard library. Modified: trunk/src/Makefile.OCaml =================================================================== --- trunk/src/Makefile.OCaml 2014-07-07 11:21:59 UTC (rev 529) +++ trunk/src/Makefile.OCaml 2014-09-28 16:48:05 UTC (rev 530) @@ -218,7 +218,7 @@ system.cmo \ \ ubase/projectInfo.cmo ubase/myMap.cmo ubase/safelist.cmo \ - ubase/uprintf.cmo ubase/util.cmo ubase/uarg.cmo \ + ubase/util.cmo ubase/uarg.cmo \ ubase/prefs.cmo ubase/trace.cmo ubase/proplist.cmo \ \ lwt/pqueue.cmo lwt/lwt.cmo lwt/lwt_util.cmo \ Modified: trunk/src/RECENTNEWS =================================================================== --- trunk/src/RECENTNEWS 2014-07-07 11:21:59 UTC (rev 529) +++ trunk/src/RECENTNEWS 2014-09-28 16:48:05 UTC (rev 530) @@ -1,3 +1,11 @@ +CHANGES FROM VERSION 2.47.2 + +* Incorporate a small patch from Christopher Zimmermann to replace the + Uprintf module (which doesn't work with OCaml 4.02) with equivalent + functionality from the standard library. + + +------------------------------- CHANGES FROM VERSION 2.47.1 * Fixed a bug in export procedure that was messing up documentation strings Modified: trunk/src/globals.mli =================================================================== --- trunk/src/globals.mli 2014-07-07 11:21:59 UTC (rev 529) +++ trunk/src/globals.mli 2014-09-28 16:48:05 UTC (rev 530) @@ -61,17 +61,18 @@ (* Run a command on all hosts in roots and collect results *) val allHostsMap : (string -> 'a) -> 'a list -(* Make sure that the server has the same settings for its preferences as we *) -(* do locally. Should be called whenever the local preferences have *) -(* changed. (This isn't conceptually a part of this module, but it can't *) -(* live in the Prefs module because that would introduce a circular *) -(* dependency.) *) +(* Make sure that the server has the same settings for its preferences as we + do locally. Should be called whenever the local preferences have + changed. (This isn't conceptually a part of this module, but it can't + live in the Prefs module because that would introduce a circular + dependency.) *) val propagatePrefs : unit -> unit Lwt.t (* User preference: when true, don't ask any questions *) val batch : bool Prefs.t -(* User preference: ask for confirmation when propagating a deletion of a whole replica or top-level path *) +(* User preference: ask for confirmation when propagating a deletion of + a whole replica or top-level path *) val confirmBigDeletes : bool Prefs.t (* Predicates on paths *) @@ -80,8 +81,9 @@ val ignorePred : Pred.t val ignorenotPred : Pred.t -(* Be careful calling this to add new patterns to be ignored: Its value does NOT persist - when a new profile is loaded, so it has to be called again whenever this happens. *) +(* Be careful calling this to add new patterns to be ignored: Its + value does NOT persist when a new profile is loaded, so it has to + be called again whenever this happens. *) val addRegexpToIgnore : string -> unit (* Merging commands *) Modified: trunk/src/mkProjectInfo.ml =================================================================== --- trunk/src/mkProjectInfo.ml 2014-07-07 11:21:59 UTC (rev 529) +++ trunk/src/mkProjectInfo.ml 2014-09-28 16:48:05 UTC (rev 530) @@ -94,3 +94,4 @@ + Modified: trunk/src/ubase/depend =================================================================== --- trunk/src/ubase/depend 2014-07-07 11:21:59 UTC (rev 529) +++ trunk/src/ubase/depend 2014-09-28 16:48:05 UTC (rev 530) @@ -12,10 +12,8 @@ trace.cmx : util.cmx safelist.cmx prefs.cmx trace.cmi uarg.cmo : util.cmi safelist.cmi uarg.cmi uarg.cmx : util.cmx safelist.cmx uarg.cmi -uprintf.cmo : uprintf.cmi -uprintf.cmx : uprintf.cmi -util.cmo : uprintf.cmi safelist.cmi util.cmi -util.cmx : uprintf.cmx safelist.cmx util.cmi +util.cmo : safelist.cmi util.cmi +util.cmx : safelist.cmx util.cmi myMap.cmi : prefs.cmi : util.cmi proplist.cmi : @@ -23,5 +21,4 @@ safelist.cmi : trace.cmi : prefs.cmi uarg.cmi : -uprintf.cmi : util.cmi : Modified: trunk/src/ubase/util.ml =================================================================== --- trunk/src/ubase/util.ml 2014-07-07 11:21:59 UTC (rev 529) +++ trunk/src/ubase/util.ml 2014-09-28 16:48:05 UTC (rev 530) @@ -62,7 +62,8 @@ if s <> !infos then begin clear_infos (); infos := s; show_infos () end let msg f = - clear_infos (); Uprintf.eprintf (fun () -> flush stderr; show_infos ()) f + clear_infos (); + Printf.kfprintf (fun _ -> flush stderr; show_infos ()) stderr f let msg : ('a, out_channel, unit) format -> 'a = msg From bcpierce at cis.upenn.edu Sun Sep 28 12:48:10 2014 From: bcpierce at cis.upenn.edu (Benjamin C. Pierce) Date: Sun, 28 Sep 2014 12:48:10 -0400 Subject: [Unison-hackers] Unison Uprintf obsolete In-Reply-To: <20140919181338.2a72839f@mortimer.gmerlin.de> References: <20140919181338.2a72839f@mortimer.gmerlin.de> Message-ID: Thanks for the patch, Christopher. I?ve incorporated it in the trunk and am cc?ing the unison-hackers list so that people know that there may be other issues lurking with the 4.02 OCaml update. - Benjamin > From: Christopher Zimmermann > Subject: Unison Uprintf obsolete > Date: Fri, 19 Sep 2014 16:36:49 +0200 > > Hello, > > I am porting OCaml stuff for OpenBSD. We updated to OCaml 4.02 some > weeks ago. Since the upgrade the stable unison port is segfaulting in > different places. One place is the Uprintf module, whose use of > Obj.magic is no longer safe. Since its only use is in ubase/util.ml > and its additional functionality is provided by the OCaml stdlib > since 3.09 I propose the following diff: > > --- ubase/util.ml.orig Fri Sep 19 12:38:42 2014 > +++ ubase/util.ml Fri Sep 19 12:39:27 2014 > @@ -62,7 +62,8 @@ > if s <> !infos then begin clear_infos (); infos := s; show_infos () > end > let msg f = > - clear_infos (); Uprintf.eprintf (fun () -> flush stderr; show_infos()) f > + clear_infos (); > + Printf.kfprintf (fun _ -> flush stderr; show_infos ()) stderr f > > let msg : ('a, out_channel, unit) format -> 'a = msg > > > with this diff the Uprintf module can be removed. > > > Regards, > Christopher > > > -- > http://gmerlin.de > OpenPGP: http://gmerlin.de/christopher.pub > F190 D013 8F01 AA53 E080 3F3C F17F B0A1 D44E 4FEE > From: Christopher Zimmermann > Subject: Unison Uprintf obsolete > Date: September 19, 2014 at 10:36:49 AM EDT > To: unison-hackers at lists.seas.upenn.edu > > > Hello, > > I am porting OCaml stuff for OpenBSD. We updated to OCaml 4.02 some > weeks ago. Since the upgrade the stable unison port is segfaulting in > different places. One place is the Uprintf module, whose use of > Obj.magic is no longer safe. Since its only use is in ubase/util.ml > and its additional functionality is provided by the OCaml stdlib > since 3.09 I propose the following diff: > > --- ubase/util.ml.orig Fri Sep 19 12:38:42 2014 > +++ ubase/util.ml Fri Sep 19 12:39:27 2014 > @@ -62,7 +62,8 @@ > if s <> !infos then begin clear_infos (); infos := s; show_infos () > end > let msg f = > - clear_infos (); Uprintf.eprintf (fun () -> flush stderr; show_infos > ()) f > + clear_infos (); > + Printf.kfprintf (fun _ -> flush stderr; show_infos ()) stderr f > > let msg : ('a, out_channel, unit) format -> 'a = msg > > > with this diff the Uprintf module can be removed. > > > Regards, > Christopher > > > -- > http://gmerlin.de > OpenPGP: http://gmerlin.de/christopher.pub > F190 D013 8F01 AA53 E080 3F3C F17F B0A1 D44E 4FEE > > -------------- next part -------------- An HTML attachment was scrubbed... URL: