diff --git a/.github/actions/setup-strawberry-perl/action.yml b/.github/actions/setup-strawberry-perl/action.yml index f3fd6c3550..6bbb548d0f 100644 --- a/.github/actions/setup-strawberry-perl/action.yml +++ b/.github/actions/setup-strawberry-perl/action.yml @@ -56,6 +56,7 @@ runs: perl C:\Strawberry\perl\bin\cpanm --notest ^ Authen::NTLM ^ Date::Manip ^ + DateTime ^ Email::Send::SMTP::Gmail ^ HTTP::ProxyPAC ^ IO::Socket::SSL ^ diff --git a/.github/scripts/windows/pp-modules.txt b/.github/scripts/windows/pp-modules.txt index 55b1db8453..cca7aa82a6 100644 --- a/.github/scripts/windows/pp-modules.txt +++ b/.github/scripts/windows/pp-modules.txt @@ -15,6 +15,7 @@ Tie::RefHash::Weak Win32::Job XML::LibXML::SAX Safe +Specio::PP apps::backup::backupexec::local::plugin apps::backup::backupexec::local::mode::alerts apps::backup::backupexec::local::mode::disks diff --git a/.github/workflows/packaging-plugins-windows.yml b/.github/workflows/packaging-plugins-windows.yml index 6696e3b4a3..a4657d846f 100644 --- a/.github/workflows/packaging-plugins-windows.yml +++ b/.github/workflows/packaging-plugins-windows.yml @@ -106,6 +106,17 @@ jobs: } Write-Host "Standalone version smoke-test OK." + # The WSUS synchronization mode uses DateTime, whose Specio + # implementation is selected dynamically. Ensure the pure-Perl + # implementation is embedded and the mode can load without Perl on PATH. + $wsus = & $exe --plugin apps::microsoft::wsus::local::plugin --mode synchronisation-status --help 2>&1 | Out-String + Write-Host $wsus + if ($wsus -match 'Cannot load module' -or $wsus -notmatch 'critical-last-synchronisation-status') { + Write-Error "WSUS synchronization mode failed to load from the standalone executable." + exit 1 + } + Write-Host "WSUS synchronization mode smoke-test OK." + # Exercise each HTTP backend with a real request so its native XS stack is # loaded (lwp -> Net::SSLeay/OpenSSL; curl -> Net::Curl/libcurl, loaded # lazily only on an actual curl request). The target port is dead, so the diff --git a/src/apps/microsoft/wsus/local/mode/synchronisationstatus.pm b/src/apps/microsoft/wsus/local/mode/synchronisationstatus.pm index 60f1010dc8..be1f25ebb6 100644 --- a/src/apps/microsoft/wsus/local/mode/synchronisationstatus.pm +++ b/src/apps/microsoft/wsus/local/mode/synchronisationstatus.pm @@ -20,6 +20,12 @@ package apps::microsoft::wsus::local::mode::synchronisationstatus; +# Specio's XS implementation is loaded dynamically and is not reliably +# detected by PAR::Packer. Force its bundled pure-Perl implementation on Windows. +BEGIN { + $ENV{SPECIO_IMPLEMENTATION} = 'PP' if $^O eq 'MSWin32'; +} + use base qw(centreon::plugins::templates::counter); use strict;