From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 79747BC69 for ; Mon, 6 Aug 2007 09:36:06 +0200 (CEST) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.182]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l767a5RY025737 for ; Mon, 6 Aug 2007 09:36:05 +0200 Received: by py-out-1112.google.com with SMTP id u52so2299408pyb for ; Mon, 06 Aug 2007 00:36:05 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NbUJ4KvMfP7z3g/eZmMoLM6QgKB3tF1M4GdvmJpnnIZZdCbCtJUN10Bj7CAOcYIH+Xkx6huhVh7cQL8rmBAD4pl2BLbc4u7B6Y+v5s1KQeu24G0/F3xWw+Cw/H/bRFEuJV+eGjJlcr80ko3vXUewLL9VvyYDw5Z+zCrziUjO2hc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=C/Kb1NhHEycaYIpD+9WF1P4bcAP9HKJ09q2pPcLzclljh70BFgz8fOrid8H4unEMgCdq/wl8bNv6FMI00pORzDUcLv6xG/Z8ldbUA3CK9Z2cegC6FCtolUYmnaw3+JRi7jefzQeaK00U0oRqthYeNfhc0SZMcM0s9ncmg9cHM44= Received: by 10.35.129.19 with SMTP id g19mr9316899pyn.1186385764831; Mon, 06 Aug 2007 00:36:04 -0700 (PDT) Received: by 10.35.71.16 with HTTP; Mon, 6 Aug 2007 00:36:04 -0700 (PDT) Message-ID: <666572260708060036k26f20557j6167e94bca3e5dc@mail.gmail.com> Date: Mon, 6 Aug 2007 09:36:04 +0200 From: Adrien To: skaller Subject: Re: [Caml-list] ocamlbuild Cc: caml-list@yquem.inria.fr In-Reply-To: <1186355977.6523.55.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1186355977.6523.55.camel@rosella.wigram> X-j-chkmail-Score: MSGID : 46B6CF65.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46B6CF65.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; mingw:01 ocamlfind:01 mingw:01 ocaml:01 lib:01 developping:01 escapes:01 toplevel:01 pref:01 ocaml:01 ocamlfind:01 cygwin:01 mldonkey:01 mldonkey:01 cygwin:01 Hi, I can't answer your question on ocamlbuild but in order to install some modules under mingw+msys, I had to make ocamlfind work correctly under windows and learned a few things. > To do this, it must read filenames written with / in it, > but use filenames with \ replacing the /. I'd say this is > mandatory, so the same build control file will work on > all platforms. Then you need to document that Unix filenames > must be used, even on Windows. It seems mingw doesn't care that much as I've seen it use paths with mixed forward and backward slashes. For the paths, it handles both windows and unix paths. In mingw, I use paths such as these : /e/GNU/ocaml/lib But in the application I am developping (as a toy), I need real windows paths and there is no problem. You only have to change '\' to "\\" to avoid invalid escapes (though I prefer this to a valid one...). I've launched a toplevel and tried Unix.stat on some files: # Unix.stat "E:\\DocsAndSettings\\Administrateur\\.sancho\\sancho.pref";; - : Unix.stats = {Unix.st_dev = 4; Unix.st_ino = 0; Unix.st_kind = Unix.S_REG; Unix.st_perm = 438; Unix.st_nlink = 1; Unix.st_uid = 0; Unix.st_gid = 0; Unix.st_rdev = 4; Unix.st_size = 5640; Unix.st_atime = 1172179361.; Unix.st_mtime = 1172187293.; Unix.st_ctime = 1172179361.} # Unix.stat "E:\\DocsAndSettings\\Administrateur\\Application Data\\K-Meleon\\registry.dat";; - : Unix.stats = {Unix.st_dev = 4; Unix.st_ino = 0; Unix.st_kind = Unix.S_REG; Unix.st_perm = 438; Unix.st_nlink = 1; Unix.st_uid = 0; Unix.st_gid = 0; Unix.st_rdev = 4; Unix.st_size = 1181; Unix.st_atime = 1175886880.; Unix.st_mtime = 1186381757.; Unix.st_ctime = 1175886880.} > Note: although *Ocaml* basenames cannot have spaces in them, > the directories that contain them can. So Ocamlbuild must be > sure to quote all filenames, in case they have spaces. > This includes allowing quotes in the input specs. > Unix file systems allow spaces in filenames too, and many > modern Desktops will have 'folders' with spaces in > (if a 'doze or fruit user gets Ubuntu in their office). When making ocamlfind work under windows, on of the problems was with Filename.quote. In fact, not exactly but when I removed the calls to it, the problem disappeared. I tried to quote manually and realized it required one more quotation and I ended with several \"\". I think it would be better if Unix.command quoted on its own. > I warn this is a serious PITA if you're building Windows > *Native* code, but hosting the build on Cygwin, because > executables have to use Unix filenames but arguments have > to use Windows filenames, so you have to carefully keep > track of which tool is running what. I've been a mldonkey user for years and always wanted to compile mldonkey myself for windows. I've started with (pure, i.e. no mingw) Cygwin and everything built quickly. However I had a complete unix system inside my computer : hundreds of MBs used and most important tens of thousand of files which made everything slower. And then I got the problem with unix vs. windows filenames and when I saw it, it was a terrible mess. I later tried with mingw and it wasn't good at then. I tried again with mingw a few weeks ago and everything works. I know ocaml's documentation says mingw+msys doesn't work because of the limited command-line length of msys but this is untrue : the limitation comes from windows's cmd.exe which is etwa 2000 under windows 2000 but around 8000 for XP (see the very end of this page which is really great btw http://mldonkey.sourceforge.net/Windows ) In fact, what's so great with mingw is that you can use what has been coded for unix while keeping the windows features (see dev-cpp which is a C IDE on and for windows). > A serious nasty here is if you have to use silly names > on windows for the tools, eg building Felix: > > C:\Program Files (x86)\Ocaml\ocamlc > > and here the spaces, parentheses and C: drive > letter are mandatory and must be handled correctly > as a native filename. On Windows, Ocaml isn't necessarily > even in the path -- because on Windows XP64 I have multiple > Ocaml versions and I need to *specify* which one to use, > no accidents from PATH please! (Well actually, we do use > the PATH but it leads to a mess). Thanks to the wiki page spiralvoice made for mldonkey compilation under windows, I created a .profile file in msys's ~ with this: export PATH=/e/GNU/ocaml/bin:/e/GNU/ocaml/lib:$PATH export CAMLLIB=/e/GNU/ocaml/lib export OCAMLLIB=/e/GNU/ocaml/lib export CAMLP4LIB=/e/GNU/ocaml/lib/camlp4 And had not problem. Adding other entries solved another problem with ocamlfind as it relies on environment variables. OCaml's "make install" should update them itself. Btw, am I wrong thinking you use the MSVC port ? As a side note, if you are concerned about spaces on windows, you can rename "Program Files", "Documents And Settings" and move the Temp folder. Here I have "Programs", "DocsAndSettings" and temp is in "LocalSettings\Temp" (though "Local Settings" still exist ans is being used but at least by everything). You have to edit your windows CDs with a tool such as nlite (nliteos.com) (actually you can do it after windows installation but I wouldn't really advise it ;) ). --- Adrien Nader