Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARG PERL_VERSION=5.42
FROM perldocker/perl-tester:${PERL_VERSION}

ARG USER_UID=1000
ARG USER_GID=1000

RUN groupadd -g ${USER_GID} perl \
&& useradd -m -u ${USER_UID} -g ${USER_GID} -s /bin/bash perl \
&& mkdir -p /opt/perl5 /home/perl/.cpanm /tmp/build \
&& chown -R perl:perl /opt/perl5 /home/perl /tmp/build

ENV PERL_LOCAL_LIB_ROOT=/opt/perl5 \
PERL_MB_OPT="--install_base /opt/perl5" \
PERL_MM_OPT="INSTALL_BASE=/opt/perl5" \
PERL5LIB=/opt/perl5/lib/perl5
ENV PATH=/opt/perl5/bin:${PATH}

USER perl
WORKDIR /home/perl
8 changes: 8 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Params-Util (perl 5.42)",
"dockerComposeFile": "../docker-compose.yml",
"service": "dev",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"remoteUser": "perl"
}
114 changes: 45 additions & 69 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,105 +7,81 @@ on:
pull_request:

jobs:
perl-version:
name: Fetch available perl versions
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-setup-perl@v1
- id: set-matrix
name: Generate matrix for perl versions
shell: perl {0}
run: |
use Actions::Core;
use JSON::PP;
use version;
my $perl_min_version = version->parse("v5.8");
my @versions = grep { version->parse("v$_") >= $perl_min_version }
perl_versions(platform => 'linux');
my @include = map { +{ os => 'ubuntu-latest', perl => $_ } } @versions;
push @include, {
os => 'ubuntu-latest',
perl => '5',
pureperl => JSON::PP::true,
force_cc_fail => JSON::PP::true,
};
set_output(matrix_include => \@include);
outputs:
matrix_include: ${{ steps.set-matrix.outputs.matrix_include }}

dist:
name: Make distribution
runs-on: ubuntu-latest
container:
image: perldocker/perl-tester:5.42
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Cache ~/perl5
uses: actions/cache@v5
with:
key: ${{ runner.os }}-dist-locallib
path: ~/perl5
- name: Perl version
- name: Bootstrap author deps
run: |
perl -v
- name: Install cpanm
run: |
curl -L https://cpanmin.us | perl - --sudo App::cpanminus
- name: Install local::lib
run: |
cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
- name: Install author deps
shell: bash
run: |
eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
cpanm --notest --with-recommends --with-suggests Test::WriteVariants Config::AutoConf Carp inc::latest
cpanm --notest --with-recommends --with-suggests \
inc::latest Capture::Tiny Config::AutoConf Test::WriteVariants
- name: Make distribution
shell: bash
run: |
eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
perl Makefile.PL
make manifest dist DISTVNAME=dist
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: dist
path: ./dist.tar.gz
test:
needs: [dist, perl-version]
runs-on: ${{ matrix.os }}

test-linux:
name: Linux Perl ${{ matrix.perl }} (${{ format('{0}, {1}', fromJSON('["default","pureperl"]')[matrix.pureperl], fromJSON('["","force CC failure"]')[matrix.force_cc_fail]) }})
needs: dist
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
perl: ['5']
perl: ['5.30', '5.32', '5.34', '5.36', '5.38', '5.40', '5.42']
pureperl: [false, true]
include: ${{ fromJSON(needs.perl-version.outputs.matrix_include) }}
name: Perl ${{ matrix.perl }} on ${{ matrix.os }} (${{ format('{0}, {1}', fromJSON('["","pureperl"]')[matrix.pureperl], fromJSON('["","force cc failure"]')[matrix.force_cc_fail]) }})

include:
- perl: '5.42'
pureperl: true
force_cc_fail: true
container:
image: perldocker/perl-tester:${{ matrix.perl }}
steps:
- name: Get dist artifact
uses: actions/download-artifact@v7
with:
name: dist
- run: perl -V
- name: Install Perl deps
run: cpanm --notest --installdeps dist.tar.gz
- name: Run tests
run: |
cpanm --verbose --test-only \
${{ matrix.pureperl && '--pureperl' || '' }} \
${{ matrix.force_cc_fail && '--build-args="CC=false"' || '' }} \
dist.tar.gz

test-other-os:
name: Perl latest on ${{ matrix.os }}
needs: dist
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
steps:
- name: Get dist artifact
uses: actions/download-artifact@v7
with:
name: dist
- name: Set up perl
uses: shogo82148/actions-setup-perl@v1
if: matrix.os != 'windows-latest'
with:
perl-version: ${{ matrix.perl }}
- name: Set up perl (Strawberry)
uses: shogo82148/actions-setup-perl@v1
- name: Set up perl (Strawberry)
if: matrix.os == 'windows-latest'
uses: shogo82148/actions-setup-perl@v1
with:
distribution: 'strawberry'

distribution: strawberry
- run: perl -V

- name: Install Perl deps
run: |
cpanm --notest --installdeps dist.tar.gz

run: cpanm --notest --installdeps dist.tar.gz
- name: Run tests
run:
cpanm --verbose --test-only
${{ fromJSON('[ "", "--pureperl" ]')[ matrix.pureperl ] }}
${{ fromJSON('[ "", "--build-args=\"CC=false\"" ]')[ matrix.force_cc_fail ] }}
dist.tar.gz
run: cpanm --verbose --test-only dist.tar.gz
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

26 changes: 26 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
Revision history for Perl extension Params-Util

1.103_001 2026-05-01
- fix #3 / RT#75561: XS variants of _HASH/_HASH0/_ARRAY/_ARRAY0
now reject blessed references, matching the documented "raw and
unblessed" contract and the pure-perl behaviour. Thanks to
Guillaume Aubert (AUBERTG) for the original RT report (2012),
Paul Cochrane (PCOCHRANE) for tests and patches (2014), Ricardo
Signes (rjbs) for confirming the PP code is the reference (2024),
and Matthew Horsfall (@wolfsage) for the GitHub re-report.
- fix RT#141940: declare `parent` as a runtime prerequisite.
lib/Params/Util.pm uses `use parent qw{Exporter XSLoader}` but
parent was only listed in CONFIGURE_REQUIRES; on Perls older
than 5.10.1 it is not core and must be pulled in at install time.
- fix duplicate `requires` key in the test prereqs hash in
Makefile.PL that silently dropped Test::More and Storable from
the META develop section.
- update ppport.h from Devel::PPPort 3.73
- replace Travis-CI configuration with GitHub Actions: Linux matrix
(Perl 5.30..5.42) running in perldocker/perl-tester containers,
plus host-runner jobs on macOS-latest and Windows-latest with
Strawberry to verify XS builds under clang and MSVC.
- add Docker-based devcontainer setup (.devcontainer + docker-compose)
for local multi-Perl testing without installing Perl on the host.
- author tests: suppress Bangs::ProhibitNumberedNames for the
intentionally-named _SCALAR0/_ARRAY0/_HASH0/_SET0 predicates,
fix minor perltidy formatting in Makefile.PL and t/driver/.

1.102 2020-11-02
- fix RT#133623 - Can't install in pureperl mode. Thanks to Nigel
Gregoire (@nfg) for reporting and proposal for proper fix.
Expand Down
4 changes: 3 additions & 1 deletion MANIFEST.SKIP
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ nytprof.out
~$
.*\.planner
.*\.lock
\.travis\.yml
^\.github/
^\.devcontainer/
^docker-compose\.yml$
^Params-Util-.*
\bxt
\.[icos]
Expand Down
8 changes: 3 additions & 5 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ my $loadable_xs = Config::AutoConf::ParamsUtil->check_paramsutil_prerequisites()
my %RUN_DEPS = (
'Scalar::Util' => $loadable_xs ? '1.18' : '1.10',
'XSLoader' => "0.22",
'parent' => 0,
);
my %BUNDLE_CONFIGURE_DEPS = (
'inc::latest' => '0.500',
Expand Down Expand Up @@ -103,10 +104,7 @@ WriteMakefile1(
requires => {%CONFIGURE_DEPS},
recommends => {'Config::AutoConf' => '0.315'}
},
test => {
requires => {%TEST_DEPS},
requires => {'Test::LeakTrace' => 0}
},
test => {requires => {%TEST_DEPS, 'Test::LeakTrace' => 0}},
runtime => {requires => {%RUN_DEPS}},
},
},
Expand All @@ -120,7 +118,7 @@ WriteMakefile1(
TEST_REQUIRES => \%TEST_DEPS,
XS => {map { (my $tgt = $_) =~ s/\.xs$/\.c/; $_ => $tgt; } @XS_FILES},
MAGICXS => 1,
SKIP => [ $loadable_xs ? () : qw(static dynamic) ],
SKIP => [$loadable_xs ? () : qw(static dynamic)],
depend => {'$(FIRST_MAKEFILE)' => '$(VERSION_FROM)'},
test => {TESTS => join(' ', 't/pp/*.t', ($loadable_xs ? 't/xs/*.t' : ()), 'xt/*.t')},
# Otherwise 'cxinc' isn't defined
Expand Down
8 changes: 4 additions & 4 deletions Util.xs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ CODE:
{
if( SvMAGICAL(ref) )
mg_get(ref);
if( is_array(ref) )
if( is_array(ref) && !sv_isobject(ref) )
{
ST(0) = ref;
XSRETURN(1);
Expand All @@ -199,7 +199,7 @@ CODE:
{
if( SvMAGICAL(ref) )
mg_get(ref);
if( is_array(ref) && ( av_len((AV *)(SvRV(ref))) >= 0 ) )
if( is_array(ref) && !sv_isobject(ref) && ( av_len((AV *)(SvRV(ref))) >= 0 ) )
{
ST(0) = ref;
XSRETURN(1);
Expand Down Expand Up @@ -235,7 +235,7 @@ CODE:
{
if( SvMAGICAL(ref) )
mg_get(ref);
if( is_hash(ref) )
if( is_hash(ref) && !sv_isobject(ref) )
{
ST(0) = ref;
XSRETURN(1);
Expand All @@ -252,7 +252,7 @@ CODE:
{
if( SvMAGICAL(ref) )
mg_get(ref);
if( is_hash(ref) && ( HvKEYS(SvRV(ref)) >= 1 ) )
if( is_hash(ref) && !sv_isobject(ref) && ( HvKEYS(SvRV(ref)) >= 1 ) )
{
ST(0) = ref;
XSRETURN(1);
Expand Down
Loading