Fix CI: install Perl deps and stub PVE::SafeSyslog for syntax check

perl -c requires all modules to be loadable at compile time. PVE::SafeSyslog
only exists on Proxmox VE hosts, so the syntax check always failed on
GitHub Actions runners. Fix:
- Install real Perl deps via apt (libwww-perl, libio-socket-ssl-perl,
  librest-client-perl, libjson-perl)
- Create a minimal stub for PVE::SafeSyslog so perl -c can load FreeNAS.pm
- Pass -I/tmp/pve-stub to perl -c so the stub is found

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Kevin Adams 2026-05-15 15:05:29 -04:00
parent ce84a857c4
commit 84cc862bed
1 changed files with 8 additions and 2 deletions

View File

@ -26,13 +26,19 @@ jobs:
- name: Install lint tools - name: Install lint tools
run: | run: |
sudo apt-get update -qq sudo apt-get update -qq
sudo apt-get install -y shellcheck libperl-critic-perl sudo apt-get install -y \
shellcheck libperl-critic-perl \
libwww-perl libio-socket-ssl-perl librest-client-perl libjson-perl
# PVE::SafeSyslog only exists on Proxmox hosts; stub it for syntax checking
mkdir -p /tmp/pve-stub/PVE
printf 'package PVE::SafeSyslog;\nuse Exporter "import";\nour @EXPORT = qw(syslog);\nsub syslog {}\n1;\n' \
> /tmp/pve-stub/PVE/SafeSyslog.pm
- name: Perl syntax check (all modules) - name: Perl syntax check (all modules)
run: | run: |
echo "==> Checking Perl syntax..." echo "==> Checking Perl syntax..."
find perl5 stable-*/perl5 -name "*.pm" -print0 \ find perl5 stable-*/perl5 -name "*.pm" -print0 \
| xargs -0 -I{} perl -c {} \ | xargs -0 -I{} perl -c -I/tmp/pve-stub {} \
&& echo "All .pm files OK" && echo "All .pm files OK"
- name: Perl static analysis (perlcritic) - name: Perl static analysis (perlcritic)