Skip to content

[fork CI] Windows test portability fixes - #1

Closed
skymanbp wants to merge 4 commits into
mainfrom
fix/windows-test-portability
Closed

[fork CI] Windows test portability fixes#1
skymanbp wants to merge 4 commits into
mainfrom
fix/windows-test-portability

Conversation

@skymanbp

@skymanbp skymanbp commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Fork-internal PR whose only purpose is to run the Windows + macOS matrix on the fix branch before submitting upstream. See the commit message for the full root-cause analysis.

skymanbp and others added 4 commits August 18, 2026 14:00
…tions

Three root causes, all test-infrastructure (no library code changed),
found by the Windows CI lanes and reproduced on a Windows 11 machine:

1. Missing .gitattributes: with git's core.autocrlf=true (the Windows
   default), checkout rewrites the CSV fixtures' LF to CRLF - including
   newlines EMBEDDED IN QUOTED FIELDS (git does not know CSV) - so the
   byte-level fastcsv reader sees corrupted input and the
   fast_roundtrip_newlines / fast_roundtrip_quotes_and_newlines
   round-trips fail. Fixed by marking *.csv / *.tsv -text.

2. Text-mode writes in test harnesses: Data.Text.IO writeFile/hPutStrLn
   honour the handle's text mode, which on Windows (a) translates \n to
   \r\n, corrupting quoted embedded newlines (typed_quote_spans_boundary,
   and the round-trip rewrite path in prettyPrintSeparated), and (b)
   encodes via the OS locale codepage, crashing fast_roundtrip_utf8 with
   'cannot encode character' on non-UTF-8 codepages (e.g. CP936). Fixed
   by Data.Text.IO.Utf8 (same signatures, byte-mode UTF-8, no new
   dependency; text >= 2.1 is already required) and, for the streaming
   pretty-printer, hSetEncoding utf8 + hSetNewlineMode
   noNewlineTranslation.

3. Hardcoded /tmp paths: toCsv_roundTrip wrote to /tmp (does not exist
   on Windows); fixed with getTemporaryDirectory. The same pattern in
   Properties/Csv.hs (two sites) now uses the suite's existing
   tests/data/unstable_csv scratch dir.

Verified on Windows 11 (GHC 9.12.4): dataframe suite 1097/1097,
dataframe-fastcsv suite 61/61, zero errors/failures - previously
toCsv_roundTrip, fast_roundtrip_newlines,
fast_roundtrip_quotes_and_newlines and typed_quote_spans_boundary
failed (https://github.com/skymanbp/dataframe/actions/runs/32095552668).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A repo-wide sweep for '/tmp' found one more test writing there:
deriveSchemaReadsCsv in tests/Operations/Record.hs. It passed on a dev
machine that happened to have C:\tmp (Windows resolves /tmp against
the drive root) but fails on CI runners. Same fix as WriteCsv.hs:
getTemporaryDirectory + the byte-mode UTF-8 writer. The two other
grep hits are not test-filesystem uses (a benchmark default argument
and a pure URI-predicate check) and are left untouched.

Local re-run: dataframe 1097/1097, dataframe-fastcsv 61/61, zero
errors/failures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@skymanbp
skymanbp force-pushed the fix/windows-test-portability branch from 402e473 to ed1fcbd Compare August 18, 2026 18:01
@skymanbp

Copy link
Copy Markdown
Owner Author

Served its purpose: this fork-internal PR existed only to trigger the fork's CI (Windows + macOS lanes) while iterating on the portability fixes. The real PR is now upstream: DataHaskell#212. Closing; branches are kept (fix/windows-test-portability is DataHaskell#212's head, fix/windows-test-portability-with-ci preserves the CI-run provenance).

@skymanbp skymanbp closed this Aug 19, 2026
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