Provide Java-backed URI::Fast support for CPAN compatibility

Ouverte
#2,117 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
35/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
java, perl
Domaine
backend, tooling

Piste de recherche

Start by mapping the URI-Fast 0.55 public methods and upstream tests to candidate Java URI libraries, especially Apache HttpComponents Core 5 URIBuilder, and document mismatches in raw versus decoded fields, repeated or empty query values, IRI handling, resolution, and normalization. Then implement a PerlOnJava provider for the supported surface and decide how to handle the tests' URI::Encode::XS dependency. Done means the upstream suite passes under both PerlOnJava backends without native XS compilation, with focused regression coverage for the listed behaviors.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

area:cpan-port area:unicode enhancement

Summary

Add Java-backed support for CPAN distribution URI-Fast so it can run under PerlOnJava without compiling its XS implementation. The current release, URI-Fast 0.55, is a useful compatibility target and failed in CPAN random run 20261118-104825-43075 because URI::Fast unconditionally calls XSLoader::load.

Evidence

  • PerlOnJava installed the distribution's .pm files but cannot compile Fast.xs. All 19 test programs then failed before running assertions with no Java XS implementation available.
  • The system Perl oracle built the XS modules and passed both URI::Encode::XS and the complete URI::Fast test suite.
  • URI::Fast implements its main behavior in XS: parsing and component storage; raw and decoded accessors; percent encoding and decoding; query parameters and keysets; normalization; absolute/relative URI resolution; and IRI construction.
  • The tests also use the separate XS-only URI::Encode::XS distribution. A URI::Fast implementation can avoid this dependency at runtime, but full upstream test compatibility may require supporting that module too or adapting the test dependency path.
  • Reverse dependencies (released distributions with a required runtime dependency; five-year window ending 2026-11-19): URI::Fast: 2 total, 0 recent (Net-Curl-Parallel, WebService-Pokemon); URI::Encode::XS: 5 total, 3 recent (AnyEvent-InfluxDB, Bencher-Scenario-URIEscaping, Catalyst-Plugin-CachedUriForAction, HTTP-Promise, Opsview-RestAPI).
  • The failure requires no platform-specific native library beyond the XS build itself; PerlOnJava's inability to load these XS objects is sufficient to explain it.

Java library investigation

Apache HttpComponents Core 5 URIBuilder appears to be the most practical existing Java foundation to evaluate. It provides component mutation, path segments, query parameters, and normalization; Core 5.4 added an RFC 3986 encoding policy. The project does not currently bundle this dependency, and it is not a drop-in replacement for the Perl API. In particular, we need to check its exact handling of raw versus decoded fields, repeated/empty query values, IRI input, and URI::Fast's resolution and comparison behavior.

java.net.URI is already available but its documented normalization and resolution are based on RFC 2396 and it does not provide the mutable API. Kuri advertises an RFC 3986 Uri API accessible from Java, but it is a Kotlin dependency in the 0.x series and should be evaluated for maturity and packaging before adoption.

Proposed work

  1. Map the upstream URI::Fast tests and public methods to Java library capabilities; record where the selected library matches and where PerlOnJava needs a compatibility layer.
  2. Choose between Apache URIBuilder, another maintained Java implementation, or a focused project-owned adapter. Avoid making the selected library's API visible to Perl code.
  3. Add a Java provider for the supported URI::Fast surface, including the raw/decoded distinction and IRI behavior, and make XSLoader calls resolve to it under PerlOnJava.
  4. Decide whether URI::Encode::XS needs an independent Java provider for its own compatibility, or whether it is only a test-time dependency for this distribution.
  5. Preserve upstream tests and add project-owned regression coverage for any discovered PerlOnJava behavior gaps.

Acceptance criteria

  • The URI-Fast 0.55 upstream suite passes under PerlOnJava's JVM and interpreter backends without native XS compilation.
  • The URI::Fast behaviors listed above are covered, including repeated query keys, percent encoding, IRI handling, and RFC 3986 resolution/normalization.
  • System Perl remains the behavioral oracle, and Java library mismatches are documented and covered by focused regression tests.
  • The implementation does not require exposing Java library types in the Perl-facing API.
Langage dominant
Perl
Étoiles
67
Forks
8
Merge moyen
5 h 12 min
PR mergées (30 j)
131

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de fglock/PerlOnJava

Toutes les issues de fglock/PerlOnJava

Issues similaires

Plus d'issues Perl

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.