Skip to content

Commit 63f4946

Browse files
committed
[dexter] Fix feature tests on Windows
First, add LLD as a dependency on Windows. The windows batch scripts pass -fuse-ld=lld, so they need it. Second, decode builder stdout/stderr even if the command fails. Otherwise it gets printed as b'line 1\n\rline 2\n\r'. Last, make the batch script one line less noisy. We might want to try to do more here, though. It would be nice if we could get as close to possible as lit, where you can literally copy & paste the failing command to re-run it. With the two changes above, now the feature tests that use clang++.bat pass for me. The clang-cl_vs2015 ones still fail, and I'll fix them separately. Reviewers: jmorse Differential Revision: https://reviews.llvm.org/D69725
1 parent 7035ea6 commit 63f4946

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

debuginfo-tests/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ set(DEBUGINFO_TEST_DEPS
1313
not
1414
)
1515

16+
# The Windows builder scripts pass -fuse-ld=lld.
17+
if (WIN32)
18+
set(DEBUGINFO_TEST_DEPS ${DEBUGINFO_TEST_DEPS} lld)
19+
endif()
20+
1621
# If we don't already have Python 3, throw away any previous results and try to
1722
# find it again.
1823
set(DEBUGINFO_UNSET_PYTHON3 OFF)

debuginfo-tests/dexter/dex/builder/Builder.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,14 @@ def run_external_build_script(context, script_path, source_files,
8080
stderr=subprocess.PIPE)
8181
out, err = process.communicate()
8282
returncode = process.returncode
83+
out = out.decode('utf-8')
84+
err = err.decode('utf-8')
8385
if returncode != 0:
8486
raise BuildScriptException(
8587
'{}: failed with returncode {}.\nstdout:\n{}\n\nstderr:\n{}\n'.
8688
format(script_path, returncode, out, err),
8789
script_error=err)
88-
return out.decode('utf-8'), err.decode('utf-8'), builderIR
90+
return out, err, builderIR
8991
except OSError as e:
9092
raise BuildScriptException('{}: {}'.format(e.strerror, script_path))
9193

debuginfo-tests/dexter/dex/builder/scripts/windows/clang.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
setlocal EnableDelayedExpansion
1+
@setlocal EnableDelayedExpansion
22

33
for %%I in (%SOURCE_INDEXES%) do (
44
%PATHTOCLANGPP% -fuse-ld=lld -c !COMPILER_OPTIONS_%%I! !SOURCE_FILE_%%I! -o !OBJECT_FILE_%%I!

0 commit comments

Comments
 (0)