[cfe-dev] Command line encoding in JSON Compilation Database

Chandler Carruth chandlerc at google.com
Fri Jul 6 01:02:18 PDT 2012


If I recall the reasoning that went into it, it had to do with some of the
build system limitations.

If the build system doesn't have an array, and instead has a string which
happens to be properly quoted for the system's shell to expand, I wouldn't
want the producer of the JSON database to be responsible for correctly
parsing this into an array. Essentially, we didn't want produces to have to
have a working parser for a line of shell. Sadly, I think there are quite a
few systems in this category where there isn't a clear argument array
intrinsically available.

I see three options:
1) Keep this as it is. What use cases would you have for changing it? What
does it hurt the way it is now? Just that you have to run the string
through the shell?

2) Allow either form -- a string or an array. I don't really like this
because people would want to take advantage of the array form but it
wouldn't always be there.

3) Require the array form. Maybe it's easier than I'm imagining to parse
the strings into an array for each build system. If so, we could just go
all the way here.


On Fri, Jul 6, 2012 at 12:39 AM, Florian Weimer <fweimer at redhat.com> wrote:

> According to http://clang.llvm.org/docs/JSONCompilationDatabase.html,
> the JSON Compilation Database uses a single string to describe the
> actual compile command, and not an array.  Is this string subject to any
> kind of shell expansion?  How is it supposed to be parsed into an argv
> array?
>
> --
> Florian Weimer / Red Hat Product Security Team
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120706/6fb060ad/attachment.html>


More information about the cfe-dev mailing list