From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 0096C7FFE2 for ; Thu, 6 Oct 2016 20:56:46 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=info@gerd-stolpmann.de; spf=None smtp.mailfrom=info@gerd-stolpmann.de; spf=None smtp.helo=postmaster@mout.kundenserver.de Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.17.10; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.17.10; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.kundenserver.de) identity=helo; client-ip=212.227.17.10; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@mout.kundenserver.de"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3ATCb3TxVUo3NMKf7l3/NWACImk17V8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYZhOHt8tkgFKBZ4jH8fUM07OQ6PG6Hzdaqs/b7zhCKMUKDEBVz5?= =?us-ascii?q?1O3kQJO42sNw7SFLbSdSs0HcBPBhdO3kqQFgxrIvv4fEDYuXao7DQfSV3VPAtx?= =?us-ascii?q?IfnpSMaJ15zkn8j7wZDYYh1JiTyhevsyaUzu9USC/vUR1KlvMKs0yxaBjnpNeu?= =?us-ascii?q?JRjTdqKVOWnhD7zsW5+pN47z5dtu5n/MlFB+GyNZ8/QLNEFjM+dygQ5cbrvBTH?= =?us-ascii?q?B0Pb43oXUmwbllxTBAXK8Av9Rr/wtDf3sqx23yzMbuPsSrVhdjm44+9QVBjskC?= =?us-ascii?q?IOMThxpGDRhMtYg69BrFe6uxt724vdZofTOPcoLfCVRs8TWWcUBpUZbCdGGI7p?= =?us-ascii?q?KtJXV+c=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0A5AACknfZXhwoR49RcHAEBBAEBCgEBF?= =?us-ascii?q?wYMgxQBAQEBAXV8jTKXAJQsggsihX4CgXQ4FAEBAQEBAQEBAQEBEgEBAQgNCQk?= =?us-ascii?q?ZL4IyBAEVAQSCEAEBAQMBIyYMJBALDgoqAgJJAQ0GEwkLB4grDAEJsieMbQEBA?= =?us-ascii?q?QEBBQEBAQEBARMPhUGFUIRTgkA4glsFiDuFf4tFgUAChGaTOIYPjHeDfx6BAYJ?= =?us-ascii?q?8gWBwAYZ+gUEBAQE?= X-IPAS-Result: =?us-ascii?q?A0A5AACknfZXhwoR49RcHAEBBAEBCgEBFwYMgxQBAQEBAXV?= =?us-ascii?q?8jTKXAJQsggsihX4CgXQ4FAEBAQEBAQEBAQEBEgEBAQgNCQkZL4IyBAEVAQSCE?= =?us-ascii?q?AEBAQMBIyYMJBALDgoqAgJJAQ0GEwkLB4grDAEJsieMbQEBAQEBBQEBAQEBARM?= =?us-ascii?q?PhUGFUIRTgkA4glsFiDuFf4tFgUAChGaTOIYPjHeDfx6BAYJ8gWBwAYZ+gUEBA?= =?us-ascii?q?QE?= X-IronPort-AV: E=Sophos;i="5.31,454,1473112800"; d="asc'?scan'208";a="239725992" Received: from mout.kundenserver.de ([212.227.17.10]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Oct 2016 20:56:45 +0200 Received: from office1.lan.sumadev.de ([85.183.69.161]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0M9Gk2-1bjzaA2Sz8-00CejZ; Thu, 06 Oct 2016 20:56:16 +0200 Received: from e130 (unknown [192.168.65.10]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id 6779EDC05D; Thu, 6 Oct 2016 20:56:15 +0200 (CEST) Message-ID: <1475780165.16332.8.camel@gerd-stolpmann.de> From: Gerd Stolpmann To: Jeremie Dimino , "Soegtrop, Michael" Cc: "caml-list@inria.fr" Date: Thu, 06 Oct 2016 20:56:05 +0200 In-Reply-To: References: <0F7D3B1B3C4B894D824F5B822E3E5A172CF8E1BA@IRSMSX102.ger.corp.intel.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-NQmCOEOzHwqXrjqDiRkZ" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 X-Provags-ID: V03:K0:ch6fHE+E4Ninf1EV8dpKgcZwzDsVFUIdknPGOXfr/Vg8MBT3P7J PEOH422oCAM+GRWdQyInwUL7rpYoSzaVaBEMDcZpQk9ElxQSzbvFOARJYQXFqeDvf1iv1BU vFT0fjVn0RbaqQbY8vt964rjzi8oqoFxaCAi2pinCxY1cS/T7v+tnZGs5EsKi4G878uUTNO jJcvMixmAtRF1WvoTRrDQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:5sCP9uHCjzs=:+uOpmyh3cO3AbpuAyU0rlX GSOH2EKsQ3i5ZRl0RKPL1RGfOak4neOdBga1QP6yLQTDPienO81N5Bo9L2nI1HK8HRTslK0BX 0w53YmGJJeH3KbT8OczCCe5+csT7ifPqWz0ehUJeO79sOLVJcmTfIoV8S/cN804AWLLGPSw+m 2PdmHzMNYwAb7RASW+A4H9aaa4K4jhPqEY0jda3gUBmMfbaYLrYBUTetnhxigsfoMd1WaSCoT Co7zFNwSUS+0RZpcALpMU2g+bWlMhYZJR/ZA9G4TBRd9DlLNr3l03ko0NiRSGjOz3mhCjCd61 3MT+wnANkUn9FGTh8nNNeh2+QU1xnW6NFOyJLGac80gkA/aokxxbYrFSuCkoXUcx1v/b7hOSk bHvr9KsfFKZMXCNqMnCwFrJn3rgF08COkpiOWYk3YwadzkoKpTRzkzBIvvaTTkFPakbgE2dhF 9BhP9DjQnr8kJTbz8qt7jzEXqCv1QsE0rPHWIU68v5DeZY3pYbvo+DunxI1TaWkCKwD8+1KJb Oj55TJbL0161yOj84tIQ9Wk3fVKEcq4pbPlrZs8/Bszkp+pqGJNXwN0e1UHjQ7inEX0IqW/jO pEyzb4cDgZcp5gsMf7JzuxtxVuNpE99ZofXS8OGWb6dpPREPbK9F3ZthRbLXooJ6B0wK2B5Lw IjsMjjxsizxpmxoO/bQAvmDdQsjWXqPh1TuyrEv7nPA6UlWXE2WH0KGjGFZ8DM6pUCHU= Subject: Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd --=-NQmCOEOzHwqXrjqDiRkZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable This is also what omake does. Pipes, redirections, and even a number of commands like rm, cp, ls are completely implemented inside omake, so that everything works on Unix and Windows the same. I guess this is the only way to get to a uniform build system, at least if you don't want to depend on 3rd-party tools like Cygwin. Gerd Am Donnerstag, den 06.10.2016, 18:45 +0100 schrieb Jeremie Dimino: > I don't have an opinion on using cmd in ocamlbuild, but I have been > looking at similar things for jenga recently. With jenga the actions > generated by the rules are of the form (prog, args) and when one > wants > to to do something more complicated, they have to manually build a > shell command. In the Jane Street rules we are using bash. >=20 > Going through bash is often frustrating, even on Unix. Moreover for > the public release of Jane Street packages I'd like to avoid relying > too much on bash as it has often been a source of problems in the > past. >=20 > The solution I'm aimed at is to have the jenga rules produce actions > using a small DSL allowing pipes and other things and interpret this > DSL without the use of a third-party shell, i.e. just using system > calls and threads. >=20 > It's still a work in progress but I already have the backend part > working [1]. It's aimed at being portable on Windows. The code for > Windows is written but not yet tested, I plan to do it at some point. >=20 > I imagine that it shouldn't be too use this in ocamlbuild if the [Sh] > constructor was removed and replaced by a few other constructors to > express pipes, redirections, etc... >=20 > =C2=A0 [1] https://github.com/janestreet/shexp >=20 > On Thu, Oct 6, 2016 at 2:38 PM, Soegtrop, Michael > wrote: > >=20 > > Dear OCaml users and developers, > >=20 > >=20 > >=20 > > I looked into the fact that ocamlbuild requires bash/cygwin to run. > > Actually > > it does very little use of bash and I think cmd + ln + rm would > > work quite > > well. > >=20 > >=20 > >=20 > > From comments in various list I understood that people had issues > > with > > escaping for cmd. I agree that this is a bit nasty, but not rocket > > science > > either. I guess the main issue is that for cmd not only space and > > tab are > > command argument separators, but also equal (=3D), comma (,) and > > semicolon > > (;). So for cmd a=3Db,c;d is the same as a b c d which is the same as > > a , =3D , > > b =3D;=3D c=3D=3Dd. Essentially cmd treats unquoted pieces as sed =E2= =80=98s/[\t > > =3D,;]+/ /g=E2=80=99. > > If a name contains any of these characters, one has to quote it for > > cmd, but > > not for bash. Since =3D and , are not that uncommon in file names, I > > guess > > this resulted in issues. > >=20 > >=20 > >=20 > > BUT cmd splits the command line only into command names, complete > > argument > > lists and file names for redirection. That is if you call e.g. > > ocamlc, cmd > > just replaces shell variables and extracts the executable name, but > > does not > > split up the argument list into individual pieces. bash on Windows > > does this > > neither, because (afaik) Windows has at the lowest level no > > mechanism to > > pass individual arguments to an executable. The command gets a > > string and > > splitting this string and even globing is the business of the > > executable. So > > it is rather odd that this behaves substantially different for bash > > and for > > cmd. The only thing which needs to be quoted properly are command > > names and > > file names of redirections. > >=20 > >=20 > >=20 > > There might be issue with shell special characters. There are those > > which > > are not allowed in file names =E2=80=9C\/:*?<>| and those allowed in > > filenames &(). > > I guess those not allowed in filenames don=E2=80=99t need any special > > treatment, > > since one can=E2=80=99t do that much with them except their special she= ll > > use. The > > other 3 one should be escape with ^. There is no way to quote shell > > special > > characters with cmd =E2=80=93 they must be escaped with ^. > >=20 > >=20 > >=20 > > The only real issue is that some people seem to use build rules > > with =E2=80=9Creal=E2=80=9D > > bash stuff in it =E2=80=93 well if you do this I guess you anyway have a > > cygwin > > around. > >=20 > >=20 > >=20 > > So I wonder if it would be appreciated by the community to have an > > ocamlbuild (e.g. as a configure option) which uses cmd instead of > > bash. I > > think if one does the escaping properly, this should be good for > > the large > > majority of projects out there. > >=20 > >=20 > >=20 > > Ocamlc seems to run fine without cygwin, but I didn=E2=80=99t test other > > tools like > > ocamllex or menhir as yet. Are there known issues? > >=20 > >=20 > >=20 > > Best regards, > >=20 > >=20 > >=20 > > Michael > >=20 > >=20 > >=20 > >=20 > >=20 > > Intel Deutschland GmbH > > Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany > > Tel: +49 89 99 8853-0, www.intel.de > > Managing Directors: Christin Eisenschmid, Christian Lamprechter > > Chairperson of the Supervisory Board: Nicole Lau > > Registered Office: Munich > > Commercial Register: Amtsgericht Muenchen HRB 186928 >=20 >=20 > --=C2=A0 > Jeremie >=20 --=20 ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------ --=-NQmCOEOzHwqXrjqDiRkZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJX9p5FAAoJEAaM4b9ZLB5ThxMH/juGBALFLjNNT/v6d2ZMahMO PUw47IBdNewhD6OEKGIcgNWEzxvOb/h2esw5HSzZSye+ggP0/uVdg8XWA+lDjoa8 mucq80Kf6OApjYQdl4hz/jEMO6dculzpneLQiSxXPYGDwTKqBIwj3Bmf+scC2Lza 4Ri5Z9CjMiPPKmOFbZzy+Iu7s1MzY9lQ6hpsuWiOEGeL0icrMlOm8deTRtyA6raL XgSX7D33BdbtIuOX0qmPtX3WDUL8wTs/2uE+0R7ksvF0Zw5EQlEPlcxdPnKW2Zyd AC/XlYZjU5JYOpE5kRGXD4+PXZ1RHJMVP1SgB2O891BGfbUClrkpb5NMTLF8U4I= =1GXw -----END PGP SIGNATURE----- --=-NQmCOEOzHwqXrjqDiRkZ--