[PATCH] D38010: lit.py: Allow configs and local configs to have a setup_script entry

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 16:09:20 PDT 2017


zturner added a comment.

In https://reviews.llvm.org/D38010#875713, @jordan_rose wrote:

> > You mentioned you want to make this work with the multiprocessing pool. That worries me a little bit because different processes are going to be using the same shared output dir (which isn't created up front by the infrastructure), if I understand correctly. Like if you have A and A/B and A/C, then we will run the setup script 3 times in parallel all using the same shared output folder. Is this going to be a source of flakiness?
>
> Ah, that's not what happens. In the scenario you described, the script gets run for A/Output/Shared, A/B/Output/Shared, and A/C/Output/Shared. There's no feature (currently) for having a common `%shared_output` across multiple test directories because I didn't want to deal with synchronization. (Something like that would mean bringing back `%T`, though perhaps under a different name.)


I'm just brainstorming here, but what if a local config could say something like:

  # lit.local.cfg
  config.use_shared_output_folder('foo')

The implementation of this function would just find the output directory using the site config (which should already be created), and create this folder under there.

We only ever run the local config once, although we pass the resulting `TestingConfig` object to each subtest.  So there would be no need to worry about parallelization.

This really only supports the single use case of a shared output directory though, and not running arbitrarily complex scripts.  But if all you need is a shared output folder, maybe this is sufficient?


https://reviews.llvm.org/D38010





More information about the llvm-commits mailing list