Skip to content

Export fieldhash from Hash::Util #1909

Closed

Description

@fglock

Summary

PerlOnJava's bundled Hash::Util omits the core fieldhash export, preventing CPAN module Hash::ExtendedKeys from loading. The same consumer also exposed two related compatibility gaps in the bundled fieldhash and tied-hash runtime paths: ordinary scalar keys were rejected by fieldhash, and false EXISTS callback results were not normalized to Perl's canonical boolean scalar.

Reproducer

use Hash::Util qw(fieldhash);
fieldhash my %fields;
$fields{plain_key} = 'value';

For tied hashes, system Perl normalizes undef or 0 returned by EXISTS to a defined empty string, and truthy callback values to 1.

CPAN evidence

  • Distribution: Hash-ExtendedKeys 1.01
  • CPAN random tester run: 20261027-085020-3852
  • Original failing test: t/00-load.t; the import aborted before the suite proceeded
  • System Perl 5.42.2: complete unchanged upstream suite passes (7 files, 24 tests)
  • PerlOnJava Perl 5.044001: original import failure reproduced on both JVM and interpreter backends

The failure was observed on macOS 26. PR #1910 adds regression coverage for the export, scalar-key behavior and tied-hash boolean normalization. After those fixes, t/00-load.t and t/03-coverage.t pass on PerlOnJava. The remaining t/01-idea.t and t/02-tie.t are blocked by the transitive XS dependency Combine::Keys, which fails with Undefined subroutine &Combine::Keys::ckeys.

This is distinct from #1379, which fixed Hash::Util::FieldHash's :all export tag.

Acceptance

  • Export fieldhash from Hash::Util with core-compatible behavior.
  • Preserve ordinary scalar-key operations and identity-based reference keys.
  • Normalize tied-hash EXISTS results to 1 or '' on both execution backends.
  • Keep focused project-owned coverage green on system Perl and both PerlOnJava backends.

Activity

  1. added
    bugSomething isn't working
    area:runtimeCore Perl runtime semantics
    on Oct 28, 2026
  2. fglock commented on Oct 28, 2026

    @fglock
    OwnerAuthor

    State: handed-off
    Agent/session: Codex API session 2026-10-28 hash-util-fieldhash
    Scope: #1909, restore Hash::Util fieldhash compatibility and Perl tied-hash exists booleans
    Work: fix/hash-util-fieldhash-export, PR #1910, API head 8b2dd63 on master 16b5a7d
    Checkpoint: 2026-10-28; draft PR updated with fieldhash and false-exists fixes
    Evidence: nice -n 19 make passed; both new focused tests pass on system Perl and both PerlOnJava backends; make check-links passes; CPAN Hash-ExtendedKeys t/00-load.t and t/03-coverage.t pass after fix
    Blocked by: none
    Next: CI/review on PR #1910; the only remaining CPAN suite failures are t/01-idea.t and t/02-tie.t at missing XS Combine::Keys::ckeys

  3. added a commit that references this issue on Oct 28, 2026
    8b2dd63
  4. fglock commented on Oct 28, 2026

    @fglock
    OwnerAuthor

    Verification follow-up for PR #1910:

    • CI is green on the PR head (8b2dd6354cb593671684372b39f764cee8c37645) on Linux and Windows.
    • The focused Hash::Util fieldhash and tied-hash exists regressions pass on system Perl and both PerlOnJava backends.
    • Hash-ExtendedKeys 1.01 t/00-load.t and t/03-coverage.t pass on PerlOnJava after the fix.
    • The unchanged upstream suite is still incomplete: t/01-idea.t and t/02-tie.t stop when the transitive XS dependency Combine::Keys calls unavailable Combine::Keys::ckeys. System Perl passes all 7 files / 24 tests.

    The compatibility defects covered by this PR are fixed. Keep this issue open through review and merge; the remaining XS dependency limitation is follow-up work outside this PR.

  5. added a commit that references this issue on Oct 28, 2026
    ed3fb02
  6. fglock commented on Oct 28, 2026

    @fglock
    OwnerAuthor

    PR #1910 merged on 2026-10-28 as ed3fb02aa684beede175ad0120398da15677692b; GitHub closed this issue through the PR closing reference. Linux and Windows CI passed on the merged PR head.

    The Hash::ExtendedKeys fieldhash import and tied-hash exists compatibility defects are fixed. Its full unchanged CPAN suite remains partially unverified on PerlOnJava because t/01-idea.t and t/02-tie.t reach the unavailable transitive XS function Combine::Keys::ckeys; t/00-load.t and t/03-coverage.t pass. This is separate follow-up work and does not reopen the resolved issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:runtimeCore Perl runtime semanticsbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions