Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004981OCaml-for ocamlbuild use 15:222016-10-05 14:25
Assigned Toxclerc 
PlatformOSOS Version
Product Version3.11.2 
Target VersionFixed in Version 
Summary0004981: ocamlbuild/ shouldn't call bash
DescriptionOn a vanilla Windows machine, with no cygwin, ocamlbuild falls over.

ocamlbuild calls bash.
But the presence of ocaml Windows distributions implies that I need not have bash on my os.
TagsNo tags attached.
Attached Files

- Relationships
related to 0006107acknowledged Lack of quoting helpers for use with Unix.open_process* 
related to 0006096resolved Validate what is needed to fully support Windows 
related to 0005201resolved Performance issue for ocamlbuild on Windows 

-  Notes
xleroy (administrator)
2010-04-18 19:00

As far as I can remember Windows's standard command-line interpreter (cmd.exe) is unusable in ocamlbuild's context (and in many others), because of its incomplete (and undocumented!) quoting behavior: there are plenty of commands that simply cannot be given as argument to "cmd /c" because they cannot be quoted properly. So, that leave little choice but going through a better shell like Cygwin's. Suggestions for alternative approaches most welcome. (Reclassified as "feature wish".)
samin (reporter)
2010-04-26 13:10

I'm OK with this being reclassified as a feature wish.
Can you point me to the examples of what can't be run using Sys.command on Windows?
ertai (developer)
2010-04-26 13:41

I don't rember exactly the examples but try to pass an argument to a command that contains spaces, quotes, slashes, blackslashes and you will quickly found the problem.
Julien Signoles (reporter)
2010-04-26 13:43

Bashisms are also an issue for BSD-like systems: that is not a Windows-only feature wish.
ertai (developer)
2010-04-26 14:17

Bashism is only when you call sh, here we call bash.
protz (manager)
2012-01-18 11:18


First of all, thanks for reporting. While we believe you're
making a valid point, we don't have enough manpower to devote to this feature in
the foreseeable future. We're moving this to the resolved/suspended status: this
means the discussion is still open, but the PR won't appear in our to-do list.
You're welcome to reopen the issue if you have a patch; we would gladly review


ygrek (reporter)
2012-05-30 15:37

A description of windows quoting rules, including cmd. [^]
protz (manager)
2012-05-30 15:55

The next version of the Windows installer will encourage the user to install Cygwin. A few bugs have been fixed as well, and now ocamlbuild calls bash with what we believe is proper quoting. This should be announced in a few days, once we package the beta release of OCaml 4.00.

The official position is now: "if you want to get an ocaml development environment under Windows, just install cygwin". The windows installer will offer you the option of launching cygwin's setup.exe with the right set of packages preselected.

But of course we'd be glad to accept a patch that lifts the requirement on bash on Windows. That being said, I don't think anyone here wants to be the person who writes the patch :).


Michael Soegtrop (reporter)
2016-10-05 14:24

Dear OCaml Team,

I want to package a /small/ OCaml with Coq, so that native compute works. It would be nice to have ocamlbuild working as well.

I looked into the quoting issue. OCaml's Filename.quote doesn't seem to be appropriate for Windows. The quoting character for Windows is ^ and this character doesn't occur at all in, except as string concat, so this function is for sure wrong.

The "documentation" for quoting on Windows I tend to use is: [^] [^]

I would voulunteer to fix this and also to change ocamlbuild to not call bash or unix commands except for "raw shell script actions" (see [^])

Would this be appreciated for main stream OCaml, or should I just patch it for Coq?

Best regards,


- Issue History
Date Modified Username Field Change
2010-02-17 15:22 samin New Issue
2010-04-18 19:00 xleroy Note Added: 0005330
2010-04-18 19:00 xleroy Assigned To => ertai
2010-04-18 19:00 xleroy Severity major => feature
2010-04-18 19:00 xleroy Status new => feedback
2010-04-26 13:10 samin Note Added: 0005371
2010-04-26 13:41 ertai Note Added: 0005374
2010-04-26 13:43 Julien Signoles Note Added: 0005375
2010-04-26 14:17 ertai Note Added: 0005377
2010-07-22 11:41 ertai Status feedback => assigned
2010-07-22 11:41 ertai Assigned To ertai => xclerc
2012-01-18 11:18 protz Note Added: 0006722
2012-01-18 11:18 protz Status assigned => resolved
2012-01-18 11:18 protz Resolution open => suspended
2012-02-02 15:17 protz Category OCamlbuild => OCamlbuild (the tool)
2012-05-30 15:37 ygrek Note Added: 0007472
2012-05-30 15:55 protz Note Added: 0007473
2013-07-27 08:52 protz Relationship added related to 0006096
2013-07-28 23:19 gasche Relationship added related to 0005201
2013-08-01 11:01 xleroy Relationship added related to 0006107
2016-10-05 14:24 Michael Soegtrop Note Added: 0016389
2017-02-23 16:34 doligez Category OCamlbuild (the tool) => for ocamlbuild use [^]
2017-02-23 16:44 doligez Category for ocamlbuild use [^] => -for ocamlbuild use [^]

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker