Fix HTML::Template::Compiled global variables and warning metadata

Abierto
#1,382 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java, perl

Línea de trabajo

Empieza ejecutando t/08_global_vars.t y t/39_line_info.t con los backends JVM e interpreter, y compara después su comportamiento en cuanto a ámbito, advertencias, advertencias fatales y ubicación en el código fuente. Sigue la ruta de include/loop y el código generado o evaluado solo lo suficiente para separar el comportamiento compartido en tiempo de ejecución de los defectos específicos del backend. Se considera terminado cuando pasan las regresiones específicas, se conservan las advertencias esperadas y los metadatos de línea, y pasa la suite upstream sin cambios.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area:cpan-port area:runtime bug

Summary

HTML::Template::Compiled 1.003 passes its upstream test suite under system Perl but fails under PerlOnJava in two functional areas: global-variable/include rendering and warning plus source-line metadata propagation.

CPAN evidence

CPAN random tester run 20260915-094334-6702:

  • Distribution: HTML-Template-Compiled 1.003
  • System Perl: complete suite passes; 38 test files, 259 executed tests
  • PerlOnJava: 9 of 262 executed assertions fail across 2 of 38 test programs
  • Build and dependency setup complete successfully
  • Dependency: Parse::RecDescent 1.967015 builds and passes its own tests

The PerlOnJava failures are:

t/08_global_vars.t ............. 1 failure
t/39_line_info.t ............... 8 failures

The other 36 test programs pass, including template parameters, filters, includes, loops, expressions, encoding, plugins, precompilation, and POD-related tests.

Failure 1: global variable and include rendering

t/08_global_vars.t creates a template with global_vars => 1, a loop containing local values, and an included template that references a global value. System Perl renders the expected loop values and global values. PerlOnJava produces an empty result, causing the global_vars assertion to fail.

The test also covers an unset-variable control case and a separate global_vars => 2 nested tmpl_with case; those assertions pass. The failing behavior is therefore narrower than all global-variable or nested-scope handling.

Expected output includes:

loopvar: one ... global: 42 ... included: ...
loopvar: two ... global: 23 ... included: ...
loopvar: three ... global: 42 ... included: ...

Observed PerlOnJava output for the main assertion is empty.

Failure 2: warnings and template source line information

t/39_line_info.t renders a template containing an undefined value under three warning modes: disabled, enabled, and fatal. It runs each mode with line_info => 0 and line_info => 1.

The expected behavior under system Perl is:

  • warnings => 0: no warning and normal output
  • warnings => 1: an Use of uninitialized value warning
  • warnings => fatal: empty output and a fatal exception
  • with line_info => 1, warning and exception text identifies t.templates.line_info1.html line 4

Under PerlOnJava:

  • expected warnings are absent
  • warnings => fatal does not stop output
  • expected source-line metadata is absent

This produces 8 failed assertions in the test.

Suspected ownership

The failures are pure-Perl compatibility defects attributable to PerlOnJava. The exact ownership should be reduced before implementation:

  1. For global_vars, inspect template include execution, scope lookup, and output-buffer control flow for the main global_vars => 1 loop path.
  2. For t/39_line_info.t, inspect warning-category emission, fatal-warning conversion, localized warning handlers, and propagation of template source locations through generated/evaluated code.
  3. Compare JVM and interpreter backends and determine whether either symptom is shared runtime behavior or backend-specific.
  4. Confirm whether the two symptoms share a scope/evaluation or generated-code cause; do not assume they are one defect solely because they occur in the same distribution.

This is not a missing service, platform prerequisite, timeout, or native/XS failure.

Regression coverage and acceptance criteria

  • Add a project-owned, system-Perl-validated regression for the smallest global_vars => 1 include/loop case that reproduces the empty output.
  • Add focused coverage for warning-disabled, warning-enabled, and fatal-warning behavior with and without template line information.
  • Preserve expected output, warning text, fatal behavior, and source location on both JVM and interpreter backends.
  • Re-run the unchanged HTML::Template::Compiled 1.003 suite and require all available upstream tests to pass.
  • Run the existing warning, scope, include, generated-code, and source-location tests to guard against regressions.

Related but distinct: #1377 concerns Log::Fine dynamic placeholders and caller metadata; it does not cover HTML::Template::Compiled global-variable rendering or warning behavior.

Lenguaje dominante
Perl
Estrellas
64
Forks
6
Merge medio
5 h 18 min
PR fusionados (30 d)
162

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de fglock/PerlOnJava

Todos los issues de fglock/PerlOnJava

Issues similares

Más issues de Perl

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.