From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id C0EAC81792 for ; Wed, 26 Jun 2013 20:29:48 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of adrien@notk.org) identity=pra; client-ip=91.121.71.147; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of adrien@notk.org designates 91.121.71.147 as permitted sender) identity=mailfrom; client-ip=91.121.71.147; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@nautica.notk.org) identity=helo; client-ip=91.121.71.147; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="postmaster@nautica.notk.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhUFABcyy1FbeUeT/2dsb2JhbABbgwmDF2m5A4J0gQMWdIIjAQEFI1YQCw4KAgIFEw4CAg8FGB0BE4glqD6RSIEmjiUHgk8zYQOXRAGRRYMTOoEsJA X-IPAS-Result: AhUFABcyy1FbeUeT/2dsb2JhbABbgwmDF2m5A4J0gQMWdIIjAQEFI1YQCw4KAgIFEw4CAg8FGB0BE4glqD6RSIEmjiUHgk8zYQOXRAGRRYMTOoEsJA X-IronPort-AV: E=Sophos;i="4.87,945,1363129200"; d="scan'208";a="19121181" Received: from nautica.notk.org ([91.121.71.147]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 26 Jun 2013 20:29:48 +0200 Received: by nautica.notk.org (Postfix, from userid 1003) id 8AFB5C009; Wed, 26 Jun 2013 20:29:47 +0200 (CEST) Date: Wed, 26 Jun 2013 20:29:47 +0200 From: Adrien Nader To: Gerd Stolpmann Cc: Bikal Gurung , caml-list@inria.fr Message-ID: <20130626182947.GC31557@notk.org> References: <20130624172105.GB32244@notk.org> <1372104978.3769.2@samsung> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1372104978.3769.2@samsung> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [Caml-list] Ocaml on windows On Mon, Jun 24, 2013, Gerd Stolpmann wrote: > Am 24.06.2013 19:21:05 schrieb(en) Adrien Nader: > >On Mon, Jun 24, 2013, Bikal Gurung wrote: > >> Hi, > >> > >> I am looking to use ocaml to implement a project for my > >employer. However, the > >> environment is Windows OS. I am using cygwin and so far it seems > >to work but > >> curious on experiences others have on using ocaml on windows - > >both as a > >> development and deployment platform. Also has anyone tried using > >opam on > >> windows? Does it work? > >> > > > >I believe opam on windows is pretty far away. > > > >The issues can be summarized in a few words: source-based package > >manager for ocaml on pure windows. > >For this to fully work, you need a perfect toolchain where everything > >works wonderfully. > > I can quickly report what I did to get GODI working on Windows. It > is of course not "pure Windows": You need Cygwin for doing builds, > but that's "only" because almost all build utilities are Unix-ish, > and it would be very hard to build anything without having some > shell and the usual file utilities at hand. (AFAIK the only build > utility that works in a pure Windows environment is omake.) > > So GODI assumes a mixed Windows environment, and this is in deed > doable. ocaml and all compiled code run on native Windows here, and > for executing build scripts there is Cygwin. This solves the utility > question, but you get in return some new problems, like the > different calling conventions. All GODI core utilities have e.g. > built-in support for translating Cygwin paths forth and back, so > they can operate on Cygwin paths although they are native Windows > programs. Another problem are the strange Windows rules for > splitting a command-line into words. As generic fallback when there > are too many "bad characters" in the command line I simply generate > a temporary script that is then executed with bash. There are > probably more such tricks I currently do not remember. > > So this mixed mode is actually doable, and works so well that many > GODI packages can be built on Windows without any special porting > effort. If you look at WODI, the special adaption of GODI for > Windows, you will mostly find additional C libraries (because you > cannot link against the libraries coming with Cygwin). > > We could go further and replace Cygwin completely only if we had a > substitute for the shell utilities. That's the core of the problem, > and it's a hard one, because many scripts assume 100% POSIX > behavior, and e.g. using Windows command-line conventions is out of > question. Yup, agreed, mixed is doable as WODI has proven. The most annoying constraint is probably that it slows down builds a lot and it makes frequent updates very painful (that makes source-based package managers far less attractive on windows [ note that on linux, I use and enjoy godi ]). That said, I've used ocaml on pure windows (besides bash for ocamlbuild). I was running everything from cmd.exe and it worked well. I had also built libraries which rely on oasis and it had gone well too. I believe that with a sufficiently full-featured build system, pure windows is doable and that's something which is probably fairly close. -- Adrien Nader