[llvm] [lit] Add an option to read an xfail list from a file (PR #163959)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 21 07:12:10 PDT 2025


https://github.com/DavidSpickett commented:

Eventually you would hit shell size limits too, so this is a bit like clang's response files (the ones you write options in because they're too long). Your alternative is the environment variable, but it will have its own size limits.

Shame there isn't a way to disambiguate a file path to the existing option. We could see if the string given was an existing file, but if the path/pattern of an xfail is the path of a file, that can't work. Plus it doesn't clearly look like it's being passed as a file to anyone reading the code.

> --xfail-from-file

Let me guess some of the naming logic.
* `--xfail-list` is ok but it doesn't make it clear it wants a file (could just be another name for the existing option).
* `--xfail-file` could either be a file containing xfails, or a single path of a test you want to xfail.
* `--xfails-from-file` (plural) sounds logical, but the existing option isn't pluralised so it would be inconsistent.

I am fine with the name on that basis.

The main thing I'd like to see here is it made clear that that's all this is, existing options but with values taken from a file.

...which makes me wonder should lit have the option to take all of its options from a file? We have other arguments with values like this.

Python argparse supports this https://docs.python.org/3/library/argparse.html#fromfile-prefix-chars

Could that work for you?

https://github.com/llvm/llvm-project/pull/163959


More information about the llvm-commits mailing list