Example of failure:
https://lab.llvm.org/staging/#/builders/126/builds/345/steps/5/logs/FAIL__lit___use-tool-search-env_py
import lit.llvm
lit.llvm.initialize(lit_config, config)
import os.path
-lit.llvm.llvm_config.with_environment('TOOL_LOCATION', os.path.dirname(__file__) + '/test.tool')
+path = os.path.realpath(os.path.join(os.path.dirname(__file__), 'test.tool'))
+lit.llvm.llvm_config.with_environment('TOOL_LOCATION', path)
lit.llvm.llvm_config.use_llvm_tool('test-tool', search_env='TOOL_LOCATION')