[fork CI] Windows test portability fixes - #1
Closed
skymanbp wants to merge 4 commits into
Closed
Conversation
…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
force-pushed
the
fix/windows-test-portability
branch
from
August 18, 2026 18:01
402e473 to
ed1fcbd
Compare
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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.