diff --git a/dev/design/issue-queue.md b/dev/design/issue-queue.md index 383e4f1b82..285db18555 100644 --- a/dev/design/issue-queue.md +++ b/dev/design/issue-queue.md @@ -1,6 +1,6 @@ # Reviewed issue queues -Snapshot: 2026-10-29, from live open issues, PRs and the #1649 phase contract. +Snapshot: 2026-10-30, from live open issues, PRs and the #1649 phase contract. This is a bounded selection aid, not the complete backlog or fresh runtime validation. Follow the [triage and claim protocol](../../docs/guides/issue-triage.md) and recheck live issue comments/PRs before starting. Unlisted work is unreviewed @@ -26,6 +26,7 @@ resolved before implementation. No new pass or failure is asserted here. | Code/test boundary | Issue | Priority / state | Evidence, next action and blocker | |---|---|---|---| +| POSIX filehandles | [#1932](https://github.com/fglock/PerlOnJava/issues/1932) `POSIX::isatty` glob handling | Normal / Active | IO-Pty-Easy 0.10 passes on system Perl; CPAN run `20261030-095654-34969` failed on both PerlOnJava backends because `*STDIN` reached a direct `RuntimeIO` cast. The helper-based fix and focused test pass on both backends; full `make` passes on `fix/posix-isatty-glob`. A fresh `jcpan -t IO::Pty::Easy` rerun timed out after `t/open-close.t` passed and fork-dependent tests skipped. | | File-handle EOF state | [#1922](https://github.com/fglock/PerlOnJava/issues/1922) `IO::Handle::clearerr` | Normal / Active | `Log::Procmail` 0.14 passes on system Perl but failed on both PerlOnJava backends when reading appended data after EOF. The shared runtime fix and permanent regression are in [draft PR #1924](https://github.com/fglock/PerlOnJava/pull/1924); the full make gate and all 281 CPAN tests pass. Await review and CI. | | File metadata | [#1912](https://github.com/fglock/PerlOnJava/issues/1912) `Time::HiRes::stat` | Normal / Active | Daiku 1.004 passes on system Perl and exposed the missing runtime function; the implementation and both-backend regression are in [PR #1913](https://github.com/fglock/PerlOnJava/pull/1913). | | XML provider APIs | [#1892](https://github.com/fglock/PerlOnJava/issues/1892) XSLT output | High / Active | [PR #1894](https://github.com/fglock/PerlOnJava/pull/1894) is open; verify its serialization fix against HTML::ToDocBook. Coordinate through that work rather than start a duplicate. | diff --git a/docs/about/changelog.md b/docs/about/changelog.md index fb03b8eb83..6fe3d8dde5 100644 --- a/docs/about/changelog.md +++ b/docs/about/changelog.md @@ -6,6 +6,8 @@ priorities and future plans. ## Work in progress +- Resolve glob-backed filehandles in `POSIX::isatty` without assuming the glob value is a `RuntimeIO` (#1932). + - Add an initial CryptX Java XS bridge for binary/base64url helpers, functional digests, and HMAC using the existing JCA and Bouncy Castle providers (#1220). - Preserve named typeglob stringification when copying package stash entries (#1927). diff --git a/src/main/java/org/perlonjava/runtime/perlmodule/POSIX.java b/src/main/java/org/perlonjava/runtime/perlmodule/POSIX.java index d10493a1cc..61107cfe94 100644 --- a/src/main/java/org/perlonjava/runtime/perlmodule/POSIX.java +++ b/src/main/java/org/perlonjava/runtime/perlmodule/POSIX.java @@ -577,7 +577,10 @@ public static RuntimeList posix_isatty(RuntimeArray args, int ctx) { RuntimeScalar arg = args.get(0); // Accept either a fd number or a filehandle (RuntimeIO) if (arg.type == RuntimeScalarType.GLOB) { - RuntimeIO io = (RuntimeIO) arg.value; + RuntimeIO io = arg.getRuntimeIO(); + if (io == null) { + return new RuntimeScalar(0).getList(); + } fd = io.fileno().getInt(); } else { fd = arg.getInt(); diff --git a/src/test/resources/unit/posix_isatty_glob.t b/src/test/resources/unit/posix_isatty_glob.t new file mode 100644 index 0000000000..7a83506d23 --- /dev/null +++ b/src/test/resources/unit/posix_isatty_glob.t @@ -0,0 +1,11 @@ +use strict; +use warnings; +use POSIX (); +use Test::More; + +is(POSIX::isatty(*STDIN) ? 1 : 0, -t STDIN ? 1 : 0, + 'POSIX::isatty accepts the STDIN glob'); +is(POSIX::isatty(*STDOUT) ? 1 : 0, -t STDOUT ? 1 : 0, + 'POSIX::isatty accepts the STDOUT glob'); + +done_testing;