diff options
| author | Leitwolf11 | 2026-11-13 01:54:38 +0300 |
|---|---|---|
| committer | Leitwolf11 | 2026-11-13 01:54:38 +0300 |
| commit | 34acd40e7c520dda4addfc63ed3e26175fb399c5 (patch) | |
| tree | a69fa983f7fa35603d3667ea99bb2c011043cf6c /sources | |
| parent | d73260a011d463f492448bc2e29aa46fba657326 (diff) | |
| download | tazel-feature/action-level-incremental.tar.gz | |
Make Windows objects reproducible so early cutoff holds therefeature/action-level-incremental
The Windows runner showed that a comment in a header recompiled both
units and then archived and relinked, where Linux and macOS stopped
after the compiles. Clang stamps objects for Windows targets with the
time by default, and debug information there records the content of
every header, so the objects always differed.
- Clang gets -mno-incremental-linker-compatible for Windows targets:
the same source gives the same object.
- The early-cutoff part of BuildCommandTest builds in release mode,
without debug information, on every system.
Diffstat (limited to 'sources')
| -rw-r--r-- | sources/main/kotlin/com/progmasoft/tazel/driver/CcCommands.kt | 5 | ||||
| -rw-r--r-- | sources/test/kotlin/com/progmasoft/tazel/cli/BuildCommandTest.kt | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sources/main/kotlin/com/progmasoft/tazel/driver/CcCommands.kt b/sources/main/kotlin/com/progmasoft/tazel/driver/CcCommands.kt index b5f7cdc..e6b1fe0 100644 --- a/sources/main/kotlin/com/progmasoft/tazel/driver/CcCommands.kt +++ b/sources/main/kotlin/com/progmasoft/tazel/driver/CcCommands.kt @@ -110,6 +110,11 @@ class CcCommands(private val plan: BuildPlan, private val compiler: CcCompiler) command += compiler.targetFlags command += listOf("-c", source.toString(), "-o", objectFile.toString()) command += listOf("-MD", "-MF", depfile.toString()) + // For Windows targets Clang stamps objects with the time by default; without the stamp the same + // source gives the same object, so an unchanged object stops the actions after it. + if (os == Os.WINDOWS && compiler.compiler == com.progmasoft.tazel.dsl.Compiler.CLANG) { + command += "-mno-incremental-linker-compatible" + } if (cpp) { settings.cppStandard?.let { command += "-std=" + cppStandard(it, settings.gnuExtensions) } } else { diff --git a/sources/test/kotlin/com/progmasoft/tazel/cli/BuildCommandTest.kt b/sources/test/kotlin/com/progmasoft/tazel/cli/BuildCommandTest.kt index fa5d0d5..3082df3 100644 --- a/sources/test/kotlin/com/progmasoft/tazel/cli/BuildCommandTest.kt +++ b/sources/test/kotlin/com/progmasoft/tazel/cli/BuildCommandTest.kt @@ -136,9 +136,12 @@ class BuildCommandTest { ) // A comment recompiles both units that include the header; their objects come out the same, - // so neither the archive nor the program is made again. + // so neither the archive nor the program is made again. Release builds carry no debug + // information, which on some systems records the content of every header. + val (release, releaseOutput) = tazel(root, ".", processes, "build", "--release", "//...") + assertEquals(ExitCode.SUCCESS, release, releaseOutput.stderr()) Files.writeString(header, "int sample_add(int a, int b); /* changed */\n") - val (comment, commentOutput) = tazel(root, ".", processes, "build", "//...") + val (comment, commentOutput) = tazel(root, ".", processes, "build", "--release", "//...") assertEquals(ExitCode.SUCCESS, comment, commentOutput.stderr()) assertContains(commentOutput.stdout(), "2 command(s) run") |