On 05/03/2012, Gabriel Scherer <gabriel.sche...@gmail.com> wrote:
> In the process of discussing bug #5312, the caml team would like to
> know if people still have use of the @responsefile feature under
> windows. If not, it could be removed from the runtime -- that is from
> all OCaml programs.
>
>   http://caml.inria.fr/mantis/view.php?id=5312
>
> @responsefile is a feature/convention under Windows to provide files
> containing command-line argument options; when a tool parses
> command-line options and encounters a file name prefixed by a '@'
> character, it expands its contents as if it were part of the
> command-line invocation. This is used to circumvent the historically
> fairly ridiculous limit on command-line length in the old 'cmd.com'.
>
> The OCaml toolchain copes with @responsefile in two places -- as far
> as I know, but I'm not familiar with anything Windows. First, when the
> compiler invokes external tools (linkers, etc.) under Windows, it uses
> a @responsefile if the command-line length exceeds a fixed limit --
> curently 4096, used to be 256 and annoy users.
>
> Second, under Windows only, the OCaml runtime considers @-prefixed
> arguments as responsefile file names, and expands them during its
> initialization phase. This is silently done by the OCaml *runtime*, so
> all OCaml programs are affected; the compilers, but also the user
> programs. Did you know that you shouldn't use '@' in your command-line
> parameters syntax if you want your program to work on Windows?
>
> The first use has been problematic in the past because some of the
> underlying toolchains (Cygwin, mingw...) did not support
> @responsefiles. The second case is now problematic as the @-syntax
> conflicts with the warning-as-error syntax of the compiler: as
> reported by Dmitry Grebeniuk, "-w @a" under windows complains about
> a missing file "a", while it really should mark all warnings as
> errors -- a very bad idea for future compatibility when new warnings
> are added, by the way; don't use that in released OCaml software.
>
> According to our Windows spies, the command-line restrictions are
> nowadays very reasonable: 8K for cmd.com, and 32K internally. Maybe
> the @responsefile feature has outlived its use, and this bug could be
> fixed by simply removing the @-files expansion phase of the runtime.

As far as I can see on msdn, 8K for cmd.exe has started with Windows
XP. It was 2047 bytes on Windows 2000.

In other words, do we still want to build on 2000 or 9x/Me? I don't
think that was event supposed to be supported, even without this
@responsefile issue and I think I remember some issues running ocaml
programs on win9x. Moreover, noone is going to be able to support
that; i.e. win9x support has probably already bitrot a lot.

By the way, I had only known of reponse files a pretty long time ago
because Cygwin and/or MSYS didn't handle it.

I guess the only way to make sure noone uses it is to break response
files and wait until someone shouts.

Regards,
Adrien Nader

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to