diff --git a/local/scripts/migrate-kf6-seds-to-patches.sh b/local/scripts/migrate-kf6-seds-to-patches.sh index 58ef876211..5558b15dfd 100755 --- a/local/scripts/migrate-kf6-seds-to-patches.sh +++ b/local/scripts/migrate-kf6-seds-to-patches.sh @@ -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" \ diff --git a/local/scripts/tests/test_migrate_kf6_seds.py b/local/scripts/tests/test_migrate_kf6_seds.py index 675f824042..eb51db86a7 100644 --- a/local/scripts/tests/test_migrate_kf6_seds.py +++ b/local/scripts/tests/test_migrate_kf6_seds.py @@ -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()