|
4 | 4 | from buildbot.plugins import util |
5 | 5 | from buildbot.steps.shell import ShellCommand, SetProperty |
6 | 6 | from buildbot.steps.shell import WarningCountingShellCommand |
| 7 | +from buildbot.steps.transfer import StringDownload |
7 | 8 |
|
8 | 9 | import zorg.buildbot.builders.Util as builders_util |
9 | 10 |
|
@@ -435,32 +436,28 @@ def _getClangCMakeBuildFactory( |
435 | 436 | # Absolute paths to just built compilers. |
436 | 437 | # Note: Backslash path separators do not work well with cmake and ninja. |
437 | 438 | # Forward slash path separator works on Windows as well. |
438 | | - stage1_cc = InterpolateToPosixPath( |
439 | | - f"%(prop:builddir)s/{stage1_install}/bin/{cc}") |
440 | | - stage1_cxx = InterpolateToPosixPath( |
441 | | - f"%(prop:builddir)s/{stage1_install}/bin/{cxx}") |
| 439 | + stage1_cc = f"%(prop:builddir)s/{stage1_install}/bin/{cc}" |
| 440 | + stage1_cxx = f"%(prop:builddir)s/{stage1_install}/bin/{cxx}" |
442 | 441 |
|
443 | 442 | # If stage2_toolchain_options is set when we'll use a toolchain file |
444 | 443 | # to specify the compiler being used (the just-built stage1) and add |
445 | 444 | # any stage2_toolchain_options to it. Otherwise, just set |
446 | 445 | # -DCMAKE_{C,CXX}_COMPILER. |
447 | 446 | if stage2_toolchain_options is None: |
448 | 447 | compiler_args = [ |
449 | | - f"-DCMAKE_C_COMPILER={stage1_cc}", |
450 | | - f"-DCMAKE_CXX_COMPILER={stage1_cxx}" |
| 448 | + InterpolateToPosixPath(f"-DCMAKE_C_COMPILER={stage1_cc}"), |
| 449 | + InterpolateToPosixPath(f"-DCMAKE_CXX_COMPILER={stage1_cxx}"), |
451 | 450 | ] |
452 | 451 | else: |
453 | | - toolchain_file = InterpolateToPosixPath( |
454 | | - f"%(prop:builddir)s/{stage2_build}/stage1-toolchain.cmake") |
455 | | - with open(toolchain_file, 'w') as file: |
456 | | - file.write(f"set(CMAKE_C_COMPILER {stage1_cc})\n") |
457 | | - file.write(f"set(CMAKE_CXX_COMPILER {stage1_cxx})\n") |
458 | | - for option in stage2_toolchain_options: |
459 | | - file.write(f"{option}\n") |
| 452 | + toolchain_file = f"%(prop:builddir)s/{stage2_build}/stage1-toolchain.cmake" |
| 453 | + toolchain_file_contents = "\n".join([ |
| 454 | + f"set(CMAKE_C_COMPILER {stage1_cc})", |
| 455 | + f"set(CMAKE_CXX_COMPILER {stage1_cxx})", |
| 456 | + ] + stage2_toolchain_options) |
| 457 | + f.addStep(StringDownload(util.Interpolate(toolchain_file_contents), |
| 458 | + workerdest=InterpolateToPosixPath(toolchain_file))) |
| 459 | + compiler_args = [InterpolateToPosixPath(f"-DCMAKE_TOOLCHAIN_FILE={toolchain_file}")] |
460 | 460 |
|
461 | | - compiler_args = [ |
462 | | - "-DCMAKE_TOOLCHAIN_FILE={toolchain_file}" |
463 | | - ] |
464 | 461 |
|
465 | 462 | # If we have a separate stage2 cmake arg list, then ensure we re-apply |
466 | 463 | # enable_projects and enable_runtimes if necessary. |
|
0 commit comments