[m-dev.] for review: add make_command_string

Peter Ross peter.ross at miscrit.be
Tue Feb 20 23:25:26 AEDT 2001


On Tue, Feb 20, 2001 at 11:00:57PM +1100, Fergus Henderson wrote:
> On 20-Feb-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > Fix a bug where fact tables weren't working for MSVC version of the
> > compiler.
> > 
> > compiler/passes_aux.m:
> >     Add a new predicate make_command_string which will optionally wrap a
> >     shell string with a call to sh -c, if the shell string is being
> >     constructed in a win32 environment.
> > 
> > compiler/fact_table.m:
> > compiler/llds_out.m:
> > compiler/modules.m:
> >     Call the make_command_string predicate.
> 
> I don't understand how the changes to llds_out.m and modules.m relate
> to the bug fix for fact tables.  Why did you change those modules?
> Is your change fixing bugs in them too?
> 
Sorry, they don't, but my change is fixing bugs in these commands as
well.  It was just the factt.m testcase which motivated me into finding
these bugs.

I will change the rationale to

Avoid bugs where shell commands were being called from the MSVC version
of the compiler.

> > Index: fact_table.m
> > ===================================================================
> > RCS file: /home/mercury1/repository/mercury/compiler/fact_table.m,v
> > retrieving revision 1.38
> > diff -u -r1.38 fact_table.m
> > --- fact_table.m	2000/12/07 12:59:06	1.38
> > +++ fact_table.m	2001/02/20 10:02:06
> > @@ -1134,9 +1134,9 @@
> >  	{ map__lookup(ProcTable0, ProcID, ProcInfo0) },
> >  	io__output_stream_name(Stream, FileName),
> >  	io__close_output(Stream),
> > -	{ string__format(
> > -	    "sort -o %s %s && cut -d'~' -f1 %s | sort -cu >/dev/null 2>&1",
> > -	    [s(FileName), s(FileName), s(FileName)], Command) },
> > +	{ make_command_string(string__format(
> > +		"sort -o %s %s && echo hi | sort -cu >/dev/null 2>&1",
> > +		[s(FileName), s(FileName)]), double, Command) },
> 
> The "echo hi" in the middle there looks like a mistake.
> 
It certainly is, I have restored the original command line.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list