Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004380OCaml-for ocamlbuild use 12:022012-03-24 15:01
Assigned Toxclerc 
PlatformOSOS Version
Product Version3.10.0 
Target VersionFixed in Version3.12.1+dev 
Summary0004380: ocamlbuild should not use tput on windows
DescriptionOn windows, if you do not specify "ocamlbuild -classic-display", ocamlbuild will always error out wih a message like "'tput' is not recognized as an internal or external command...". If tput doesn't work, it'd be really nice if ocamlbuild just fell back silently to using -classic-display without requiring that it is specified.
TagsNo tags attached.
Attached Filesdiff file icon ocamlbuild-doubleclose.diff [^] (580 bytes) 2008-07-29 04:06 [Show Content]

- Relationships

-  Notes
ertai (developer)
2007-11-14 20:21

That's really strange, because the code tells me that we are already doing that. Our function that runs a command and returns its output can raise the Failure exception that is caught and then the number of columns is defaulted to 80.
mwipliez (reporter)
2007-12-03 16:54

The ocamlbuild shipped with the 3.10 mingw version indeed tries to use tput under CMD and Cygwin (but not on MSYS):
> set PATH=C:\Program Files\Objective Caml\bin
> ocamlbuild -help
'tput' n'est pas reconnu en tant que commande interne

The version I just compiled from release310 seems to work fine under CMD and Cygwin when using the -help option:
> set PATH=C:\ocamlmgw\bin
> ocamlbuild -help
Usage ocamlbuild [options] <target>

But now if I try, say, "ocamlbuild -clean", it still fails to use tput, and outputs the message:
ocamlbuild: "close_process_in" failed: Bad file descriptor

Hope this helps.
mwipliez (reporter)
2008-04-11 11:41

Up: the issue is still present in OCaml 3.10.2.
monate (reporter)
2008-05-14 16:58

The problem probably comes from inside run_and_open.

close is called twice whenever it raises an exception : the second call will raise
Unix.EBADF which is never caught.

By the way the command in this function is not wrapped with "bash -c" contrary with the behaviour of sys_command. Is this the expected behaviour ?

jld (reporter)
2008-07-29 04:07

I've had to fix the double pclose locally, because NetBSD's tput doesn't seem to support the "cols" attribute; I've attached a diff of my change.
ertai (developer)
2008-07-31 09:57

I've applied the given patch to the CVS HEAD.

However I've not tested under Cygwin and I would like to know if this fixes the problem.

Thanks to idadesub, mwipliez and jld.
xclerc (reporter)
2010-12-07 15:40

Additionally to the fixed 'close' issue, the 'tput' command
is now called only if 'Sys.os_type' indicates that we are under
Unix (as 'tput' is also missing from a vanilla Cygwin installation).

- Issue History
Date Modified Username Field Change
2007-09-05 12:02 idadesub New Issue
2007-11-10 14:53 xleroy Status new => assigned
2007-11-10 14:53 xleroy Assigned To => ertai
2007-11-14 20:21 ertai Note Added: 0004317
2007-12-03 16:54 mwipliez Note Added: 0004379
2008-04-11 11:41 mwipliez Note Added: 0004491
2008-05-14 16:58 monate Note Added: 0004508
2008-07-29 04:06 jld File Added: ocamlbuild-doubleclose.diff
2008-07-29 04:07 jld Note Added: 0004545
2008-07-31 09:57 ertai Note Added: 0004546
2010-07-22 11:49 ertai Assigned To ertai => xclerc
2010-07-22 11:49 ertai Category OCaml general => OCamlbuild
2010-12-07 15:40 xclerc Note Added: 0005729
2010-12-07 15:40 xclerc Status assigned => resolved
2010-12-07 15:40 xclerc Fixed in Version => 3.12.1+dev
2010-12-07 15:40 xclerc Resolution open => fixed
2012-02-02 15:17 protz Category OCamlbuild => OCamlbuild (the tool)
2012-03-24 15:01 xleroy Status resolved => closed
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