<div><div class="gmail_extra"><div class="gmail_quote">On 19 Sep 2016 1:10 pm, "Joerg Sonnenberger via cfe-dev" <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">On Mon, Sep 19, 2016 at 11:05:59AM +0100, Renato Golin via cfe-dev wrote:<br>
> You said:<br>
>  * If no config file is found, do nothing<br>
>  * If the default config is found, pre-pend (not append, because of<br>
> last-seen effect) all the options to the user's command line<br>
><br>
> I'd add:<br>
>  * If there's a system default (/etc/llvm/default.cfg), silently use that<br>
>  * If there's a user default (~/.llvm/default.cfg), silently *replace*<br>
> the system config<br>
>  * If Clang uses the option "--config foo.cfg", *replace* any other,<br>
> with reverse search patch (first local dir, then ~/.llvm, then<br>
> /etc/llvm)<br>
>  * Allow the user to omit the ".cfg" extension, or not even create it<br>
> in the first place (I prefer it that way, see below)<br>
>  * Clang -v and -### to show which configuration it's using (full path)<br>
<br>
</div>While a system default can be somewhat reasonable, I'm *strongly*<br>
opposed to magic user defaults. Speaking with a cross-OS packaging<br>
system in mind that allows unprivileged operation, it is begging for<br>
another set of difficult to impossible to reproduce failure conditions.<br>
In short: Only pull in configuration files if they are either explicitly<br>
requested OR come from a fixed location in the compiler installation<br>
prefix. Most importantly, do not just randomly include configuration<br>
files in the current directory either. That can easily result in hard to<br>
trace down race conditions. The advantage gained by saving a command<br>
line option doesn't justify the cost, IMO.<br></blockquote></div></div></div><div><br></div><div>I'm inclined to agree. And I'd note that we already support @file as a command line argument to read additional flags from a file, which seems to address at least a significant component of this.</div><div><br></div><div>One place where we seem to be missing a good answer is the default mapping from targets to sysroots and associated paths. We currently hardcode a lot of this into the compiler itself; perhaps an installation-wide or command-line-provided config file for that would be more useful.</div><div><br></div><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Joerg<br>
<div class="elided-text">______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</div></blockquote></div><br></div></div>