From d2057c53bd91ffb96d46d4ee71cc8029d30d6d49 Mon Sep 17 00:00:00 2001 From: David Steele Date: Sun, 24 Jan 2021 15:06:38 -0500 Subject: [PATCH] Use YAML::Any module instead of YAML::XS in Perl. YAML::XS requires libyaml so it not as portable as pure Perl versions of YAML. Instead of using YAML:PP just use the general YAML::Any module which uses whatever is installed. We are not concerned about performance for YAML so whatever works is fine. --- build/lib/pgBackRestBuild/Error/Data.pm | 4 ++-- doc/xml/contributing.xml | 2 +- test/Vagrantfile | 2 +- test/ci.pl | 2 +- test/lib/pgBackRestTest/Common/CodeCountTest.pm | 4 ++-- test/lib/pgBackRestTest/Common/ContainerTest.pm | 4 ++-- test/lib/pgBackRestTest/Common/DefineTest.pm | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build/lib/pgBackRestBuild/Error/Data.pm b/build/lib/pgBackRestBuild/Error/Data.pm index c869f5957..8b88ad8c1 100644 --- a/build/lib/pgBackRestBuild/Error/Data.pm +++ b/build/lib/pgBackRestBuild/Error/Data.pm @@ -31,8 +31,8 @@ sub errorDefineLoad { my $strErrorYaml = shift; - require YAML::XS; - YAML::XS->import(qw(Load)); + require YAML::Any; + YAML::Any->import(qw(Load)); $rhErrorDefine = Load($strErrorYaml); } diff --git a/doc/xml/contributing.xml b/doc/xml/contributing.xml index 5098af5dc..0b561b687 100644 --- a/doc/xml/contributing.xml +++ b/doc/xml/contributing.xml @@ -69,7 +69,7 @@ apt-get install rsync git devscripts build-essential valgrind lcov autoconf autoconf-archive libssl-dev zlib1g-dev libxml2-dev libpq-dev pkg-config - libxml-checker-perl libyaml-libyaml-perl libdbd-pg-perl liblz4-dev liblz4-tool + libxml-checker-perl libyaml-perl libdbd-pg-perl liblz4-dev liblz4-tool zstd libzstd-dev bzip2 libbz2-dev -y 2>&1 diff --git a/test/Vagrantfile b/test/Vagrantfile index 37574f875..c2057531b 100644 --- a/test/Vagrantfile +++ b/test/Vagrantfile @@ -70,7 +70,7 @@ Vagrant.configure(2) do |config| #----------------------------------------------------------------------------------------------------------------------- echo 'Install Perl Modules' && date - apt-get install -y libdbd-pg-perl libxml-checker-perl libyaml-libyaml-perl + apt-get install -y libdbd-pg-perl libxml-checker-perl libyaml-perl #----------------------------------------------------------------------------------------------------------------------- echo 'Install Build Tools' && date diff --git a/test/ci.pl b/test/ci.pl index 249a17e7e..cd60ca4af 100755 --- a/test/ci.pl +++ b/test/ci.pl @@ -133,7 +133,7 @@ eval processBegin('install common packages'); processExec('sudo apt-get -qq update', {bSuppressStdErr => true, bSuppressError => true}); - processExec('sudo apt-get install -y libxml-checker-perl libyaml-libyaml-perl', {bSuppressStdErr => true}); + processExec('sudo apt-get install -y libxml-checker-perl libyaml-perl', {bSuppressStdErr => true}); processEnd(); processBegin('mount tmpfs'); diff --git a/test/lib/pgBackRestTest/Common/CodeCountTest.pm b/test/lib/pgBackRestTest/Common/CodeCountTest.pm index 3e3849689..975d0d41b 100644 --- a/test/lib/pgBackRestTest/Common/CodeCountTest.pm +++ b/test/lib/pgBackRestTest/Common/CodeCountTest.pm @@ -27,8 +27,8 @@ sub codeCountScan my $strBasePath = shift; # Load YAML - require YAML::XS; - YAML::XS->import(qw(Load Dump)); + require YAML::Any; + YAML::Any->import(qw(Load Dump)); my $hCodeCount = {}; diff --git a/test/lib/pgBackRestTest/Common/ContainerTest.pm b/test/lib/pgBackRestTest/Common/ContainerTest.pm index 4c56755f0..23caf7adc 100755 --- a/test/lib/pgBackRestTest/Common/ContainerTest.pm +++ b/test/lib/pgBackRestTest/Common/ContainerTest.pm @@ -301,8 +301,8 @@ sub containerBuild $oStorageDocker->pathCreate($strTempPath, {strMode => '0770', bIgnoreExists => true, bCreateParent => true}); # Load container definitions from yaml - require YAML::XS; - YAML::XS->import(qw(Load)); + require YAML::Any; + YAML::Any->import(qw(Load)); $hContainerCache = Load(${$oStorageDocker->get($oStorageDocker->pathGet('test/container.yaml'))}); diff --git a/test/lib/pgBackRestTest/Common/DefineTest.pm b/test/lib/pgBackRestTest/Common/DefineTest.pm index 8bfbabf9e..a69c2c30c 100644 --- a/test/lib/pgBackRestTest/Common/DefineTest.pm +++ b/test/lib/pgBackRestTest/Common/DefineTest.pm @@ -87,8 +87,8 @@ sub testDefLoad my $strDefineYaml = shift; # Load test definitions from yaml - require YAML::XS; - YAML::XS->import(qw(Load)); + require YAML::Any; + YAML::Any->import(qw(Load)); my $hTestDef = Load($strDefineYaml);