From 2e6e6c0e1f472e6735f48fc74ea5281685b72843 Mon Sep 17 00:00:00 2001 From: Flavio Soibelmann Glock Date: Mon, 27 Apr 2026 16:10:05 +0200 Subject: [PATCH] fix(cpan-tester): initialize $KILL_AFTER before main execution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 1ef073e25 declared `my $KILL_AFTER = 10;` immediately above `sub run_with_timeout` (line 502), but `run_with_timeout` is called from main-line code at line 195 — long before execution reaches the declaration. As a result $KILL_AFTER was undef on every call, producing: Use of uninitialized value $KILL_AFTER in concatenation (.) or string at dev/tools/cpan_random_tester.pl line 509. The resulting command `timeout -k s 300s ...` was rejected by `timeout`, so every module reported `[No parseable output]` and the whole `--count N` run was useless. Move the declaration up next to the other file-scope `my` vars so it's initialized before any call site. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- dev/tools/cpan_random_tester.pl | 2 +- src/main/java/org/perlonjava/core/Configuration.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tools/cpan_random_tester.pl b/dev/tools/cpan_random_tester.pl index fb93eb12f..c50dc8331 100644 --- a/dev/tools/cpan_random_tester.pl +++ b/dev/tools/cpan_random_tester.pl @@ -57,6 +57,7 @@ my $fail_dat = File::Spec->catfile($report_dir, 'cpan-compatibility-fail.dat'); my $skip_dat = File::Spec->catfile($report_dir, 'cpan-compatibility-skip.dat'); my $log_dir = '/tmp/cpan_random_logs'; +my $KILL_AFTER = 10; # seconds between SIGTERM and SIGKILL (used by run_with_timeout) # CPAN package index my $packages_gz = glob('~/.cpan/sources/modules/02packages.details.txt.gz'); @@ -499,7 +500,6 @@ sub parse_all_module_results { # `timeout.exe` there is a sleep-with-countdown, NOT GNU coreutils. # 2. Fallback: fork + setpgrp + kill(-$pid) for platforms without # coreutils (and for Windows, where it degrades to a plain alarm). -my $KILL_AFTER = 10; # seconds between SIGTERM and SIGKILL sub run_with_timeout { my ($cmd, $secs) = @_; diff --git a/src/main/java/org/perlonjava/core/Configuration.java b/src/main/java/org/perlonjava/core/Configuration.java index 7006b264d..e2c37dcd7 100644 --- a/src/main/java/org/perlonjava/core/Configuration.java +++ b/src/main/java/org/perlonjava/core/Configuration.java @@ -33,7 +33,7 @@ public final class Configuration { * Automatically populated by Gradle/Maven during build. * DO NOT EDIT MANUALLY - this value is replaced at build time. */ - public static final String gitCommitId = "cbde1aacd"; + public static final String gitCommitId = "44f0a7e9f"; /** * Git commit date of the build (ISO format: YYYY-MM-DD). @@ -48,7 +48,7 @@ public final class Configuration { * Parsed by App::perlbrew and other tools via: perl -V | grep "Compiled at" * DO NOT EDIT MANUALLY - this value is replaced at build time. */ - public static final String buildTimestamp = "Apr 27 2026 16:05:36"; + public static final String buildTimestamp = "Apr 27 2026 16:10:12"; // Prevent instantiation private Configuration() {