Skip to content

Modernize dev/CI infrastructure, fix XS blessed-ref bug, prep 1.103_001 - #7

Merged
rehsack merged 11 commits into
masterfrom
feature/modernize-dev-infra
May 1, 2026
Merged

rehsack merged 11 commits into
masterfrom
feature/modernize-dev-infra

Conversation

@rehsack

@rehsack rehsack commented May 1, 2026

Copy link
Copy Markdown
Member

Summary

Modernize the test/dev infrastructure for Params-Util and address several long-standing issues. Cut as 1.103_001 (TRIAL/developer release) so the XS blessed-ref fix and the new CI matrix can soak through CPAN smokers before promoting to 1.103 final.

Bugs fixed

  • Params::Util XS version of _HASH0 does not return undef for a blessed hash #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. (Reported 2012 by AUBERTG, patches 2014 by PCOCHRANE, PP-as-reference confirmed 2024 by rjbs, GH re-report by @wolfsage.)
  • RT#141940: declare parent as a runtime prerequisite — lib/Params/Util.pm does use parent qw{Exporter XSLoader} but parent was only in CONFIGURE_REQUIRES.
  • META correctness: duplicate requires key in the test prereqs hash silently dropped Test::More and Storable from the develop section.

Infrastructure

  • Container-only local dev environment: .devcontainer/ + docker-compose.yml with non-root perl user, per-distro volume scoping, matrix services for Perl 5.30..5.42.
  • GitHub Actions pivot: Linux matrix runs in perldocker/perl-tester containers; macOS-latest and Windows-latest stay on host runners (Strawberry) to verify XS builds under clang and MSVC respectively.
  • .travis.yml removed.
  • ppport.h regenerated via Devel::PPPort 3.73 (was 3.62).
  • xt/perlcritic and xt/perltidy author tests brought back to green.

Out of scope (deferred)

  • RT#144488 (HP-UX cc/perl mismatch) — environmental, will be closed on RT. The cryptic "Cannot use Perl API — giving up" message originates in Config::AutoConf and improvements there belong upstream.
  • TODO entries in lib/Params/Util.pm (_CAN, assertion-variant, Test::-variant) — feature additions, separate work.

Commits

9188287 chore(release): Prepare 1.103_001 developer release
ee11339 fix(prereqs): Declare parent as runtime dependency (RT#141940)
e6563ff docs(changes): Add 1.103 entry covering this branch
d914671 chore(deps): Regenerate ppport.h via Devel::PPPort 3.73
aaf2036 fix(xs): Reject blessed refs in _HASH/_HASH0/_ARRAY/_ARRAY0
9af6b45 ci(github): Switch test matrix to perldocker containers (hybrid)
d56a2ab chore(ci): Remove obsolete .travis.yml
8ae2c08 fix(xt): Address perlcritic and perltidy findings
5068d4a fix(prereqs): Merge duplicate requires key in test prereqs
f57c955 chore(dev): Add devcontainer with multi-Perl test matrix

Test plan

  • GHA: Linux matrix (perldocker 5.30..5.42, default + pureperl, plus pureperl + force-CC-fail on 5.42) green
  • GHA: macOS-latest job green (clang XS build)
  • GHA: Windows-latest job green (Strawberry XS build)
  • Local: docker compose run --rm perl-5.42 green (already verified)
  • CPAN: 1.103_001 trial upload reaches smokers without regressions
  • Issue Params::Util XS version of _HASH0 does not return undef for a blessed hash #3 reproducer (_HASH0(bless {}, 'cat')) returns undef under XS

Closes #3.

🤖 Generated with Claude Code

rehsack and others added 11 commits May 1, 2026 20:04
Per-distribution Docker dev environment that runs without host Perl.
A thin Dockerfile wrapper adds a non-root `perl` user atop
perldocker/perl-tester so bind-mount writes do not leak root ownership
onto the host.

The compose project name `params-util` scopes all volumes (cpanm-cache-*,
locallib-dev) under that prefix, preventing dependency contamination
between sibling CPAN distributions sharing the same Docker engine.

Matrix services cover stable Perls 5.30 through 5.42; the `dev` service
runs 5.42 as the devcontainer primary with persistent local::lib at
/opt/perl5 so author deps survive container restarts. MANIFEST.SKIP
excludes the new dev/CI artifacts (.devcontainer/, docker-compose.yml,
.github/) from the CPAN tarball.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Two `requires` keys in the same hashref overwrote rather than merged
in the META_MERGE test prereqs section, leaving only Test::LeakTrace
declared. Test::More and the rest of %TEST_DEPS were silently dropped
from the META develop section, so smokers without Test::More installed
would have hit a runtime failure rather than a clean prereq miss.

Merge both into one hashref so all test prereqs are declared.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
xt/perlcritic.t flagged the public _SCALAR0/_ARRAY0/_HASH0/_SET0
predicates in PP.pm via Bangs::ProhibitNumberedNames. Renaming would
break the established Params::Util API, so the policy is added to the
per-file no-critic block at the top of PP.pm.

xt/perltidy.t failures: spacing in three driver-test fixtures and the
SKIP bracket in Makefile.PL, plus a side-effect collapse of the test
prereqs onto one line. All produced by perltidy with the existing
.perltidyrc.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Travis-CI has not been the project's primary or backup CI for some
time; testing now runs on GitHub Actions, and the next commit moves
the Linux matrix to perldocker containers. Drop the legacy file and
its MANIFEST.SKIP guard.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Replace the host-based shogo82148/actions-setup-perl matrix with
perldocker/perl-tester containers for the Linux pipeline. This matches
the local docker-compose dev environment exactly and eliminates
"works locally, fails in CI" drift on the Linux side.

Layout:
- dist: builds the tarball inside perldocker:5.42, publishes artifact
- test-linux: matrix on perl 5.30..5.42 x {default, pureperl}, plus a
  pureperl + force-CC-failure smoke job on 5.42
- test-other-os: macOS + Windows-latest with shogo82148/setup-perl on
  the most recent stable Perl. Linux containers cannot exercise Apple
  clang or Strawberry/MSVC, so XS-build verification on those platforms
  stays on host runners.

Auto-discovery of Perl versions via shogo82148 is dropped; the matrix
list now lives in the workflow file (and mirrors docker-compose.yml).
A future SSOT file (.perl-versions or similar) could de-duplicate, but
that is left for when more distros adopt the same pattern.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Closes #3.

The XS implementations of _HASH, _HASH0, _ARRAY and _ARRAY0 used
is_hash() and is_array() helpers that only check the underlying SV
type, not the blessed status. The pure-perl versions check
`ref X eq 'HASH'` / `'ARRAY'`, which excludes blessed refs as
documented ("raw and unblessed").

Issue #3 reported the divergence on _HASH0; the same defect existed
in three sibling functions. Add `!sv_isobject(ref)` at the four call
sites rather than changing is_hash/is_array, so _ARRAYLIKE and
_HASHLIKE (which intentionally accept blessed plain refs and
overload-equipped objects) are unaffected.

Regression tests added to both pp and xs variants of t/02_main.t for
each function, with empty/non-empty blessed inputs as appropriate.
_ARRAYLIKE / _HASHLIKE / _INSTANCE coverage of blessed inputs already
exists in t/05_typelike.t and t/02_main.t respectively.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Refresh ppport.h from the version bundled with the current
Devel::PPPort release. Picks up support for newer Perls including
5.42 and brings the file in line with upstream PPPort additions
since the previous regeneration (3.62, shipped with 1.102).

Generated under perl 5.42.2 inside the devcontainer.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Summarise the user-visible changes introduced on the
modernize-dev-infra branch: the #3 fix, the META test-prereqs
correction, the ppport.h refresh, the CI pivot from Travis to
GitHub Actions on perldocker containers, the new devcontainer
setup, and the author-test cleanups.

Date is left as "unreleased"; will be set at release time.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
lib/Params/Util.pm pulls in `parent` via `use parent qw{Exporter
XSLoader}`, but the module was only listed under CONFIGURE_REQUIRES
(via %CONFIGURE_DEPS in Makefile.PL), not under PREREQ_PM. The
distribution declares 5.008 as its minimum Perl, and `parent` only
became core in 5.10.1, so installs on older Perls would fail at
runtime with "Can't locate parent.pm".

Add `parent => 0` to %RUN_DEPS so it appears in PREREQ_PM and the
META runtime/requires section.

Verified via MYMETA.json after `perl Makefile.PL` in the devcontainer.

Also expand the Changes 1.103 entry to record this fix alongside the
existing RT#75561 cross-reference for the GH#3 work.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Bump VERSION in lib/Params/Util.pm and lib/Params/Util/PP.pm to
1.103_001 and set the Changes header to today's date. The underscore
in the version marks this as a TRIAL release on PAUSE — not indexed
by default, useful for soliciting CPAN smoker results on the XS
blessed-ref fix and the new perldocker CI matrix before cutting
1.103 final.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
GitHub Actions rejected the workflow with "expression not closed" at
line 33. Cause: YAML single-quoted scalars decode `''` to a literal
apostrophe, so the GHA empty-string `''` in `... || '' }}` collapsed
to a single quote, breaking expression parsing.

Switch to the unquoted-YAML + `fromJSON('[...]')[bool]` indexing form
used by the previous workflow. Same human-readable result, no quote
collisions. The `test-other-os` `name:` is also unquoted for
consistency.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
@rehsack
rehsack merged commit b60446c into master May 1, 2026
17 checks passed
@rehsack
rehsack deleted the feature/modernize-dev-infra branch May 1, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Params::Util XS version of _HASH0 does not return undef for a blessed hash

1 participant