Skip to content

CI: revert smoke-test '| cat > file' workaround when .NET 11 preview 4 SDK ships #319

@richlander

Description

@richlander

Context

CI smoke tests in .github/workflows/ci.yml were temporarily changed from

dotnet-inspect ... > smoke.md

to

dotnet-inspect ... | cat > smoke.md

(see commits in PR #317 and PR #312) to work around a .NET 11 preview 3 SDK regression.

Root cause (upstream)

dotnet/runtime#125512 routed ConsolePal.Unix.Write through RandomAccess.Write(fd, buffer, fileOffset: 0). On a seekable fd (regular file opened by shell > redirection), that becomes pwrite(fd, buffer, 0) on every call — so each Console.WriteLine overwrites from byte 0 of the file. On a pipe (e.g. | cat) the runtime falls back to write(2) and the output is correct.

Symptom for dotnet-inspect: cmd > file.md produced ~256 bytes of fragmented mid-line content (the truncated tail of whatever the last buffer flush wrote); cmd | cat > file.md produced the full ~2 KB of valid markdown.

Local repro (50 line program, 3750 bytes total):

SDK > file | cat > file
11.0.100-preview.1.26104.118 3750 3750
11.0.100-preview.2.26159.112 3750 3750
11.0.100-preview.3.26207.106 75 3750

(75 bytes = exactly the last Console.WriteLine.)

Already fixed upstream

dotnet/runtime#126844 (issue #126843, merged 2026-04-20) reverts the RandomAccess.Write switch back to the original Interop.Sys.Write loop.

The fix did not make the preview 3 cut, so GitHub-hosted runners are still on the broken SDK.

Action

When .NET 11 preview 4 ships (expected 2026-05-12, Patch Tuesday) and the GitHub Actions runner image picks it up:

  • Verify a fresh CI run on main works with cmd > file (revert workaround locally and try)
  • Remove | cat from the six smoke tests in .github/workflows/ci.yml (steps "Smoke test - package quiet/normal/...", "type/member command (oneline/markdown)") and the explanatory comment above the first one
  • Close this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions