Skip to content

Fix Unix termios ABI and verify native CI architectures - #16

Draft
bsutton wants to merge 5 commits into
mainfrom
review/pr-15-abi
Draft

bsutton wants to merge 5 commits into
mainfrom
review/pr-15-abi

Conversation

@bsutton

@bsutton bsutton commented Oct 2, 2026 •

Copy link
Copy Markdown

Linux was using the macOS termios layout and flag constants. That misaddresses fields on 64-bit Linux and can undersize the allocation on 32-bit Linux. This change introduces separate glibc/Darwin layouts, uses libc's cfmakeraw, preserves terminal speeds and control characters, and frees temporary native buffers. Failed initial snapshots cannot become zeroed restore state, and failed mode changes now report an error.

Builds on #15 by @mafreud and retains their original ioctl variadic-binding commit and authorship. The original PR remains open and its fork is unchanged.

Validation and CI:

  • Completed CI run 36963665559 passed all seven jobs on bc9caf9aee724056bf63c18850c3d1287279a92b.
  • Linux, macOS and Windows x64/ARM64 ran native Dart 3.13.5; Linux x64 also passed on the declared minimum Dart 3.10.0. Each Unix job passed 69 tests. Each Windows job passed 45 tests with 24 Unix-specific skips. Formatting and analysis passed throughout; Linux x64 stable coverage also passed.
  • macOS ARM64 independently confirmed the old nonvariadic ioctl signature fails in both JIT and AOT in an isolated source copy, while the fixed version passes.
  • Independent C-header probes check native structure layout, field access, buffer canaries, raw/restore cycles, invalid descriptors and failed snapshots in JIT and AOT. Darwin's kernel-managed PENDIN bit is excluded from restoration equality; all actual terminal settings remain checked. Window-size tests query the package binding directly so the Console fallback cannot hide an ioctl failure.
  • Subprocess tests use bounded waits, drain both pipes, and terminate/reap children on failure.
  • Workflow token permissions are contents: read; checkout does not persist credentials; no pull_request_target or secrets are used. Coverage upload is restricted to main pushes.
  • ARM32/RISC-V are potential expansion targets inferred from Dart availability, not documented package support promises; neither is claimed tested. See doc/ci-architectures.md.

The old raw-mode example now uses the corrected package bindings. A separate formatting-only commit fixes five existing CI formatting failures; the sixth was in that rewritten example.

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.

2 participants