Skip to content

Fix fixity issue when catching exceptions when handling .hie files - #5178

Merged
crtschin merged 1 commit into
haskell:masterfrom
crtschin:crtschin/handle-generation-errors-fixity
Nov 16, 2026
Merged

crtschin merged 1 commit into
haskell:masterfrom
crtschin:crtschin/handle-generation-errors-fixity

Conversation

@crtschin

Copy link
Copy Markdown
Collaborator

Fixes the flaky CI failure on Windows. Precedence meant that the handler only wrapped the pure [] like so.

action >> (pure [] `catches` [...])

Which meant that interface file writes could cause the rule to fail despite the handlers. Fixing the parentheses fixes the CI failures, succeeding 40/40 times, where it previously failed 18/40.

Rule: GetModIfaceFromDisk
Target: ...\srcA\C.hs
Message: renameFile:renamePath:MoveFileEx "...\extNNNN" "...\C.hie": permission denied (Access is denied.)
CI failure logs
  ThreadId 10 | 2026-11-14T22:22:34.997549Z | Info | Server exited successfully
        ghcide-test\exe\DiagnosticTests.hs:269:
        T should typecheck using srcA's C. Diagnostics: [("srcA\\T.hs",[]),("srcA\\C.hs",[Diagnostic {_range = Range {_start = Position {_line = 0, _character = 0}, _end = Position {_line = 1, _character = 0}}, _severity = Just DiagnosticSeverity_Error, _code = Nothing, _codeDescription = Nothing, _source = Just "compiler", _message = "Rule execution aborted due to exception\n\nRule: GetModIfaceFromDisk\nTarget: C:\\hls-tests\\extra-dir-843457525509\\srcA\\C.hs\nMessage: C:\\hls-tests\\extra-dir-843457525510\\ghcide\\main-22f50aa5a855db38728e295ef666a60b647a17af\\ext330A: renameFile:renamePath:MoveFileEx \"\\\\\\\\?\\\\C:\\\\hls-tests\\\\extra-dir-843457525510\\\\ghcide\\\\main-22f50aa5a855db38728e295ef666a60b647a17af\\\\ext330A\" Just \"\\\\\\\\?\\\\C:\\\\hls-tests\\\\extra-dir-843457525510\\\\ghcide\\\\main-22f50aa5a855db38728e295ef666a60b647a17af\\\\C.hie\": permission denied (Access is denied.)\nContext:\nWhile handling C:\\hls-tests\\extra-dir-843457525510\\ghcide\\main-22f50aa5a855db38728e295ef666a60b647a17af\\ext330A: renamePath:MoveFileEx \"\\\\\\\\?\\\\C:\\\\hls-tests\\\\extra-dir-843457525510\\\\ghcide\\\\main-22f50aa5a855db38728e295ef666a60b647a17af\\\\ext330A\" Just \"\\\\\\\\?\\\\C:\\\\hls-tests\\\\extra-dir-843457525510\\\\ghcide\\\\main-22f50aa5a855db38728e295ef666a60b647a17af\\\\C.hie\": permission denied (Access is denied.)\n\n\n", _tags = Nothing, _relatedInformation = Just [DiagnosticRelatedInformation {_location = Location {_uri = Uri {getUri = "file:///C:/hls-tests/extra-dir-843457525509/srcA/C.hs"}, _range = Range {_start = Position {_line = 0, _character = 0}, _end = Position {_line = 1, _character = 0}}}, _message = "GetModIfaceFromDisk"}], _data_ = Nothing}]),("srcB\\C.hs",[])]

  • I read and followed our AI policy
  • I proposed a solution draft in the corresponding issue (for non-trivial changes and new features)
    • This is especially encouraged for new contributors

@crtschin
crtschin marked this pull request as ready for review November 15, 2026 00:19
@crtschin
crtschin requested a review from wz1000 as a code owner November 15, 2026 00:19

@fendor fendor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing :)

@crtschin
crtschin force-pushed the crtschin/handle-generation-errors-fixity branch from 3a4e5e5 to 8c715b0 Compare November 16, 2026 09:31
@crtschin
crtschin enabled auto-merge (squash) November 16, 2026 09:31
@crtschin
crtschin merged commit b5182a6 into haskell:master Nov 16, 2026
45 of 47 checks passed
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