Skip to content

Commit 483e0ee

Browse files
omjavaidvvereschaka
authored andcommitted
Fix ClangBuilder for running LNT on Windows (llvm#575)
This PR adds support for running the LLVM test-suite on Windows buildbots using ClangBuilder. The changes ensure that the correct executable paths and file extensions are used when running Python and LNT scripts on Windows. This depends on llvm/llvm-project#155226 which adds llvm-lit.cmd wrapper to make llvm-lit directory runnable on windows.
1 parent ac13274 commit 483e0ee

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

zorg/buildbot/builders/ClangBuilder.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -533,17 +533,18 @@ def _getClangCMakeBuildFactory(
533533
env=env))
534534

535535
# Get generated python, lnt
536-
python = util.Interpolate('%(prop:builddir)s/test/sandbox/bin/python')
537-
lnt = util.Interpolate('%(prop:builddir)s/test/sandbox/bin/lnt')
538-
lnt_setup = util.Interpolate('%(prop:builddir)s/test/lnt/setup.py')
536+
python = InterpolateToPosixPath('%(prop:builddir)s/test/sandbox/Scripts/python')
537+
lnt_ext = '.exe' if vs else ''
538+
lnt = InterpolateToPosixPath(f'%(prop:builddir)s/test/sandbox/Scripts/lnt{lnt_ext}')
539+
lnt_setup = InterpolateToPosixPath('%(prop:builddir)s/test/lnt/setup.py')
539540

540541
# Paths
541-
sandbox = util.Interpolate('%(prop:builddir)s/test/sandbox')
542-
test_suite_dir = util.Interpolate('%(prop:builddir)s/test/test-suite')
542+
sandbox = InterpolateToPosixPath('%(prop:builddir)s/test/sandbox')
543+
test_suite_dir = InterpolateToPosixPath('%(prop:builddir)s/test/test-suite')
543544

544545
# Get latest built Clang (stage1 or stage2)
545-
cc = util.Interpolate(f'%(prop:builddir)s/{compiler_path}/bin/{cc}')
546-
cxx = util.Interpolate(f'%(prop:builddir)s/{compiler_path}/bin/{cxx}')
546+
cc = InterpolateToPosixPath(f'%(prop:builddir)s/{compiler_path}/bin/{cc}')
547+
cxx = InterpolateToPosixPath(f'%(prop:builddir)s/{compiler_path}/bin/{cxx}')
547548

548549
# LNT Command line (don't pass -jN. Users need to pass both --threads
549550
# and --build-threads in nt_flags/test_suite_flags to get the same effect)
@@ -558,7 +559,7 @@ def _getClangCMakeBuildFactory(
558559
# Append any option provided by the user
559560
test_suite_cmd.extend(nt_flags)
560561
else:
561-
lit = util.Interpolate(f'%(prop:builddir)s/{stage1_build}/bin/llvm-lit')
562+
lit = InterpolateToPosixPath(f'%(prop:builddir)s/{stage1_build}/bin/llvm-lit')
562563
test_suite_cmd = [python, lnt, 'runtest', 'test-suite',
563564
'--no-timestamp',
564565
'--sandbox', sandbox,
@@ -567,7 +568,7 @@ def _getClangCMakeBuildFactory(
567568
'--cxx', cxx,
568569
'--use-lit', lit,
569570
# Carry on building even if there is a failure.
570-
'--build-tool-options', '"-k"']
571+
'--build-tool-options', '"-k 0"' if '--use-make=ninja' in testsuite_flags else '"-k"']
571572
# Enable fortran if flang is checked out
572573
if checkout_flang:
573574
fortran_flags = [

0 commit comments

Comments
 (0)