Skip to content

fix: CORE:: builtins, 32-bit <<, Image::BMP, Inline jcpan#747

Merged
fglock merged 4 commits into
masterfrom
fix/jcpan-image-bmp-core-shift
May 15, 2026
Merged

fix: CORE:: builtins, 32-bit <<, Image::BMP, Inline jcpan#747
fglock merged 4 commits into
masterfrom
fix/jcpan-image-bmp-core-shift

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented May 15, 2026

Summary

  • CORE:: package-resolving path no longer applies a package subroutine prototype to CORE::name builtins (e.g. Image::BMP sub close () vs CORE::close($fh)). Unit coverage: core_qualified_builtin_prototype.t.
  • Non-use integer << keeps 32-bit UV semantics: shifts ≥ 32 yield 0 (ivsize=4; perl5_t/t/op/bop.t UV block). The prior widening (1<<32 → NV) was removed as inconsistent with this model.
  • Image::BMP (CPAN only): Image-BMP.yml + CpanPatches/Image-BMP-1.26/BMP.pm.patch and CPAN::Config bootstrap apply 2**$bits where 1<<$bits would be wrong when BitCount can be 32. No bundled Image::BMP in the tree; users install from CPAN / jcpan as usual.
  • Inline: earlier commit on this branch makes ./jcpan -t Inline pass (Internals::abs_path, shebang, etc.).

Test plan

  • make
  • timeout 120 ./jperl perl5_t/t/op/bop.t (spot-check UV shift tests; other failures may be pre-existing)
  • timeout 300 ./jcpan -t Image::BMP (after fresh install / patch apply)
  • timeout 300 ./jcpan -t Inline

@fglock fglock changed the title fix: CORE:: prototypes and wide << for Image::BMP fix: CORE:: builtins, 32-bit <<, Image::BMP, Inline jcpan May 15, 2026
fglock and others added 3 commits May 15, 2026 21:24
Honor CORE:: when resolving builtin prototypes so package subs like
sub close () do not shadow CORE::close($fh) at compile time.

Implement Perl-style widening for non-integer left shift when shift is
32..63 so 1<<32 sets ColorsUsed correctly in Image::BMP headers.

Fixes ./jcpan -t Image::BMP.

Generated with [Cursor](https://cursor.com/docs)

Co-Authored-By: Cursor <cursoragent@cursor.com>
- Treat jar:PERL5LIB paths as stable absolutes in Internals::abs_path so
  Inline::derive_minus_I never emits bare -I flags.
- Implement perlrun-style alternate shebang delegation for wrappers such as
  inc/bin/testml-cpan (word-boundary perl/indir detection, skip self-exec,
  spawn via PERLONJAVA_EXECUTABLE when the wrapper targets jperl).
- Preserve argv spelling when delegating so TestML path rewrites stay relative.
- In diagnostics.pm death_trap, detect eval context from "(eval N) line"
  when caller lacks an (eval) frame under $SIG{__DIE__}.

Verified: make; ./jcpan -t Inline

Generated with [Cursor](https://cursor.com/docs)

Co-Authored-By: Cursor <cursoragent@cursor.com>
PerlOnJava reports ivsize=4; UV left shift must yield 0 when shift >= 32
(see perl5_t/t/op/bop.t). Drop BigInteger widening for default <<.

Image::BMP used 1<<BitCount for ColorsUsed; on 32-bit IV that is wrong for
32 bpp. Vendor Image::BMP 1.26 with 2** for those cases and add a CPAN
distropref + patch for Image-BMP-1.26 so jcpan installs get the same fix.

Generated with [Cursor](https://cursor.com/docs)

Co-Authored-By: Cursor <cursoragent@cursor.com>
@fglock fglock force-pushed the fix/jcpan-image-bmp-core-shift branch from b85b16e to eada88a Compare May 15, 2026 19:24
The 32-bit IV fix stays in PerlOnJava/CpanPatches and distroprefs so
jcpan installs apply it; no full module under src/main/perl/lib/.

Generated with [Cursor](https://cursor.com/docs)

Co-Authored-By: Cursor <cursoragent@cursor.com>
@fglock fglock merged commit 1ab761e into master May 15, 2026
2 checks passed
@fglock fglock deleted the fix/jcpan-image-bmp-core-shift branch May 15, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant