[PATCH] D37838: [lit] Allow lit config files to have a .py extension

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 18:14:46 PDT 2017


rnk added a comment.

In https://reviews.llvm.org/D37838#870372, @zturner wrote:

> In https://reviews.llvm.org/D37838#870368, @rnk wrote:
>
> > `lit.cfg.py` still isn't a valid name for a python module. I had this idea that in the future we'd import the config module directly to simplify custom test formats defined in lit configuration files, which interact badly with multiprocessing.Pool. I guess that won't work well anyway since all the config files will have the same name, so we still have to move custom test formats out into well-named python modules.
>
>
> Could we work around this by using `__import__` or something or searching for a module loader with a given path, and just assigning a dynamically generated name to the module?  Not trying to do anything like that with this patch by the way.


I think we could do something crazy like that.

> If it makes things simpler, I could call it `lit_cfg.py`?

It probably won't make the __import__ stuff simpler, so leaving it as lit.cfg.py seems more consistent with our current lit.site.cfg naming.


https://reviews.llvm.org/D37838





More information about the llvm-commits mailing list