[all-commits] [llvm/llvm-project] a89d54: [compiler-rt] Better Windows support for running t...
Sergej Jaskiewicz via All-commits
all-commits at lists.llvm.org
Thu Jul 9 09:40:51 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: a89d54fd61a6e7a05f7434491135e667306a22e7
https://github.com/llvm/llvm-project/commit/a89d54fd61a6e7a05f7434491135e667306a22e7
Author: Sergej Jaskiewicz <jaskiewiczs at icloud.com>
Date: 2020-07-09 (Thu, 09 Jul 2020)
Changed paths:
M compiler-rt/test/builtins/Unit/lit.cfg.py
M compiler-rt/test/crt/lit.cfg.py
Log Message:
-----------
[compiler-rt] Better Windows support for running tests in external shell
Summary:
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.
Why do we remove the conversions to ASCII in the crt config?
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.
Reviewers: compnerd, phosek, weimingz
Reviewed By: compnerd
Subscribers: dberris, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D83485
More information about the All-commits
mailing list