patchmldonkey, a multi-networks file-sharing client - Patches: patch #4422, win32 goodies

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #4422: win32 goodies

Submitter:  su_blanc <su_blanc>
Submitted:  Thu 15 Sep 2005 05:12:24 PM UTC
   
 
Category:  Improved interfaces Priority:  5 - Normal
Status:  Wont Do Assigned to:  su_blanc
Open/Closed:  Closed

Jump to the original submission

Wed 26 Oct 2005 07:08:45 PM UTC, comment #25: 

Good idea, such big patches are hard to handle and test. I will close this patch now.
In one or two days I will release 2.6.7 because of the important patch #4555.
Further bug-fixing patches will take place, so it will take some
time when 2.7.0 will be released.
New features will be applied after 2.7.0 is out, so you could
send a patch for "fix a bug in Options.ml4" now, the rest will
go into MLDonkey later, so there is something to announce for 2.8.0;-)
Did you consider an update path for current installations of
MLDonkey on Windows in regard to moved ini files?

spiralvoice <spiralvoice>
Group administrator
Wed 26 Oct 2005 03:08:54 PM UTC, comment #24: 

Please don't use this patch. Consider it as a first attempt.
Instead, I will issue several smaller patches as follows:

  • mingw/win32 : fix C++ flags call by -cc
  • mingw/win32 : fix correct detection of gToolbox.mli
  • remove all 'Printf.printf' occurrences in the sources (to prepare win32 binaries using the subsystem window)
  • fix a bug in Options.ml4
  • split commonGlobals.ml in commonGlobalsBase.ml and commonGlobals.ml (keep common variables to mlnet and mlgui in commonGlobalsBase.ml only)
  • mingw/win32 : rework mlnet tree (directory and config files locations)
  • mingw/win32 : implement the subsystem window (to remove the console)
  • mingw/win32 : rework the win32 installer (NSIS)


su_blanc <su_blanc>
Group Member
Mon 24 Oct 2005 01:06:27 PM UTC, comment #23: 

I have noticed many problems in the paths for the last patch 4422_2.patch if I use the last CVS snapshot.
It is due to the change in the file autoconf.ml for the variables 'system' and 'windows'.
The following files shall be modified:
- commonFile.ml
- commonOptions.ml
- driverMain.ml
- guiMessages.ml
- imOptions.ml

Furthermore there is a problem with the variable CXX in Makefile.in
We shall call the option -cc "$(CXX)" instead of -cc $(CXX) where applicable in Makefile.in ...

su_blanc <su_blanc>
Group Member
Tue 18 Oct 2005 01:43:11 PM UTC, comment #22: 

the resfile should be renamed in core_resfile.o (no more resfile.o) now for mlnet (gui_resfile.o for the gui and bundle_resfile.o for mlnet+gui).
It is also built with 'make depend'.

mkwinapp is compiled only if --enable-subsystem-windows is enable and the OS is a win32 platform.
mkwinapp is called only if --enable-subsystem-windows is enable and only if the following rules in Makefile are used :
- release.mlnet.static
- win32.installer
- win32.installer.core
- win32.installer.gui
- win32.installer.bundle
- win32.installer.all

for the other rules, you have to do it manually.

su_blanc <su_blanc>
Group Member
Tue 18 Oct 2005 11:05:07 AM UTC, comment #21: 

My test was only with mlnet.exe to check if everything still works.
Mlnet.exe had no icon compiled-in, so I guess resfile.o was missing.
Is mkwinapp mlnet.exe called with --enable-subsystem-windows?

spiralvoice <spiralvoice>
Group administrator
Tue 18 Oct 2005 10:42:12 AM UTC, comment #20: 

Did not test the last patch, but the previous one was working.
I will be able to test on sunday only.

is svg_converter well compiled? you can test it separetely with a svg file. open the created file by svg_converter (it should be let xxx = "......."). If it is empty, you may have a problem with zlib.

How did you build the GUI?
If only by ./configure, make, then do:
$ mkwinapp mlgui.exe
$ strip mlgui.exe

Becarefull mlgui.exe shall be compiled with opt (no byte binary!).
Make sure that lablgtk2 has also been compiled with opt.

su_blanc <su_blanc>
Group Member
Tue 18 Oct 2005 09:05:02 AM UTC, comment #19: 

I quickly tested this patch with "--enable-subsystem-windows" on MinGW,
I got a binary without compiled-in icon and the console was still present.

spiralvoice <spiralvoice>
Group administrator
Sun 16 Oct 2005 09:58:27 PM UTC, comment #18: 

updated patch for current CVS, please check.
If everything is OK I will apply the patch so it will be included in 2.6.6.

spiralvoice <spiralvoice>
Group administrator
Fri 07 Oct 2005 10:59:55 AM UTC, comment #17: 

here is a HOWTO. Tell me if it works for you and then we can update the wiki because my dev environment is old now and I don't remember all the steps....

maybe I have to include the libgd and pthread also.

su_blanc <su_blanc>
Group Member
Fri 07 Oct 2005 08:01:17 AM UTC, comment #16: 

@su_blanc: Could you please post build instructions for lablgtk2 and its
dependencies when used on MinGW? I found this on the Ocaml mailinglist:
http://caml.inria.fr/pub/ml-archives/caml-list/2005/10/726a8f8546aadacb78e9b8a422f9f106.en.html

But I remember having a tough ride when trying this some months ago.
Currently I am unable to test your GTK2 GUI on Windows.

A good place for the compile HowTo would be here:
http://mldonkey.berlios.de/modules.php?name=Wiki&pagename=Windows

spiralvoice <spiralvoice>
Group administrator
Thu 06 Oct 2005 07:19:23 PM UTC, comment #15: 

Updated patch for current CVS

spiralvoice <spiralvoice>
Group administrator
Fri 30 Sep 2005 09:56:25 AM UTC, comment #14: 

patch updated according to comment #13
Spawing the core with Sancho 0.9.4-47 is working.

su_blanc <su_blanc>
Group Member
Tue 20 Sep 2005 03:31:29 PM UTC, comment #13: 

ok, i think i've got it...
Please comment the following points

1) There is 'bug' in basicSocket.ml in the function 'loop ()'.
where we use 'select !fd_tasks !timeout' we should replace it by 'if !fd_tasks <> [] then select !fd_tasks !timeout' because win32 doesn't appreciate at all an empty list (while exiting the app, we have plenty 'Exception select failed: Arg list too long in Select.loop' or 'Exception select failed: Bad file descriptor in Select.loop').

2) in driverMain.ml in the call of CommonGlobals.do_at_exit (approx. line #617 - for me) we do a 'try BasicSocket.close_all () with _ -> .....' but some fd are marked not to be closed (Cf. the call of prevent_close in basicSocket.ml). I think that we should close all fd on exit and create a new function really_close_all in basicSocket.ml

----- // -----
let really_close_all () =
  List.iter (fun s ->
    close s Closed_by_user
  ) !fd_tasks
----- // -----

3) calling a print "core started" on Pervasives.stdout (core spawning), even inside a 'try / with' block, seems to trigger a bug in Pervasives. Then Pervasives.exit (called by CommonGlobal.exit_properly) doesn't work anymore .... so we can't exit the basicSocket.loop function (endless looping ...)
The solution would be to print on stderr and not on stdout.
The physical result is the same if the printed messages are read on the console.
I think this is how it was before. The messages printed by Printf2.lprintf were routed to stderr that was the default out_channel (before the change to the default out_channel mlnet.log).

----- // -----
  if not !keep_console_output then
    begin
      try
        Printf.fprintf Pervasives.stderr "%sCore started\n" (log_time ());
        Pervasives.flush Pervasives.stderr;
      with _ -> ()
    end;
----- // -----


su_blanc <su_blanc>
Group Member
Sat 17 Sep 2005 05:00:50 PM UTC, comment #12: 

a 'try' block should do the trick (that's how work Printf2.lprintf). unfortunately the binary enters in an infinite loop (in BasicSocket.loop) when i try to exit the application (both mlnet and the bundle one).
i'm still wondering why...

Anonymous
Sat 17 Sep 2005 04:17:06 PM UTC, comment #11: 

Is a try block with Sys.err -> () around the printf an option to ignore the Syserr?

Anonymous
Sat 17 Sep 2005 10:02:34 AM UTC, comment #10: 

This file needs the patch from comment #9 as well:

opennapInteractive.ml

Linking mlnet fails:
Files build/client.cmxa and build/common.cmxa
both define a module named GuiDecoding

spiralvoice <spiralvoice>
Group administrator
Sat 17 Sep 2005 09:59:41 AM UTC, comment #9: 

File "src/daemon/common/commonInteractive.ml", line 378, characters 4-17:
Unbound value exit_properly

commonInteractive.ml needs this line:
open CommonBaseGlobals

spiralvoice <spiralvoice>
Group administrator
Sat 17 Sep 2005 09:50:24 AM UTC, comment #8: 

This patch breaks make depend:

@@ -272,8 +283,6 @@
   $(COMMON)/commonIndexing.ml \
   $(COMMON)/commonHasher_c.c \
   $(COMMON)/commonGraphics.ml
-
-COMMON_CLIENT_SRCS= \
   $(COMMON)/commonUser.ml \
   $(COMMON)/commonServer.ml \
   $(COMMON)/commonClient.ml \

There has to be a "\" after "commonGraphics.ml"

spiralvoice <spiralvoice>
Group administrator
Sat 17 Sep 2005 09:35:57 AM UTC, comment #7: 

Why not check for existance of mlnet.pid if MLDonkey is working?

spiralvoice <spiralvoice>
Group administrator
Sat 17 Sep 2005 08:58:19 AM UTC, comment #6: 

what we can do, is to modify the sources as follows:

in Autoconf.ml.new.in

let subsytem_windows = @SUBSYSTEM_WINDOWS@

in driverMain.ml

if not !keep_console_output && not Autoconf.subsystem_windows
  then begin
  Pervasives.output_string Pervasives.stdout (Printf.sprintf "%sCore started\n" (log_time ()));
Pervasives.flush Pervasives.stdout;
  end;
if not Autoconf.subsystem_windows
  then begin
    lprintf_nl "%sWarning! this core cannot be spawned via the old style way" (log_time ())
  end;

so the impact will be only if the flag --enable-subsytem-windows is passed during configuration. Thus only thoses binaries couldn't be spawned via the old style way.

Please any remark?

su_blanc <su_blanc>
Group Member
Sat 17 Sep 2005 08:28:52 AM UTC, comment #5: 

Do not in any case remove that "Core Started" print to stdout!

Or at least leave the option to have mldonkey behave the "old-style".

Anonymous
Fri 16 Sep 2005 04:14:02 PM UTC, comment #4: 

New cores would then not work with old guis.  It was the agreed upon standard from a few years ago.

If compiling it especially for a windows subsystem, don't print it, otherwise keep it the same?

Anonymous
Fri 16 Sep 2005 01:57:32 PM UTC, comment #3: 

that's the point... there is no console for windows subsystem applications. So we cannot route message to stdout otherwise the exception Sys_error is raised.
Otherwise we can't move mlnet and others binaries to a more windowish behaviour.

su_blanc <su_blanc>
Group Member
Fri 16 Sep 2005 09:22:21 AM UTC, comment #2: 

"(cannot route anymore messages to stdout ....)"
This is the reason why su_blanc needs to remove the "Core started" message.

I am thinking of another way how sancho-gui can check if MLDonkey core is up and running.

The PID file mlnet.pid is created a bit earlier then "Core started" message is printed, this part of code can be moved there and an
empty file can be created in Windows, currently mlnet.pid is not created on Windows because Unix.getpid return nothing. Sancho then checks for existance of mlnet.pid instead of waiting for a message printed on stdout.

spiralvoice <spiralvoice>
Group administrator
Thu 15 Sep 2005 06:26:18 PM UTC, comment #1: 

The string 'Core started' must be printed to stdout once the gui port has been opened and can be connected with.  This must remain to preserve backwards compat on all platforms.

Anonymous
Thu 15 Sep 2005 05:12:24 PM UTC, original submission:  


  • split commonGlobals.ml in commonBaseGlobals.ml & commonGlobals.ml

doing so, we separate definitely CommonOptions.ml from the other binaries than mlnet!
only the common part used by mlnet and mlgui is kept in commonBaseGlobals.ml
no interference with mlgui, mlim ...

  • added new .ico and different res files for mlnet, mlgui and mlnet+gui


  • added a new mldonkey.nsi

2 languages : french and english
1 nsi file to build 3 installer : core, gui or bundle
auto detect existing version if exists with reinstallation/removal/update options

  • added new rules in makefile.in : win32.installer.all, win32.installer.core, win32.installer.gui, win32.installer.bundle

the rule supposes that makensis.exe is installed in 'C:/Program Files/NSIS/'

  • added 1 new configure option '--enable-subsystem-windows'

to disable the console window in the win32 port

  • added mkwinapp.ml from Ocaml-Win32 by Harry Chomsky


  • replaced all occurrences Printf.printf by Printf2.lprintf

otherwise mlnet.exe, mlgui.exe or mlnet+gui.exe crash due to the new --enable-subsystem-windows option (cannot route anymore messages to stdout ....)

  • changed the function 'file_preview' in commonFile.ml

for the win32 version so that we can launch directely vlc.exe, or any other player

  • changed directories organization for the win32 version (matching with the installer ...)

mlDonkey
+ bin (mlnet.exe, mlgui.exe, zlib, iconv, gd, gtk dlls ...)
+ config (mlnet config files)
+ etc (for the gui or the bundle version => gtk)
+ lib (for the gui or the bundle version => gtk)
+ incoming
+ interface (mlgui, mlim config files
+ temp
+ torrents
+ webserver (html_mods ..)

  • correct a bug in options.ml4


TODO: impact the change of commonBaseGlobals.ml to the other GUIs

WARNING: in driverMain.ml (# line 600), i had to comment the following lines
(otherwise the binaries crash under win32 due to the use of the windows subsystem)
I suspect that breaks something highly required .... is this feature required for win32?


(* When a core is spawned from a gui, the only way to know the startup has
succeeded is the string token "Core started". *)
(*
  if not !keep_console_output then
    begin
      Pervasives.output_string Pervasives.stdout (Printf.sprintf "%sCore started\n" (log_time ()));
      Pervasives.flush Pervasives.stdout;
    end;
*)

su_blanc <su_blanc>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #7949:  4422_2.patch.bz2 added by spiralvoice (70KiB - application/octet-stream - updated patch for current CVS)
file #8060:  HOWTO_win32.txt added by su_blanc (15KiB - text/plain)
file #8137:  win32_goodies_v2.patch added by su_blanc (309KiB - application/octet-stream)
file #9026:  win32_goodies.patch added by su_blanc (306KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 9 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-10-26 spiralvoice StatusReady For Test Wont Do
    Open/ClosedOpen Closed
2005-10-16 spiralvoice StatusNone Ready For Test
2005-10-16 spiralvoice Attached File#5291 Removed
2005-10-16 spiralvoice Attached File- Added 4422_2.patch.bz2, #5332
2005-10-07 su_blanc Attached File- Added HOWTO_win32.txt, #5292
2005-10-06 spiralvoice Attached File- Added 4422_2.patch.bz2, #5291
2005-09-30 su_blanc Attached File- Added win32_goodies_v2.patch, #5264
2005-09-15 su_blanc Attached File- Added win32_goodies.patch, #5178

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code