This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Enable nested configuration files
ClosedPublic

Authored by sepavloff on Oct 20 2022, 7:12 AM.

Details

Summary

Users may partition parameters specified by configuration file and put
different groups into separate files. These files are inserted into the
main file using constructs @file. Relative file names in it are
resolved relative to the including configuration file and this is not
convenient in some cases. A configuration file, which resides in system
directory, may need to include a file with user-defined parameters and
still provide default definitions if such file is absent.

To solve such problems, the option --config is allowed inside
configuration files. Like @file it results in insertion of
command-line arguments but the algorithm of file search is different and
allows overriding system definitions with user ones.

Diff Detail

Event Timeline

sepavloff created this revision.Oct 20 2022, 7:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 7:12 AM
sepavloff requested review of this revision.Oct 20 2022, 7:12 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 20 2022, 7:12 AM

I like this more than the alternative solution. The code still has some complexity but the behavior is fairly logical and consistent.

sepavloff updated this revision to Diff 474455.Nov 9 2022, 11:33 PM

Rebase patch

mgorny added inline comments.Nov 14 2022, 10:23 PM
llvm/lib/Support/CommandLine.cpp
1213–1220

Not sure if we want to add extra complexity for the legacy spelling here. @MaskRay, what do you think?

MaskRay added inline comments.Nov 14 2022, 10:26 PM
llvm/lib/Support/CommandLine.cpp
1213–1220

I agree. Supporting just --config= suffices.

Removed support of --config file.

sepavloff updated this revision to Diff 475400.Nov 15 2022, 2:52 AM

Missed changes in tests

mgorny accepted this revision.Nov 15 2022, 6:47 AM

LGTM (without testing, just eyeball review).

This revision is now accepted and ready to land.Nov 15 2022, 6:47 AM
MaskRay accepted this revision.Nov 15 2022, 10:23 AM

To solve such problems, the option --config is allowed inside ...

--config=

clang/docs/UsersManual.rst
989

--config=

This revision was automatically updated to reflect the committed changes.