Add bundled POSIX::strptime support

Aperta
#2,163 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, java
Ambito
backend

Direzione di ricerca

Start with the upstream POSIX-strptime 0.13 XS source and its test suite, which the issue links, and with t/02-credentials.t in Amazon-Credentials 2.0.1, which requires POSIX::strptime. The main decision is the implementation strategy: FFM calls to libc strptime() need correct struct tm handling, and Windows needs either a compatible implementation or an explicit unsupported result. Done means the unchanged upstream tests and the Amazon-Credentials suite pass on both JVM and interpreter backends.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:cpan-port enhancement

Summary

Add bundled PerlOnJava support for the CPAN module POSIX::strptime 0.13. Its XS implementation calls the platform C library strptime() and returns the resulting struct tm fields. PerlOnJava currently installs the module's .pm wrapper but cannot load its XS implementation, so applications that rely on it fail at runtime.

Evidence

In CPAN random run 20261121-154046-78188, the dependency install identified POSIX::strptime 0.13 as XS and installed its Perl wrapper without a Java provider. Amazon-Credentials 2.0.1 then failed when require POSIX::strptime reached the unavailable native implementation (t/02-credentials.t). After Module::Loaded was installed and the target retried, the run still reported 3/27 test programs failing and 1/145 subtests failing; the unsupported POSIX::strptime load is one confirmed cause.

The isolated system-Perl oracle passed the Amazon-Credentials 2.0.1 suite: 27 files, 161 tests, with only the two explicitly AWS-dependent tests skipped. The suite uses POSIX::strptime to parse ISO 8601 timestamps.

MetaCPAN reverse-dependency metadata for POSIX::strptime reports 2 released distributions with a required runtime dependency. One is recent (released in the last five years): Amazon-Credentials. The other is EntityModel. Other reverse-dependency records did not meet the released, required-runtime-dependency filter.

The upstream module's XS source and tests are in POSIX-strptime 0.13. Its tests cover time/date directives, unset fields, invalid input and Linux dates before 1900.

Porting scope

  • Add a Java XSLoader provider for POSIX::strptime::strptime, preserving the upstream wrapper, exports and list-return behavior.
  • Match the upstream XS semantics for the nine returned fields: seconds, minutes, hours, day of month, zero-based month, years since 1900, weekday, yearday and DST flag. Preserve undef for fields that upstream marks as unmodified where the platform provides that behavior.
  • Choose and document the implementation strategy. FFM calls to libc strptime() provide the closest macOS/Linux behavior but require correct struct tm ABI handling. Windows has no POSIX strptime() entry point and needs a compatible implementation or an explicit unsupported result matching upstream platform support.
  • Keep locale and timezone behavior aligned with the platform implementation where practical; do not silently report successful parses when the input does not match.

Acceptance criteria

  • Preserve and run the unchanged upstream POSIX-strptime tests under system Perl and PerlOnJava.
  • Add focused project-owned coverage for return-field ordering, undef fields, invalid input, format directives, pre-1900 years and timezone/locale-sensitive cases supported by the implementation.
  • Verify both JVM and interpreter backends.
  • Test or explicitly define behavior on macOS, Linux and Windows, including unsupported platform behavior.
  • Verify use POSIX::strptime qw(strptime) and the fully qualified call used by Amazon-Credentials.
  • Run Amazon-Credentials 2.0.1 against the bundled provider as integration coverage.
Lingua principale
Perl
Stelle
67
Fork
8
Merge medio
4h 36m
PR unite (30g)
123

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fglock/PerlOnJava

Tutte le issue di fglock/PerlOnJava

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.