These changes are necessary to support remote running compiler-rt tests that were compiled on Windows.
Most of the code here has been copy-pasted from other lit configs.
Differential D83485
[compiler-rt] Better Windows support for running tests in external shell broadwaylamb on Jul 9 2020, 8:36 AM. Authored by
Details These changes are necessary to support remote running compiler-rt tests that were compiled on Windows. Most of the code here has been copy-pasted from other lit configs.
Diff Detail
Event TimelineComment Actions Can you add an explanation for why the conversion to ascii was removed? I don't immediately see why that is needed, not that ascii is a great choice. Comment Actions We set the universal_newlines argument to True in Popen instead. This is supported in both Python 2.7 and 3, is easier (no need to do the str(dir.decode('ascii')) dance) and less error prone. Also, this is necessary because if the config is executed on Windows, and execute_external is True, we take the branch if sys.platform in ['win32'] and execute_external, and if we use Python 3, then the dir variable is a byte-like object, not str, but the replace method on byte-like objects requires its arguments to also be byte-like objects, which is incompatible with Python 2 etc etc. It is a lot simpler to just work with strings in the first place, which is achieved by setting universal_newlines to True. As far as I understand, this way wasn't taken because of the need to support Python <2.7, but this is not the case now. Comment Actions Ah, thanks for the explanation. I'm accepting the change, but would like that explanation also reflected in the commit message. I think that it is very helpful and explains why the change is being made. |