Currently the behavior with relative paths is pretty broken. It differs
between external shell and internal shell because the path resolution
is done with a different working directory. With the internal shell,
it's resolved relative to the directory from which lit is executed,
whereas with the external shell it's resolved relative to where the
test case is executed. To make matters worse, using the internal shell
the filepath to binaries looked up with which is returned relative
to the directory from which lit is executed, but then executed from
the test execution directory. That means that relative paths with the
internal shell give a [Errno 2] No such file or directory error
instead of the expected command not found.
To address these issues this patch makes lit interpret relative paths
as relative to the directory from which lit was invoked and modifies
which to return absolute paths, matching the behavior of its
namesake unix function.
See https://groups.google.com/g/llvm-dev/c/KzMWlOXR98Y/m/QJoqn0U5HAAJ
Could we replace this block by specifying type=os.path.abspath as the "converter" function where the --path argument is declared?