[m-rev.] for review: support wildcard argument expansion with MSVC
Julien Fischer
jfischer at opturion.com
Tue Jan 6 21:39:38 AEDT 2026
Hi Zoltan,
On Tue, 6 Jan 2026 at 20:41, Zoltan Somogyi <zoltan.somogyi at runbox.com> wrote:
> > provided you
> > set the --use-msvc-setargv-extension flag to the ml script via the
> > MLFLAGS or EXTRA_MLFLAGS variables. (It obviously does not work
> > for the compiler in general, because mmc --make does not use the ml
> > script.)
>
> Here is one scenario in which it would useful for it to work for mmc.
Agreed, although for immediate purposes it's fine that it's not supported.
Users, and by-and-large developers, are not installing the compiler using
--make.
> > This diff is not intended as a general solution for Mercury users to
> > add wildcard
> > expansion to their own programs.
>
> I understand that. My question is: wouldn't a general solution be more useful?
Of course.
> Yes, I know it would be harder, and I am NOT asking it for it to be in this change.
> However, it would be nice to know whether this part-solution fits into an eventual
> solution for all of mmc, or even for all Mercury programs.
This part solution only works for Mercury itself. A more general solution would:
- Work for more than one C compiler / runtime combination.
- Work for the non-C backends.
- Work for standalone mmc and mmc --make as well as mmake.
In short ....
> We could do it by adding
> a flag to the getopt.m predicate that expands @file arguments, a flag that asks it to
> also expand all glob patterns. I am sure a web search will find existing code for
> glob expansion; we just need to translate it to Mercury.
... it would be this (which is essentially what I suggested earlier in
this thread).
> > I suggest we get Mercury itself working and then worry about if / how we
> > make this available to users.
>
> Agreed. I have no objection to you committing this diff with the updated
> documentation of MSVC_SETARGV.
My immediate motivation for all this BTW, is the ongoing rewrite of
the Windows-related
README files. I don't particularly want to have to add a section
explaining why globbing
*doesn't* work.
Julien.
More information about the reviews
mailing list