migrate-kf6-seds: add 600s timeout on per-recipe cook (C-7)

Several KF6 recipes (kf6-kauth, kf6-kconfig, kf6-kwidgetsaddons)
use autotools and their `autoreconf` step can take 5+ minutes
on a clean cook. Without a per-recipe timeout, a hung cook
blocks the migration script indefinitely and leaves
`source-pristine/` snapshots lingering on disk.

The sed chain we care about runs in the recipe's [build].script
BEFORE the configure step, so a 10-minute window is plenty.
The snapshot at step 2 is already on disk, so even if the
cook is killed by the timeout, the post-cook source state
is still useful for the diff.

Adds test_cook_has_timeout regression test (123 Python tests
total). All 7 test files pass.
This commit is contained in:
2026-06-12 17:52:06 +03:00
parent 761cb2b98a
commit 07f924fe09
2 changed files with 24 additions and 1 deletions
+11 -1
View File
@@ -166,7 +166,17 @@ for recipe_dir in "${recipe_dirs[@]}"; do
# the build script; we don't care if the build itself fails —
# we only need the post-sed source state, which the sed
# commands apply before the actual build step).
./target/release/repo cook "$name" >>"$log_file" 2>&1 || true
#
# A 600-second timeout is applied because some upstream
# recipes (e.g. kf6-kauth, kf6-kconfig, kf6-kwidgetsaddons)
# use autotools and their `autoreconf` step can take 5+
# minutes on a clean cook. The sed chain we care about
# is applied by the recipe's [build].script BEFORE the
# configure step, so a 10-minute window is plenty for the
# sed to apply (and the snapshot was already taken at
# Step 2, so even if the cook is killed by the timeout,
# the post-cook source state is still useful for the diff).
timeout 600 ./target/release/repo cook "$name" >>"$log_file" 2>&1 || true
# Step 4: diff pristine vs post-cook.
diff_out=$(diff -ruN "$pristine_dir" "$recipe_dir/source" \
@@ -206,6 +206,19 @@ class TestScriptStructure(unittest.TestCase):
self.assertGreater(fetch_pos, 0, "fetch not found")
self.assertLess(unfetch_pos, fetch_pos, "unfetch must come before fetch")
def test_cook_has_timeout(self):
# Some upstream KF6 recipes (kf6-kauth, kf6-kconfig,
# kf6-kwidgetsaddons) use autotools and the autoreconf
# step can take 5+ minutes. Without a timeout, a hung
# cook would block the migration script indefinitely.
# The script must apply a per-recipe timeout.
text = SCRIPT.read_text()
self.assertRegex(
text,
r'timeout\s+\d+\s+./target/release/repo\s+cook',
"cook call must be wrapped in `timeout N`",
)
if __name__ == "__main__":
unittest.main()