[m-rev.] diff: fix bug #339: --restricted-command-line broken with recent Java compilers

Julien Fischer jfischer at opturion.com
Wed Jul 15 14:59:02 AEST 2015



On Wed, 15 Jul 2015, Sebastian Godelet wrote:

> The compiler is compiled in a msys environment,
> But I tested it in a normal Windows command shell.
> In my Mercury.config file I have --env-type windows.
> Nevertheless, if I open an msys shell and use:
>
> $ mmc --use-grade-subdirs --env-type msys -s java -m fmt_bug
> cp: cannot stat `Mercury\\java\\i686-pc-mingw32\\Mercury\\bin\\fmt_bug': No such file or directory
> Made symlink/copy of Mercury\java\i686-pc-mingw32\Mercury\jars\fmt_bug.jar
> mercury_compile.exe: error copying `Mercury\java\i686-pc-mingw32\Mercury\bin\fmt_bug' to `fmt_bug', can't open input file: No such file or directory
>
> The same problem applies.

Ok, I'll take a look at it.

> Again, without the --use-grade-subdirs the correct file gets copid.
> I should mention that in the former case (Windows cmd), the subdir
> Mercury\java\i686-pc-mingw32\Mercury\bats
> Does contain the bat file, just it seems that the `cp' command is not looking in that folder.
>
> On a side note, if I use --env-type msys, the java class path still uses the c:/ Windows path convention in the
> Shell script and thus cannot be executed (though I think that is a different problem).

I don't think the MSYS use case was really considered when we added
support for launcher scripts.  (The reason is probably that it's
somewhat awkward as it requires Unix conventions in some spots and
Windows ones in others -- also, at the time I don't think the Mercury
compiler had sufficient information about the environment to actually
handle it properly anyway.)  I'll take a look at this one as well.

Cheers,
Julien.



More information about the reviews mailing list