MakeMaker writes Perl v-string VERSION bytes into generated Makefile

Aberta
#2,126 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
57/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
perl
Domínio
build-system

Direção de pesquisa

Start in src/main/perl/lib/ExtUtils/MakeMaker.pm and trace how WriteMakefile selects and passes VERSION into Makefile generation. Add a focused regression test for VERSION = v0.1.0 that checks generated version fields and recipes contain printable text without control bytes, then confirm the generated Makefile works with make. The issue notes that the full upstream suite cannot run under the available system Perl.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

area:cpan-port bug

Summary

File-Util-SecureDir v0.1.0 fails during the PerlOnJava MakeMaker build, before its test suite starts. Its Makefile.PL passes a dotted version string literal as the MakeMaker VERSION:

WriteMakefile(
    NAME    => 'File::Util::SecureDir',
    VERSION => v0.1.0,
    ...
);

PerlOnJava writes the literal's internal v-string bytes into the generated Makefile instead of its printable version representation. The resulting all recipe is malformed, and make exits with a shell unmatched-quote error.

Evidence

CPAN tester run 20261119-133823-51077, distribution LEMBARK/File-Util-SecureDir-v0.1.0.tar.gz:

  • Makefile.PL completes successfully.
  • The generated Makefile contains NUL/SOH/NUL bytes where the version should be (VERSION = <NUL><SOH><NUL>). PerlOnJava's MakeMaker diagnostic likewise prints the version as control bytes.
  • The all recipe interpolates that raw value into a quoted echo command.
  • /usr/bin/make fails before tests with /bin/sh: ... unexpected EOF while looking for matching \".

A minimal WriteMakefile(NAME => 'Probe::Version', VERSION => v0.1.0) probe reproduces the difference: system Perl's ExtUtils::MakeMaker emits the printable VERSION = v0.1.0, while PerlOnJava's generated Makefile has an empty/truncated version field and a recipe containing the raw control bytes.

Root cause

In src/main/perl/lib/ExtUtils/MakeMaker.pm, WriteMakefile selects $version directly from $args{VERSION} (or VERSION_FROM) and passes it into Makefile generation. The value is interpolated into Makefile variables and recipes without converting a Perl v-string to printable version text. A v-string such as v0.1.0 is internally represented as the bytes 00 01 00; embedding those bytes in a shell command causes the shell to see a truncated quoted command.

Proposed fix

Normalize the selected version to printable version text before using it in diagnostics, metadata, DISTVNAME, Makefile variables, and recipes. Use the core version module's parsed version string representation (while preserving ordinary decimal versions). Add a focused regression test that calls WriteMakefile with VERSION => v0.1.0, then verifies the generated Makefile contains a printable version and no embedded NUL/control bytes in version-derived fields or recipes. The generated Makefile should also be usable by make.

Standard Perl comparison and scope

The installed system Perl is 5.34.1, but this distribution declares use v5.36, so its full upstream configure/build/test suite could not be run under the available system Perl. The minimal system-Perl MakeMaker probe did emit the expected printable version. The archived PerlOnJava failure occurs during make all, before any upstream tests execute.

This is a pure-Perl CPAN distribution; there is no XS/native dependency or reverse-dependency count to report. Existing issue #2068 concerns Module::Install::Share staging and does not cover this v-string serialization bug.

Linguagem predominante
Perl
Estrelas
67
Forks
8
Merge médio
5h 12min
PRs com merge (30d)
131

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de fglock/PerlOnJava

Todas as issues de fglock/PerlOnJava

Issues semelhantes

Mais issues de Perl

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.