[erlang-questions] A potential fix for escript on Windows

Pierre Rouleau <>
Sun Jun 5 00:43:56 CEST 2011


Thanks Frédéric!

You answered before I completed the cygwin installation :-)

Pierre

2011/6/4 Frédéric Trottier-Hébert <>

> All steps of development, how to run tests, etc. are described in the
> Erlang github wiki: https://github.com/erlang/otp/wiki
>
> You can see the submitting patches page (
> https://github.com/erlang/otp/wiki/Submitting-patches) for more details on
> the exact topic you're looking for.
>
> Hope this helps.
>
> --
> Fred Hébert
> http://www.erlang-solutions.com
>
>
>
> On 2011-06-04, at 18:33 PM, Pierre Rouleau wrote:
>
> OK, I think I know why escript is not accepting scrips unless it's invoked
> as escript.exe.
>
> I took a look at erts/etc/common/escript.c which I believe is the source
> for escript.
>
> I think one of the problem under Windows is the fact that when  escript's
> main() is looking for the escript basename, it does not consider that, under
> Windows, it could very well be escript (just as much as escript.exe).  If
> the invocation line is "escript the_scrip_file.erl arguments", then escript
> thinks the argv[0] is the name of the script (instead of escript executable)
> and appends ".escript" to it.
>
> One way to solve this problem under Windows, from what I can tell so far,
> would be to check for escript.exe as well as escript under Windows, as the
> following patch to escript does (from the R14B03 source taken at
> erlang.org):
>
>
> @@ -377,7 +377,8 @@
>      last_opt = argv;
>
>  #ifdef __WIN32__
> -    if (_stricmp(basename, "escript.exe") == 0) {
> +    if ( (_stricmp(basename, "escript.exe") == 0)
> +       ||(_stricmp(basename, "escript") == 0)) {
>  #else
>      if (strcmp(basename, "escript") == 0) {
>  #endif
>
>
> I have not yet tested that patch (I am still downloading Cygwin's
> development package to be able to build Erlang from source on the Windows
> box).
>
> If I get it working, should I (and where should I) submit a patch to
> escript.c?
>
> Also, is there a bug tracker for Erlang where one can browse through bug
> reports, submit one and identify patches or is everything done through the
> mailing lists?  I did not see links to a bug tracker in the erlang.orgsite except for a mention about submitting patches via github.
>
> And finally, is there a documented process for development?
>
> Thanks
>
> -- Pierre Rouleau
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110604/e07982f1/attachment.html>


More information about the erlang-questions mailing list