caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ocamlbuild on Windows and bash vs. cmd
@ 2016-10-06 13:38 Soegtrop, Michael
  2016-10-06 13:45 ` Kakadu
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Soegtrop, Michael @ 2016-10-06 13:38 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 2851 bytes --]

Dear OCaml users and developers,

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.

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 (=), comma (,) and semicolon (;). So for cmd a=b,c;d is the same as a b c d which is the same as a , = , b =;= c==d. Essentially cmd treats unquoted pieces as sed 's/[\t =,;]+/ /g'. If a name contains any of these characters, one has to quote it for cmd, but not for bash. Since = and , are not that uncommon in file names, I guess this resulted in issues.

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.

There might be issue with shell special characters. There are those which are not allowed in file names "\/:*?<>| and those allowed in filenames &(). I guess those not allowed in filenames don't need any special treatment, since one can't do that much with them except their special shell use. The other 3 one should be escape with ^. There is no way to quote shell special characters with cmd - they must be escaped with ^.

The only real issue is that some people seem to use build rules with "real" bash stuff in it - well if you do this I guess you anyway have a cygwin around.

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.

Ocamlc seems to run fine without cygwin, but I didn't test other tools like ocamllex or menhir as yet. Are there known issues?

Best regards,

Michael


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

[-- Attachment #2: Type: text/html, Size: 5384 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-06 13:38 [Caml-list] ocamlbuild on Windows and bash vs. cmd Soegtrop, Michael
@ 2016-10-06 13:45 ` Kakadu
  2016-10-06 14:01   ` Soegtrop, Michael
  2016-10-06 13:55 ` Daniel Bünzli
  2016-10-06 17:45 ` Jeremie Dimino
  2 siblings, 1 reply; 23+ messages in thread
From: Kakadu @ 2016-10-06 13:45 UTC (permalink / raw)
  To: Soegtrop, Michael; +Cc: caml-list

Will the powershell be more convenient?

Happy hacking,
Kakadu

On Thu, Oct 6, 2016 at 4:38 PM, Soegtrop, Michael
<michael.soegtrop@intel.com> wrote:
> Dear OCaml users and developers,
>
>
>
> 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.
>
>
>
> 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 (=), comma (,) and semicolon
> (;). So for cmd a=b,c;d is the same as a b c d which is the same as a , = ,
> b =;= c==d. Essentially cmd treats unquoted pieces as sed ‘s/[\t =,;]+/ /g’.
> If a name contains any of these characters, one has to quote it for cmd, but
> not for bash. Since = and , are not that uncommon in file names, I guess
> this resulted in issues.
>
>
>
> 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.
>
>
>
> There might be issue with shell special characters. There are those which
> are not allowed in file names “\/:*?<>| and those allowed in filenames &().
> I guess those not allowed in filenames don’t need any special treatment,
> since one can’t do that much with them except their special shell use. The
> other 3 one should be escape with ^. There is no way to quote shell special
> characters with cmd – they must be escaped with ^.
>
>
>
> The only real issue is that some people seem to use build rules with “real”
> bash stuff in it – well if you do this I guess you anyway have a cygwin
> around.
>
>
>
> 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.
>
>
>
> Ocamlc seems to run fine without cygwin, but I didn’t test other tools like
> ocamllex or menhir as yet. Are there known issues?
>
>
>
> Best regards,
>
>
>
> Michael
>
>
>
>
>
> 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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-06 13:38 [Caml-list] ocamlbuild on Windows and bash vs. cmd Soegtrop, Michael
  2016-10-06 13:45 ` Kakadu
@ 2016-10-06 13:55 ` Daniel Bünzli
  2016-10-06 14:15   ` Soegtrop, Michael
  2016-10-06 17:45 ` Jeremie Dimino
  2 siblings, 1 reply; 23+ messages in thread
From: Daniel Bünzli @ 2016-10-06 13:55 UTC (permalink / raw)
  To: Soegtrop, Michael; +Cc: caml-list

On Thursday 6 October 2016 at 15:38, Soegtrop, Michael wrote:
> 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.

See https://github.com/ocaml/ocamlbuild/issues/64

Best, 

Daniel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-06 13:45 ` Kakadu
@ 2016-10-06 14:01   ` Soegtrop, Michael
  0 siblings, 0 replies; 23+ messages in thread
From: Soegtrop, Michael @ 2016-10-06 14:01 UTC (permalink / raw)
  To: Kakadu; +Cc: caml-list

Dear Kakadu,

> Will the powershell be more convenient?

I don't think so. It is different from bash and as long as it is different, it doesn't make much of a difference how different. ocamlbuild (as far as I can tell) wraps all commands through as shell / syscall. 99% is really simple stuff like calling an executable with a reasonable parameter list or calling ln or rm. Output redirection happens (e.g. for ocamldep), but nothing complicated.

I think it only get's bad when users have bash code in their rules - but then you are lost anyway without bash.

So I would say keep it simple and give cmd a try. It should work unless people do things like filenames with <|> in it.

best regards,

Michael
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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-06 13:55 ` Daniel Bünzli
@ 2016-10-06 14:15   ` Soegtrop, Michael
  2016-10-06 14:45     ` Gabriel Scherer
  0 siblings, 1 reply; 23+ messages in thread
From: Soegtrop, Michael @ 2016-10-06 14:15 UTC (permalink / raw)
  To: Daniel Bünzli; +Cc: caml-list

Dear Daniel,

> See https://github.com/ocaml/ocamlbuild/issues/64

yes, I have seen the discussion, especially the discussion if one should use cmd vs. removing the use of a shell by ocamlbuild entirely. I agree that the latter would be the better solution, but it would be a major change since currently ocamlbuild wraps everything through string commands. But maybe it is not as bad as it looks.

And I take this as a "yes" on the question if something like this would be appreciated by the community.

I am a bit in a hurry to get something working for Coq 8.6. I guess I first make a cmd based hack for Coq and then look into the real solution.

I will continue the discussion on the ocamlbuild issue tracker item linked above.

Best regards,

Michael
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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-06 14:15   ` Soegtrop, Michael
@ 2016-10-06 14:45     ` Gabriel Scherer
  2016-10-06 16:16       ` Soegtrop, Michael
  0 siblings, 1 reply; 23+ messages in thread
From: Gabriel Scherer @ 2016-10-06 14:45 UTC (permalink / raw)
  To: Soegtrop, Michael; +Cc: Daniel Bünzli, caml-list

[-- Attachment #1: Type: text/plain, Size: 3010 bytes --]

> And I take this as a "yes" on the question if something like this would
be appreciated by the community.

This is my impression as well, and I would personally warmly welcome
changes to improve Windows users experience -- I think of ocamlbuild as a
portable build system, and I would like to work out of the box; I don't
think there are any fundamental design limitations that would prevent this
good portability experience.


One difficulty right now in term of development dynamics is that I don't
have a Windows machine to test on myself, so I'm rather conservative
regarding Windows-related changes to avoid regressions for non-Windows user
(it's not necessarily easy to predict which changes risk breaking stuff),
or even regressions for other Windows users (some of the non-intuitive
Windows-related code is there because otherwise stuff breaks for some
people). Sometimes Windows developers make a certain amount of changes that
look right to them and fix actual problems on their system, but then it's
hard for me to see what can be safely integrated (see for example
https://github.com/ocaml/ocamlbuild/pull/70 , whose low-hanging fruits I
could merge quickly, but for the rest I worry of regressions ).

To solve that problem we need a better testing infrastructure for
ocamlbuild, but also get more tests from Windows users to provide feedback
on other approaches or patches reworks, etc. If someone, for example you,
is willing to start a more persistent approach of iterative improvements
and tests, I think that things could improve rather quickly.

On Thu, Oct 6, 2016 at 10:15 AM, Soegtrop, Michael <
michael.soegtrop@intel.com> wrote:

> Dear Daniel,
>
> > See https://github.com/ocaml/ocamlbuild/issues/64
>
> yes, I have seen the discussion, especially the discussion if one should
> use cmd vs. removing the use of a shell by ocamlbuild entirely. I agree
> that the latter would be the better solution, but it would be a major
> change since currently ocamlbuild wraps everything through string commands.
> But maybe it is not as bad as it looks.
>
> And I take this as a "yes" on the question if something like this would be
> appreciated by the community.
>
> I am a bit in a hurry to get something working for Coq 8.6. I guess I
> first make a cmd based hack for Coq and then look into the real solution.
>
> I will continue the discussion on the ocamlbuild issue tracker item linked
> above.
>
> Best regards,
>
> Michael
> 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
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 4242 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-06 14:45     ` Gabriel Scherer
@ 2016-10-06 16:16       ` Soegtrop, Michael
  0 siblings, 0 replies; 23+ messages in thread
From: Soegtrop, Michael @ 2016-10-06 16:16 UTC (permalink / raw)
  To: Gabriel Scherer; +Cc: Daniel Bünzli, caml-list

[-- Attachment #1: Type: text/plain, Size: 2672 bytes --]

Dear Gabriel,

To solve that problem we need a better testing infrastructure for ocamlbuild, but also get more tests from Windows users to provide feedback on other approaches or patches reworks, etc. If someone, for example you, is willing to start a more persistent approach of iterative improvements and tests, I think that things could improve rather quickly.

well I am using ocamlbuild daily on Windows, currently with MinGW cross OCaml on cygwin, but I would like to switch to a native MinGW solution. I cannot make any long term promises, but at least for a midterm transitional period (say 6 months), I have no issue to run a test suite every week on plain Windows, on plain Cygwin, on MinGW cross on Cygwin and also on Linux.

Also I have scripts which fully automate setup and test of plain MinGW, MinGW cross on Cygwin and plain Cygwin OCaml. That is you start a batch file, and it will install a fresh cygwin and start a bash script which downloads and compiles the respective flavor of OCaml and run some tests with 0 user interaction. If this helps, I would be happy to tailor these scripts to whatever automation systems you have and contribute them.

Privately I am using Amazon AWS (that is rental of datacenter infrastructure of Amazon’s own datacenters) quite a bit. If the OCamlbuild community has issues with setting up a reliable multi-platform server infrastructure, this might be an effective and very low cost solution. You get virtual Windows and Linux servers with root access and customizable specs (memory, CPU). The good thing is that you pay for the servers only when they run. I think you would have to test quite a lot to get a bill of more than 5$ a month, likely it will be around 1$. If this is something we want to look into, I would pay the bill privately for 2 years (up to 100€). One can integrate such systems easily with other systems, e.g. you do some signed http post with a script, which triggers a process on an Amazon lambda server, which boots up the real servers which then runs the tests, post the results on some web storage and shut down again. I really love this stuff ;-)

An interesting question is how many “obscure” test cases for ocamlbuild we can get. My own projects use Menhir, Ocamllex and a few non-standard libraries, so at least this would run.

Best regards,

Michael
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

[-- Attachment #2: Type: text/html, Size: 6557 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-06 13:38 [Caml-list] ocamlbuild on Windows and bash vs. cmd Soegtrop, Michael
  2016-10-06 13:45 ` Kakadu
  2016-10-06 13:55 ` Daniel Bünzli
@ 2016-10-06 17:45 ` Jeremie Dimino
  2016-10-06 18:56   ` Gerd Stolpmann
  2 siblings, 1 reply; 23+ messages in thread
From: Jeremie Dimino @ 2016-10-06 17:45 UTC (permalink / raw)
  To: Soegtrop, Michael; +Cc: caml-list

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.

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.

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.

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.

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...

  [1] https://github.com/janestreet/shexp

On Thu, Oct 6, 2016 at 2:38 PM, Soegtrop, Michael
<michael.soegtrop@intel.com> wrote:
> Dear OCaml users and developers,
>
>
>
> 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.
>
>
>
> 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 (=), comma (,) and semicolon
> (;). So for cmd a=b,c;d is the same as a b c d which is the same as a , = ,
> b =;= c==d. Essentially cmd treats unquoted pieces as sed ‘s/[\t =,;]+/ /g’.
> If a name contains any of these characters, one has to quote it for cmd, but
> not for bash. Since = and , are not that uncommon in file names, I guess
> this resulted in issues.
>
>
>
> 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.
>
>
>
> There might be issue with shell special characters. There are those which
> are not allowed in file names “\/:*?<>| and those allowed in filenames &().
> I guess those not allowed in filenames don’t need any special treatment,
> since one can’t do that much with them except their special shell use. The
> other 3 one should be escape with ^. There is no way to quote shell special
> characters with cmd – they must be escaped with ^.
>
>
>
> The only real issue is that some people seem to use build rules with “real”
> bash stuff in it – well if you do this I guess you anyway have a cygwin
> around.
>
>
>
> 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.
>
>
>
> Ocamlc seems to run fine without cygwin, but I didn’t test other tools like
> ocamllex or menhir as yet. Are there known issues?
>
>
>
> Best regards,
>
>
>
> Michael
>
>
>
>
>
> 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



-- 
Jeremie

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-06 17:45 ` Jeremie Dimino
@ 2016-10-06 18:56   ` Gerd Stolpmann
  2016-10-07  6:58     ` Soegtrop, Michael
  0 siblings, 1 reply; 23+ messages in thread
From: Gerd Stolpmann @ 2016-10-06 18:56 UTC (permalink / raw)
  To: Jeremie Dimino, Soegtrop, Michael; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 5575 bytes --]

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.
> 
> 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.
> 
> 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.
> 
> 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.
> 
> 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...
> 
>   [1] https://github.com/janestreet/shexp
> 
> On Thu, Oct 6, 2016 at 2:38 PM, Soegtrop, Michael
> <michael.soegtrop@intel.com> wrote:
> > 
> > Dear OCaml users and developers,
> > 
> > 
> > 
> > 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.
> > 
> > 
> > 
> > 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 (=), comma (,) and
> > semicolon
> > (;). So for cmd a=b,c;d is the same as a b c d which is the same as
> > a , = ,
> > b =;= c==d. Essentially cmd treats unquoted pieces as sed ‘s/[\t
> > =,;]+/ /g’.
> > If a name contains any of these characters, one has to quote it for
> > cmd, but
> > not for bash. Since = and , are not that uncommon in file names, I
> > guess
> > this resulted in issues.
> > 
> > 
> > 
> > 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.
> > 
> > 
> > 
> > There might be issue with shell special characters. There are those
> > which
> > are not allowed in file names “\/:*?<>| and those allowed in
> > filenames &().
> > I guess those not allowed in filenames don’t need any special
> > treatment,
> > since one can’t do that much with them except their special shell
> > use. The
> > other 3 one should be escape with ^. There is no way to quote shell
> > special
> > characters with cmd – they must be escaped with ^.
> > 
> > 
> > 
> > The only real issue is that some people seem to use build rules
> > with “real”
> > bash stuff in it – well if you do this I guess you anyway have a
> > cygwin
> > around.
> > 
> > 
> > 
> > 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.
> > 
> > 
> > 
> > Ocamlc seems to run fine without cygwin, but I didn’t test other
> > tools like
> > ocamllex or menhir as yet. Are there known issues?
> > 
> > 
> > 
> > Best regards,
> > 
> > 
> > 
> > Michael
> > 
> > 
> > 
> > 
> > 
> > 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
> 
> 
> -- 
> Jeremie
> 
-- 
------------------------------------------------------------
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
------------------------------------------------------------



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-06 18:56   ` Gerd Stolpmann
@ 2016-10-07  6:58     ` Soegtrop, Michael
  2016-10-07 16:19       ` Yaron Minsky
  0 siblings, 1 reply; 23+ messages in thread
From: Soegtrop, Michael @ 2016-10-07  6:58 UTC (permalink / raw)
  To: Gerd Stolpmann, Jeremie Dimino; +Cc: caml-list

Dear Gerd, Jeremie,

I agree, something like a very simple shell which gets its commands and redirections described as some sort of AST is likely the easiest to port and most robust solution.

I will look into Jeremie's development and omake and see if it is from a technical and licensing point of view reusable for ocamlbuild.

Best Regards,

Michael

> -----Original Message-----
> From: Gerd Stolpmann [mailto:info@gerd-stolpmann.de]
> Sent: Thursday, October 06, 2016 8:56 PM
> To: Jeremie Dimino; Soegtrop, Michael
> Cc: caml-list@inria.fr
> Subject: Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
> 
> 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.
> >
> > 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.
> >
> > 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.
> >
> > 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.
> >
> > 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...
> >
> >   [1] https://github.com/janestreet/shexp
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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-07  6:58     ` Soegtrop, Michael
@ 2016-10-07 16:19       ` Yaron Minsky
  2016-10-11 11:49         ` Soegtrop, Michael
  0 siblings, 1 reply; 23+ messages in thread
From: Yaron Minsky @ 2016-10-07 16:19 UTC (permalink / raw)
  To: Soegtrop, Michael; +Cc: Gerd Stolpmann, Jeremie Dimino, caml-list

[-- Attachment #1: Type: text/plain, Size: 3254 bytes --]

I very much hope the licensing isn't an issue. We purposely picked a very
liberal license to make this kind of thing as easy as possible. Do tell us
if you find an issue there.

y

On Fri, Oct 7, 2016 at 8:58 AM, Soegtrop, Michael <
michael.soegtrop@intel.com> wrote:

> Dear Gerd, Jeremie,
>
> I agree, something like a very simple shell which gets its commands and
> redirections described as some sort of AST is likely the easiest to port
> and most robust solution.
>
> I will look into Jeremie's development and omake and see if it is from a
> technical and licensing point of view reusable for ocamlbuild.
>
> Best Regards,
>
> Michael
>
> > -----Original Message-----
> > From: Gerd Stolpmann [mailto:info@gerd-stolpmann.de]
> > Sent: Thursday, October 06, 2016 8:56 PM
> > To: Jeremie Dimino; Soegtrop, Michael
> > Cc: caml-list@inria.fr
> > Subject: Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
> >
> > 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.
> > >
> > > 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.
> > >
> > > 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.
> > >
> > > 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.
> > >
> > > 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...
> > >
> > >   [1] https://github.com/janestreet/shexp
> 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
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 4713 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-07 16:19       ` Yaron Minsky
@ 2016-10-11 11:49         ` Soegtrop, Michael
  2016-10-11 12:36           ` Yaron Minsky
  0 siblings, 1 reply; 23+ messages in thread
From: Soegtrop, Michael @ 2016-10-11 11:49 UTC (permalink / raw)
  To: Yaron Minsky; +Cc: Gerd Stolpmann, Jeremie Dimino, caml-list

[-- Attachment #1: Type: text/plain, Size: 1665 bytes --]

Dear Yaron,

> I very much hope the licensing isn't an issue. We purposely picked a very liberal license to make this kind of thing as easy as possible. Do tell us if you find an issue there.

it is hard to believe, but the licensing is an issue. According to this reference from Apache:

https://www.apache.org/licenses/GPL-compatibility.html

citation:

“Despite our best efforts, the FSF has never considered the Apache License to be compatible with GPL version 2, citing the patent termination and indemnification provisions as restrictions not present in the older GPL license.”

the apache license you use is not compatible with GPL2. Since the OCaml library is LGPL 2.1, it cannot include Apache licensed code. The patent issue mentioned above has nothing to do with the difference between GPL and LGPL, so my guess would be that this also applies to LGPL 2.X.

Please note that the above reference states that Apache is compatible with GPL 3, but I guess you can write a PhD thesis in law and/or computer science about the topic if it is better to have GPL 2.x+ or GPL 3+Apache.

If you think it is worthwhile, I can ask one of our open source lawyers for advice, but I think the above statement from Apache is fairly clear.

So as it looks, I have to rewrite from scratch what I need - sigh

Best regards,

Michael
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

[-- Attachment #2: Type: text/html, Size: 7042 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-11 11:49         ` Soegtrop, Michael
@ 2016-10-11 12:36           ` Yaron Minsky
  2016-10-11 13:00             ` Ivan Gotovchits
  2016-10-11 13:46             ` Soegtrop, Michael
  0 siblings, 2 replies; 23+ messages in thread
From: Yaron Minsky @ 2016-10-11 12:36 UTC (permalink / raw)
  To: Soegtrop, Michael; +Cc: Gerd Stolpmann, Jeremie Dimino, caml-list

You have got to be kidding me.

Maybe we can dual license? It would be lovely to avoid the rewrite.
What license would be adequate? Maybe we can license everything under
LGPLv2+exception and Apache?

I hate licenses.

y

On Tue, Oct 11, 2016 at 7:49 AM, Soegtrop, Michael
<michael.soegtrop@intel.com> wrote:
> Dear Yaron,
>
>
>
>> I very much hope the licensing isn't an issue. We purposely picked a very
>> liberal license to make this kind of thing as easy as possible. Do tell us
>> if you find an issue there.
>
>
>
> it is hard to believe, but the licensing is an issue. According to this
> reference from Apache:
>
>
>
> https://www.apache.org/licenses/GPL-compatibility.html
>
>
>
> citation:
>
>
>
> “Despite our best efforts, the FSF has never considered the Apache License
> to be compatible with GPL version 2, citing the patent termination and
> indemnification provisions as restrictions not present in the older GPL
> license.”
>
>
>
> the apache license you use is not compatible with GPL2. Since the OCaml
> library is LGPL 2.1, it cannot include Apache licensed code. The patent
> issue mentioned above has nothing to do with the difference between GPL and
> LGPL, so my guess would be that this also applies to LGPL 2.X.
>
>
>
> Please note that the above reference states that Apache is compatible with
> GPL 3, but I guess you can write a PhD thesis in law and/or computer science
> about the topic if it is better to have GPL 2.x+ or GPL 3+Apache.
>
>
>
> If you think it is worthwhile, I can ask one of our open source lawyers for
> advice, but I think the above statement from Apache is fairly clear.
>
>
>
> So as it looks, I have to rewrite from scratch what I need - sigh
>
>
>
> Best regards,
>
>
>
> Michael
>
> 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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-11 12:36           ` Yaron Minsky
@ 2016-10-11 13:00             ` Ivan Gotovchits
  2016-10-11 13:06               ` Anil Madhavapeddy
  2016-10-11 13:46             ` Soegtrop, Michael
  1 sibling, 1 reply; 23+ messages in thread
From: Ivan Gotovchits @ 2016-10-11 13:00 UTC (permalink / raw)
  To: Yaron Minsky; +Cc: Soegtrop, Michael, Gerd Stolpmann, Jeremie Dimino, caml-list

[-- Attachment #1: Type: text/plain, Size: 3126 bytes --]

Hi Yaron,

Given that most of the Janestreet codebase is developed in-house, it might
be not that hard to relicense it. This is especially true for `shexp` that
currently
has only one contributor. I would suggest switching to ISC or MIT (aka X11,
aka Expat) licenses. Probably the former should be preferred, as it is
shorter and cleaner.
The full list of licenses compatible with GPL is here [1].

Regards,
Ivan

[1]: https://www.gnu.org/licenses/license-list.en.html

On Tue, Oct 11, 2016 at 8:36 AM, Yaron Minsky <yminsky@janestreet.com>
wrote:

> You have got to be kidding me.
>
> Maybe we can dual license? It would be lovely to avoid the rewrite.
> What license would be adequate? Maybe we can license everything under
> LGPLv2+exception and Apache?
>
> I hate licenses.
>
> y
>
> On Tue, Oct 11, 2016 at 7:49 AM, Soegtrop, Michael
> <michael.soegtrop@intel.com> wrote:
> > Dear Yaron,
> >
> >
> >
> >> I very much hope the licensing isn't an issue. We purposely picked a
> very
> >> liberal license to make this kind of thing as easy as possible. Do tell
> us
> >> if you find an issue there.
> >
> >
> >
> > it is hard to believe, but the licensing is an issue. According to this
> > reference from Apache:
> >
> >
> >
> > https://www.apache.org/licenses/GPL-compatibility.html
> >
> >
> >
> > citation:
> >
> >
> >
> > “Despite our best efforts, the FSF has never considered the Apache
> License
> > to be compatible with GPL version 2, citing the patent termination and
> > indemnification provisions as restrictions not present in the older GPL
> > license.”
> >
> >
> >
> > the apache license you use is not compatible with GPL2. Since the OCaml
> > library is LGPL 2.1, it cannot include Apache licensed code. The patent
> > issue mentioned above has nothing to do with the difference between GPL
> and
> > LGPL, so my guess would be that this also applies to LGPL 2.X.
> >
> >
> >
> > Please note that the above reference states that Apache is compatible
> with
> > GPL 3, but I guess you can write a PhD thesis in law and/or computer
> science
> > about the topic if it is better to have GPL 2.x+ or GPL 3+Apache.
> >
> >
> >
> > If you think it is worthwhile, I can ask one of our open source lawyers
> for
> > advice, but I think the above statement from Apache is fairly clear.
> >
> >
> >
> > So as it looks, I have to rewrite from scratch what I need - sigh
> >
> >
> >
> > Best regards,
> >
> >
> >
> > Michael
> >
> > 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
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 4596 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-11 13:00             ` Ivan Gotovchits
@ 2016-10-11 13:06               ` Anil Madhavapeddy
  2016-10-11 13:13                 ` Yaron Minsky
  0 siblings, 1 reply; 23+ messages in thread
From: Anil Madhavapeddy @ 2016-10-11 13:06 UTC (permalink / raw)
  To: Ivan Gotovchits
  Cc: Yaron Minsky, Soegtrop, Michael, Gerd Stolpmann, Jeremie Dimino,
	caml-list

The standard MirageOS license for our libraries is ISC, which is short and simple (and the standard license used for new code in OpenBSD):

https://github.com/mirage/mirage/blob/master/LICENSE.md

regards,
Anil

> On 11 Oct 2016, at 14:00, Ivan Gotovchits <ivg@ieee.org> wrote:
> 
> Hi Yaron,
> 
> Given that most of the Janestreet codebase is developed in-house, it might be not that hard to relicense it. This is especially true for `shexp` that currently 
> has only one contributor. I would suggest switching to ISC or MIT (aka X11, aka Expat) licenses. Probably the former should be preferred, as it is shorter and cleaner. 
> The full list of licenses compatible with GPL is here [1].
> 
> Regards,
> Ivan
> 
> [1]: https://www.gnu.org/licenses/license-list.en.html
> 
> On Tue, Oct 11, 2016 at 8:36 AM, Yaron Minsky <yminsky@janestreet.com> wrote:
> You have got to be kidding me.
> 
> Maybe we can dual license? It would be lovely to avoid the rewrite.
> What license would be adequate? Maybe we can license everything under
> LGPLv2+exception and Apache?
> 
> I hate licenses.
> 
> y
> 
> On Tue, Oct 11, 2016 at 7:49 AM, Soegtrop, Michael
> <michael.soegtrop@intel.com> wrote:
> > Dear Yaron,
> >
> >
> >
> >> I very much hope the licensing isn't an issue. We purposely picked a very
> >> liberal license to make this kind of thing as easy as possible. Do tell us
> >> if you find an issue there.
> >
> >
> >
> > it is hard to believe, but the licensing is an issue. According to this
> > reference from Apache:
> >
> >
> >
> > https://www.apache.org/licenses/GPL-compatibility.html
> >
> >
> >
> > citation:
> >
> >
> >
> > “Despite our best efforts, the FSF has never considered the Apache License
> > to be compatible with GPL version 2, citing the patent termination and
> > indemnification provisions as restrictions not present in the older GPL
> > license.”
> >
> >
> >
> > the apache license you use is not compatible with GPL2. Since the OCaml
> > library is LGPL 2.1, it cannot include Apache licensed code. The patent
> > issue mentioned above has nothing to do with the difference between GPL and
> > LGPL, so my guess would be that this also applies to LGPL 2.X.
> >
> >
> >
> > Please note that the above reference states that Apache is compatible with
> > GPL 3, but I guess you can write a PhD thesis in law and/or computer science
> > about the topic if it is better to have GPL 2.x+ or GPL 3+Apache.
> >
> >
> >
> > If you think it is worthwhile, I can ask one of our open source lawyers for
> > advice, but I think the above statement from Apache is fairly clear.
> >
> >
> >
> > So as it looks, I have to rewrite from scratch what I need - sigh
> >
> >
> >
> > Best regards,
> >
> >
> >
> > Michael
> >
> > 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
> 
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
> 


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-11 13:06               ` Anil Madhavapeddy
@ 2016-10-11 13:13                 ` Yaron Minsky
  2016-10-11 13:27                   ` Hendrik Boom
  0 siblings, 1 reply; 23+ messages in thread
From: Yaron Minsky @ 2016-10-11 13:13 UTC (permalink / raw)
  To: Anil Madhavapeddy
  Cc: Ivan Gotovchits, Soegtrop, Michael, Gerd Stolpmann,
	Jeremie Dimino, caml-list

We have a CLA from all external contributors, so re-licensing under a
more liberal license should be easy, except insofar as we need to do
some due dilligence on whatever new license we pick. Presumably, the
open source lawyer who advised us to pick Apache 2 had some reason for
it, which we need to think about it.

(By the way: see? CLAs aren't all bad...)

We'll look into it.

y

On Tue, Oct 11, 2016 at 9:06 AM, Anil Madhavapeddy <anil@recoil.org> wrote:
> The standard MirageOS license for our libraries is ISC, which is short and simple (and the standard license used for new code in OpenBSD):
>
> https://github.com/mirage/mirage/blob/master/LICENSE.md
>
> regards,
> Anil
>
>> On 11 Oct 2016, at 14:00, Ivan Gotovchits <ivg@ieee.org> wrote:
>>
>> Hi Yaron,
>>
>> Given that most of the Janestreet codebase is developed in-house, it might be not that hard to relicense it. This is especially true for `shexp` that currently
>> has only one contributor. I would suggest switching to ISC or MIT (aka X11, aka Expat) licenses. Probably the former should be preferred, as it is shorter and cleaner.
>> The full list of licenses compatible with GPL is here [1].
>>
>> Regards,
>> Ivan
>>
>> [1]: https://www.gnu.org/licenses/license-list.en.html
>>
>> On Tue, Oct 11, 2016 at 8:36 AM, Yaron Minsky <yminsky@janestreet.com> wrote:
>> You have got to be kidding me.
>>
>> Maybe we can dual license? It would be lovely to avoid the rewrite.
>> What license would be adequate? Maybe we can license everything under
>> LGPLv2+exception and Apache?
>>
>> I hate licenses.
>>
>> y
>>
>> On Tue, Oct 11, 2016 at 7:49 AM, Soegtrop, Michael
>> <michael.soegtrop@intel.com> wrote:
>> > Dear Yaron,
>> >
>> >
>> >
>> >> I very much hope the licensing isn't an issue. We purposely picked a very
>> >> liberal license to make this kind of thing as easy as possible. Do tell us
>> >> if you find an issue there.
>> >
>> >
>> >
>> > it is hard to believe, but the licensing is an issue. According to this
>> > reference from Apache:
>> >
>> >
>> >
>> > https://www.apache.org/licenses/GPL-compatibility.html
>> >
>> >
>> >
>> > citation:
>> >
>> >
>> >
>> > “Despite our best efforts, the FSF has never considered the Apache License
>> > to be compatible with GPL version 2, citing the patent termination and
>> > indemnification provisions as restrictions not present in the older GPL
>> > license.”
>> >
>> >
>> >
>> > the apache license you use is not compatible with GPL2. Since the OCaml
>> > library is LGPL 2.1, it cannot include Apache licensed code. The patent
>> > issue mentioned above has nothing to do with the difference between GPL and
>> > LGPL, so my guess would be that this also applies to LGPL 2.X.
>> >
>> >
>> >
>> > Please note that the above reference states that Apache is compatible with
>> > GPL 3, but I guess you can write a PhD thesis in law and/or computer science
>> > about the topic if it is better to have GPL 2.x+ or GPL 3+Apache.
>> >
>> >
>> >
>> > If you think it is worthwhile, I can ask one of our open source lawyers for
>> > advice, but I think the above statement from Apache is fairly clear.
>> >
>> >
>> >
>> > So as it looks, I have to rewrite from scratch what I need - sigh
>> >
>> >
>> >
>> > Best regards,
>> >
>> >
>> >
>> > Michael
>> >
>> > 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
>>
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>>
>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-11 13:13                 ` Yaron Minsky
@ 2016-10-11 13:27                   ` Hendrik Boom
  2016-10-11 13:53                     ` Soegtrop, Michael
  0 siblings, 1 reply; 23+ messages in thread
From: Hendrik Boom @ 2016-10-11 13:27 UTC (permalink / raw)
  To: caml-list

On Tue, Oct 11, 2016 at 09:13:01AM -0400, Yaron Minsky wrote:
> We have a CLA from all external contributors, so re-licensing under a
> more liberal license should be easy, except insofar as we need to do
> some due dilligence on whatever new license we pick. Presumably, the
> open source lawyer who advised us to pick Apache 2 had some reason for
> it, which we need to think about it.

Doesn't the current Apache license have a clause allowing you to 
relicence it with some variety of GPL? 

-- hendrik

> 
> (By the way: see? CLAs aren't all bad...)
> 
> We'll look into it.
> 
> y
> 
> On Tue, Oct 11, 2016 at 9:06 AM, Anil Madhavapeddy <anil@recoil.org> wrote:
> > The standard MirageOS license for our libraries is ISC, which is short and simple (and the standard license used for new code in OpenBSD):
> >
> > https://github.com/mirage/mirage/blob/master/LICENSE.md
> >
> > regards,
> > Anil
> >
> >> On 11 Oct 2016, at 14:00, Ivan Gotovchits <ivg@ieee.org> wrote:
> >>
> >> Hi Yaron,
> >>
> >> Given that most of the Janestreet codebase is developed in-house, it might be not that hard to relicense it. This is especially true for `shexp` that currently
> >> has only one contributor. I would suggest switching to ISC or MIT (aka X11, aka Expat) licenses. Probably the former should be preferred, as it is shorter and cleaner.
> >> The full list of licenses compatible with GPL is here [1].
> >>
> >> Regards,
> >> Ivan
> >>
> >> [1]: https://www.gnu.org/licenses/license-list.en.html
> >>
> >> On Tue, Oct 11, 2016 at 8:36 AM, Yaron Minsky <yminsky@janestreet.com> wrote:
> >> You have got to be kidding me.
> >>
> >> Maybe we can dual license? It would be lovely to avoid the rewrite.
> >> What license would be adequate? Maybe we can license everything under
> >> LGPLv2+exception and Apache?
> >>
> >> I hate licenses.
> >>
> >> y
> >>
> >> On Tue, Oct 11, 2016 at 7:49 AM, Soegtrop, Michael
> >> <michael.soegtrop@intel.com> wrote:
> >> > Dear Yaron,
> >> >
> >> >
> >> >
> >> >> I very much hope the licensing isn't an issue. We purposely picked a very
> >> >> liberal license to make this kind of thing as easy as possible. Do tell us
> >> >> if you find an issue there.
> >> >
> >> >
> >> >
> >> > it is hard to believe, but the licensing is an issue. According to this
> >> > reference from Apache:
> >> >
> >> >
> >> >
> >> > https://www.apache.org/licenses/GPL-compatibility.html
> >> >
> >> >
> >> >
> >> > citation:
> >> >
> >> >
> >> >
> >> > “Despite our best efforts, the FSF has never considered the Apache License
> >> > to be compatible with GPL version 2, citing the patent termination and
> >> > indemnification provisions as restrictions not present in the older GPL
> >> > license.”
> >> >
> >> >
> >> >
> >> > the apache license you use is not compatible with GPL2. Since the OCaml
> >> > library is LGPL 2.1, it cannot include Apache licensed code. The patent
> >> > issue mentioned above has nothing to do with the difference between GPL and
> >> > LGPL, so my guess would be that this also applies to LGPL 2.X.
> >> >
> >> >
> >> >
> >> > Please note that the above reference states that Apache is compatible with
> >> > GPL 3, but I guess you can write a PhD thesis in law and/or computer science
> >> > about the topic if it is better to have GPL 2.x+ or GPL 3+Apache.
> >> >
> >> >
> >> >
> >> > If you think it is worthwhile, I can ask one of our open source lawyers for
> >> > advice, but I think the above statement from Apache is fairly clear.
> >> >
> >> >
> >> >
> >> > So as it looks, I have to rewrite from scratch what I need - sigh
> >> >
> >> >
> >> >
> >> > Best regards,
> >> >
> >> >
> >> >
> >> > Michael
> >> >
> >> > 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
> >>
> >> --
> >> Caml-list mailing list.  Subscription management and archives:
> >> https://sympa.inria.fr/sympa/arc/caml-list
> >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> >> Bug reports: http://caml.inria.fr/bin/caml-bugs
> >>
> >
> 
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-11 12:36           ` Yaron Minsky
  2016-10-11 13:00             ` Ivan Gotovchits
@ 2016-10-11 13:46             ` Soegtrop, Michael
  2016-10-14 12:19               ` Manfred Lotz
  1 sibling, 1 reply; 23+ messages in thread
From: Soegtrop, Michael @ 2016-10-11 13:46 UTC (permalink / raw)
  To: Yaron Minsky; +Cc: Gerd Stolpmann, Jeremie Dimino, caml-list

Dear Yaron,

> I hate licenses.

it is definitely a good source of income for lawyers, and I found it is worthwhile for a SW developer to take a 1 day course on the topic - it is a fairly surprising subject.

I would think it would be best to triple license it under Apache + a verbatim copy of the current Ocamllib license (LGPL 2.1 with link exception) + "the current or any past license of Ocamllib ". The latter would make it easier for the Ocamllib team to change their license later. If this helps, I could ask our in house license lawyers for advice.

But I have no idea if there are, besides the license issues, other reasons for not having common modules. One is likely the different base library, but in this specific case it shouldn't be much of an issue.


One technical note: I would implement in addition to processes defined by executables some simple built in standard processes, like cp, ln, cat, mkdir, tee (might be a combiner) and later maybe even sed, sort, wc, find. It doesn't help to have a portable shell environment, if you don't have portable core commands. Compiling "ln" for Windows is actually harder than compiling gcc or OCaml. Of cause it doesn't make sense to reimplement half of unix, but at least simple forms of those commands used in shell scripts every other line and which are just a few lines in OCaml would make sense.

Best regards,

Michael
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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-11 13:27                   ` Hendrik Boom
@ 2016-10-11 13:53                     ` Soegtrop, Michael
  2016-10-11 15:48                       ` Adrien Nader
  0 siblings, 1 reply; 23+ messages in thread
From: Soegtrop, Michael @ 2016-10-11 13:53 UTC (permalink / raw)
  To: Hendrik Boom, caml-list

Dear Hendrik,

> Doesn't the current Apache license have a clause allowing you to relicence it
> with some variety of GPL?

As far as I know the FSF agreed that the Apache license conditions are a subset of the GPL 3 conditions, so that you can redistribute Apache stuff under GPL3. But the references I looked into (Wikipedia + the Apache site I cited below) all state that no version of Apache is compatible with GPL 2 and Ocamllib is LGPL2.1. Furthermore (again afaik) GPL2 and GPL3 are also incompatible, so that you cannot even combine Apache SW and ocammlib and distribute it under GPL3 or LGPL3.

Best regards,

Michael
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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-11 13:53                     ` Soegtrop, Michael
@ 2016-10-11 15:48                       ` Adrien Nader
  0 siblings, 0 replies; 23+ messages in thread
From: Adrien Nader @ 2016-10-11 15:48 UTC (permalink / raw)
  To: Soegtrop, Michael; +Cc: Hendrik Boom, caml-list

The central aspect for these incompatibilities is patents afaik.

GPLv2 forbids additional restrictions being put in place. The GPLv3 has
additional restrictions compared to the GPLv2 (at least because of the
patent clauses) and is therefore obviously incompatible.

The Apache and GPLv3 licenses have patent retaliation clauses which help
deter actors that aren't patent trolls from suing (basically, they say
that if you sue someone over the patents which this software could
relate to, then you lose the right to use the software). Patent trolls
have nothing to lose so they don't really care but they're a different
matter.

Overall the patent retaliation clause is good and the Apache software
helps because it is about /both/ copyrights and patents. Only handling
the copyright aspects nowadays only works if you live in Care Bear's
world.

License compatibility is a fairly complex topic which brings an extra
set of constraints. Dual- or even triple- licensing is a good solution.

NB: this comes with the usual warnings but factored at the end rather
than being written in each and every sentence: IANAL, I'm not an expert,
add "as far as I know" in every sentence you want to.

-- 
Adrien Nader

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-11 13:46             ` Soegtrop, Michael
@ 2016-10-14 12:19               ` Manfred Lotz
  2016-10-17  8:08                 ` Soegtrop, Michael
  0 siblings, 1 reply; 23+ messages in thread
From: Manfred Lotz @ 2016-10-14 12:19 UTC (permalink / raw)
  To: caml-list

On Tue, 11 Oct 2016 13:46:28 +0000
"Soegtrop, Michael" <michael.soegtrop@intel.com> wrote:

> Dear Yaron,
> 
> > I hate licenses.  
> 

:-)

> it is definitely a good source of income for lawyers, and I found it
> is worthwhile for a SW developer to take a 1 day course on the topic
> - it is a fairly surprising subject.
> 

Could you point to such a course? 


> I would think it would be best to triple license it under Apache + a
> verbatim copy of the current Ocamllib license (LGPL 2.1 with link
> exception) + "the current or any past license of Ocamllib ". The
> latter would make it easier for the Ocamllib team to change their
> license later. If this helps, I could ask our in house license
> lawyers for advice.
> 
> But I have no idea if there are, besides the license issues, other
> reasons for not having common modules. One is likely the different
> base library, but in this specific case it shouldn't be much of an
> issue.
> 
> 
> One technical note: I would implement in addition to processes
> defined by executables some simple built in standard processes, like
> cp, ln, cat, mkdir, tee (might be a combiner) and later maybe even
> sed, sort, wc, find. It doesn't help to have a portable shell
> environment, if you don't have portable core commands. Compiling "ln"
> for Windows is actually harder than compiling gcc or OCaml. Of cause
> it doesn't make sense to reimplement half of unix, but at least
> simple forms of those commands used in shell scripts every other line
> and which are just a few lines in OCaml would make sense.
> 
> Best regards,
> 
> Michael
> 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
> 


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-14 12:19               ` Manfred Lotz
@ 2016-10-17  8:08                 ` Soegtrop, Michael
  2016-10-17  9:22                   ` Manfred Lotz
  0 siblings, 1 reply; 23+ messages in thread
From: Soegtrop, Michael @ 2016-10-17  8:08 UTC (permalink / raw)
  To: Manfred Lotz, caml-list

Dear Manfred,

> > it is definitely a good source of income for lawyers, and I found it
> > is worthwhile for a SW developer to take a 1 day course on the topic
> > - it is a fairly surprising subject.
> >
> 
> Could you point to such a course?

Intel has internal experts and specialized lawyers who give the trainings in house. I would think any large technology company (like yours) has experts in this area - you just have to find them ;-)

If we wouldn't have this in house, I think the point I would go to is probably:

https://www.linuxfoundation.org/offerings/open-source-compliance
https://compliance.linuxfoundation.org/references/compliance-related-publications

They offer free online tutorial material as well as tailored paid on site trainings and their authority in this topic should be beyond all questions. But since we have this in house, I cannot really recommend a specific service provider.

What I can recommend is taking the time to attend a course or take a tutorial on the topic.

Best regards,

Michael

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Caml-list] ocamlbuild on Windows and bash vs. cmd
  2016-10-17  8:08                 ` Soegtrop, Michael
@ 2016-10-17  9:22                   ` Manfred Lotz
  0 siblings, 0 replies; 23+ messages in thread
From: Manfred Lotz @ 2016-10-17  9:22 UTC (permalink / raw)
  To: caml-list

Hi Michael,
Thanks for answering.

On Mon, 17 Oct 2016 08:08:16 +0000
"Soegtrop, Michael" <michael.soegtrop@intel.com> wrote:

> Dear Manfred,
> 
> > > it is definitely a good source of income for lawyers, and I found
> > > it is worthwhile for a SW developer to take a 1 day course on the
> > > topic
> > > - it is a fairly surprising subject.
> > >  
> > 
> > Could you point to such a course?  
> 
> Intel has internal experts and specialized lawyers who give the
> trainings in house. I would think any large technology company (like
> yours) has experts in this area - you just have to find them ;-)
> 

Yeah, my company is a big universe.... I will take a look what we have
internally.

> If we wouldn't have this in house, I think the point I would go to is
> probably:
> 
> https://www.linuxfoundation.org/offerings/open-source-compliance
> https://compliance.linuxfoundation.org/references/compliance-related-publications
> 
> They offer free online tutorial material as well as tailored paid on
> site trainings and their authority in this topic should be beyond all
> questions. But since we have this in house, I cannot really recommend
> a specific service provider.
> 

Thanks for the pointers. I was looking for something short (a day or so) as I find the licensing
subject really awful. But it is good to know some basics.


> What I can recommend is taking the time to attend a course or take a
> tutorial on the topic.
> 

Yep, agree.


Best, Manfred

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2016-10-17  9:22 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-06 13:38 [Caml-list] ocamlbuild on Windows and bash vs. cmd Soegtrop, Michael
2016-10-06 13:45 ` Kakadu
2016-10-06 14:01   ` Soegtrop, Michael
2016-10-06 13:55 ` Daniel Bünzli
2016-10-06 14:15   ` Soegtrop, Michael
2016-10-06 14:45     ` Gabriel Scherer
2016-10-06 16:16       ` Soegtrop, Michael
2016-10-06 17:45 ` Jeremie Dimino
2016-10-06 18:56   ` Gerd Stolpmann
2016-10-07  6:58     ` Soegtrop, Michael
2016-10-07 16:19       ` Yaron Minsky
2016-10-11 11:49         ` Soegtrop, Michael
2016-10-11 12:36           ` Yaron Minsky
2016-10-11 13:00             ` Ivan Gotovchits
2016-10-11 13:06               ` Anil Madhavapeddy
2016-10-11 13:13                 ` Yaron Minsky
2016-10-11 13:27                   ` Hendrik Boom
2016-10-11 13:53                     ` Soegtrop, Michael
2016-10-11 15:48                       ` Adrien Nader
2016-10-11 13:46             ` Soegtrop, Michael
2016-10-14 12:19               ` Manfred Lotz
2016-10-17  8:08                 ` Soegtrop, Michael
2016-10-17  9:22                   ` Manfred Lotz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).