[m-rev.] diff: fix bug #339: --restricted-command-line broken with recent Java compilers
Julien Fischer
jfischer at opturion.com
Fri Jul 17 16:55:18 AEST 2015
On Fri, 17 Jul 2015, Sebastian Godelet wrote:
>>> @@ -1181,7 +1192,7 @@
>>> create_launcher_batch_file(Globals, MainModuleName, Pred,
>> Succeeded, !IO) :-
>>> Extension = ".bat",
>>> module_name_to_file_name(Globals, MainModuleName, Extension,
>>> - do_not_create_dirs, FileName, !IO),
>>> + do_create_dirs, FileName, !IO),
>>>
>>> But in the compile_target_code module in the
>> post_link_make_symlink_or_copy predicate
>>> module_name_to_file_name is called with an empty "" extension,
>>> thus yielding the "bin" directory instead of the "bats" sub-directory (this is
>> how the internals work for module_name_to_file_name afaik).
>>> So when not compiling with --target-env windows this bug had no effect,
>>> only the combination of --use(-grade)-subdirs and Windows causes this.
>>>
>>> diff --git a/compiler/compile_target_code.m
>> b/compiler/compile_target_code.m
>>> index 82f4a91..eb2c280 100644
>>> --- a/compiler/compile_target_code.m
>>> +++ b/compiler/compile_target_code.m
>>> @@ -2652,12 +2652,10 @@ post_link_make_symlink_or_copy(ErrorStream,
>> LinkTargetType, ModuleName,
>>> )
>>> then
>>> ScriptExt = get_launcher_script_extension(Globals),
>>> - module_name_to_file_name(Globals, ModuleName, "",
>>> - do_not_create_dirs, OutputScriptName0, !IO),
>>> - OutputScriptName = OutputScriptName0 ++ ScriptExt,
>>> - module_name_to_file_name(NoSubdirGlobals, ModuleName, "",
>>> - do_not_create_dirs, UserDirScriptName0, !IO),
>>> - UserDirScriptName = UserDirScriptName0 ++ ScriptExt,
>>> + module_name_to_file_name(Globals, ModuleName, ScriptExt,
>>> + do_not_create_dirs, OutputScriptName, !IO),
>>> + module_name_to_file_name(NoSubdirGlobals, ModuleName,
>> ScriptExt,
>>> + do_not_create_dirs, UserDirScriptName, !IO),
>>
>> It should be passing ScriptExt to the calls to module_name_to_file_name
>> instead of "" (and not manually appending the extension). That at
>> least, fixes the problem on Windows. (I suspect the above is simply a
>> cut-and-paste error). I'm presently testing this fix.
Done (commit 637bffd).
Cheers,
Julien.
More information about the reviews
mailing list