[cfe-dev] Configuration files

Joerg Sonnenberger via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 28 09:07:49 PDT 2016


On Wed, Sep 28, 2016 at 07:57:19PM +0700, Serge Pavlov via cfe-dev wrote:
> 2016-09-28 16:13 GMT+07:00 Joerg Sonnenberger via cfe-dev <
> cfe-dev at lists.llvm.org>:
> 
> > On Wed, Sep 28, 2016 at 01:39:59PM +0700, Serge Pavlov via cfe-dev wrote:
> > > This feature addresses at least two different use cases:
> > >
> > > 1. Config file as a way to override compiler defaults.
> > >
> > > Compiler already has some default settings and it is hardly possible to
> > > find the settings that suit everybody. For instance, the warning
> > > -Wundefined-var-template
> > > is helpful for some users but annoys others. With config file a user
> > could
> > > put new defaults there and thus customize the compiler. No changes to
> > build
> > > script is required. Note, this scenario requires just default config
> > files.
> >
> > This is *exactly* why I am *strongly* against this. Yes, users do that.
> > Afterwards, they start to fill random bug reports against projects that
> > break, because the invocation includes -Werror. This is even worse than
> > setting a global CFLAGS or CXXFLAGS variable since the expansion of
> > those are at least generally visible. Hidden user-modifable sources of
> > flags are a support nightware.
> >
> >
> Users are of different categories. What you say is true for end users, who
> just use
> compiler as a tool. But there are other users, who develop clang based SDKs
> for
> these end users. They would use this feature with more care because support
> problems
> would be their problems. Otherwise such user may want to turn off unwanted
> warnings by
> modifying compiler sources, this is much worse case.

That's why I am not completely opposed to providing target-specific
configuration files.

> > I dare to say that ICC tends to be used in a much more limited
> > environment. If you want to allow magic environmental variables in your
> > build script that are invisible for the casual observer, it is not
> > difficult to add. Well written build systems already support that
> > anyway.
> >
> 
> Environment variable is just another way to specify configuration file, it
> does not
> need modification of build scripts. Convenient for experiments. If we
> support config
> file in any form, there is no additional danger to allow setting up
> configuration via
> environmental variables. It cannot add any option automatically.

If the configuration file is (normally) provided via the command line
that gives others at least a chance of finding out what is going wrong.
That's quite different from environment variables, that are often
invisible until you explicitly look for them. History of UNIX is full of
problems with environment variables.

Joerg



More information about the cfe-dev mailing list