Re: [Demexp-dev] Problem with preference saving ?

2005-09-28 Thread Thomas Petazzoni
Hello,

David MENTRE wrote:

> I think you have spoted the bug quite well.

Cool ;-)

> I would write it:
>  ) else (
>   log " File \"%s\" does not exists. Don't load bases." filename;
>  Participants.initialize_default_participant_base ()
>   ) ;
>   flush_all ()

Ok, I understand. Anyway, I think that a proper fix would involve
throwing an exception in io.ml when the bases cannot be loaded, and in
demexp-server.ml, when this exception is catched, initialize a default
participant base.

> It's been a long time since I looked at that code, so I need to dive
> into it to fix it properly.

Ok.

Thanks,

Thomas
-- 
Thomas Petazzoni
[EMAIL PROTECTED]


___
Demexp-dev mailing list
Demexp-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/demexp-dev


Re: [Demexp-dev] Problem with preference saving ?

2005-09-28 Thread David MENTRE
Hello Thomas,

2005/9/28, Thomas Petazzoni <[EMAIL PROTECTED]>:
> Ok, I *think* I've found the bug. (Line numbers refers to 0.6.2).
>
> In srv/participants.ml.nw, the function which is in charge of creating
> the default root login (with the demexp password) is
> initialize_default_participant_base. After a quick grep inside
> srv/*.ml.nw, I found two places where this function is called:
>  - inside the participants autotest
>  - in src/demexp-server.ml.nw
>
> In srv/demexp-server.ml.nw, line 290, we can read:
>
>   if !flag_autotests then (
> log "server: use default participant base";
> Participants.initialize_default_participant_base ()
>) else
> log "server: use bases '%s'" !flag_bases_name;
>   start_server ()
>
> If I correctly read OCaml, it means that
> initialize_default_participant_base() is called *only* in the case of
> autotests. Otherwise, start_server() is called, will try to load a
> bases.dmxp file, won't find it... and will run the server with not
> default root login.
>
> Is that right ?

I think you have spoted the bug quite well.

> Anyway, the enclosed patch fixes it. It simply calls the
> initialize_default_participant_base() when the base loading fails.

At first sight, your patch is wrong. The
initialize_default_participant_base() is always called, because the
else includes only the log function call.

> (The !flag_autotests notation is quite strange for the C programmer,
> which may think that it's the same as if flag_autotests == FALSE. In
> fact, after a quick read inside Weis and Leroy book, I've
> (re)-discovered that it's like the '*' in C, a dereference operator. Funny).

Yes. Even after years of using OCaml, I easily read this construct as
negation. :(

> --- demexp-0.6.2/srv/io.ml.nw   2005-09-28 00:36:50.0 +0200
> +++ demexp-0.6.2-new/srv/io.ml.nw   2005-09-28 00:37:02.0 +0200
> @@ -103,5 +103,6 @@
>  log " done."
> ) else
>  log " File \"%s\" does not exists. Don't load bases." filename;
> +Participants.initialize_default_participant_base () ;
>flush_all ()
>  @

I would write it:
 ) else (
  log " File \"%s\" does not exists. Don't load bases." filename;
 Participants.initialize_default_participant_base ()
  ) ;
  flush_all ()

I just looked at your patch an not the original source code, so do not
take my words for an absolute answer. ;)

It's been a long time since I looked at that code, so I need to dive
into it to fix it properly.

Sorry for the stupid bug,
Yours,
d.


___
Demexp-dev mailing list
Demexp-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/demexp-dev


[Demexp-dev] MacOSX Compilation Notes

2005-09-28 Thread François-Xavier Ponscarme

Hi,

I've made a note about demexp compilation on OSX.
It's not a complete documentation specially for noweb part, and outdated 
as it concerns version O.6.

If you want to build client only there are not too much issues.

I'will try to update the wiki soon, the time to learn wiki syntax :-)

So notes:

INSTALL
** the best way to have a complete ocaml distribution is getting GODI :
   http://godi.ocaml-programming.de/
   All needed packages (cduce, lablgtk2, rpc ...) are available 
with   		   godi.

   (Fink or Darwinports are not required.)

** noweb installation :
   There are some minor troubles, but it's possible.

** trouble while linking with crt0.o : (server building)
   http://developer.apple.com/qa/qa2001/qa1118.html
   package needed : Csu (pick in the sources matching you OS version)
   http://www.opensource.apple.com/darwinsource/

** Static option -static for ld :(server building)
   Seems to be not compatible in OS X
   So replace it with -dynamic in the Makefile.

** cduce version warning:
   be sure to install latest Godi packages

** Documentation generation :
   You may have some troubles (minor), but the documentation is
   build anyway.

RUNNING

**Client : of couse you need X11 to run gtk2 client. The client (and 
server ?) must be launched under X11 terminal.



___
Demexp-dev mailing list
Demexp-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/demexp-dev