[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests
Abhina Sree via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 25 06:22:37 PST 2021
abhina.sreeskantharajan added a comment.
In D95246#2587452 <https://reviews.llvm.org/D95246#2587452>, @jhenderson wrote:
> In D95246#2587410 <https://reviews.llvm.org/D95246#2587410>, @ASDenysPetrov wrote:
>
>> @jhenderson
>> I think I'm done.
>> Here is output: F15648076: linker_trace_output.txt <https://reviews.llvm.org/F15648076>
>> Is it OK now?
>
> Thanks, yes that does the trick. As I expected, you can see that all the libraries that are used are contained withing the msys2/mingw subdirectory, and therefore are not the standard Windows SDK files that you would typically use for a Windows build using Visual Studio. One of those will contain the definitions we are talking about.
>
> @abhina.sreeskantharajan - I think you could this issue in one of two ways. One would be to detect when the tools/libraries used are within the msys2/mingw installation. Another way might be to actually build and run a miniature program at CMake time that prints out the messages, in such a way that CMake can inspect the output and use it to populate the lit configuration. Note: I am not a CMake expert, so don't know if this is strictly possible. The advantage of this approach is that you can remove the reliance on the system.platform call in python, and just always use the output of this simple program.
Thanks, I'm also not sure if the second way is possible. I had another idea but I will need @ASDenysPetrov to test it out.
Does the following python program print out the correct error string for you?
import errno
import os
print ( os.strerror(errno.ENOENT))
If so, we can use this as the error message instead of hardcoding it per platform.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95246/new/
https://reviews.llvm.org/D95246
More information about the cfe-commits
mailing list