Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,400
    • Issues 5,400
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 590
    • Merge requests 590
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #14533
Closed
Open
Issue created Nov 27, 2017 by Niklas Hambüchen@nh2Reporter

Make GHC more robust against PC crashes by using atomic writes

Yesterday my Windows machine crashed when ghc was building, left me with a lot of corrupted .hi files (and probably .o files as well).

That made me think if we should change ghc to write its output with atomic moves.

Discussion on #ghc:

bgamari:
nh2: well, perhaps
I'm not sure it's terribly common for compilers to take such precautions though
and if we were to do it for interface files then presumably we would also want to do it for object files

siarheit_:
that would be very nice

geekosaur:
compilers in general are happy to write out incomplete/garbage object files

bgamari:
it seems that way

nh2:
bgamari: right, if we wanted to do it we should do it for all files ghc writes.
Possible that other compilers can also write garbage, but maybe ghc can do better -- one less thing the developer has to think about

Phyx-:
most compilers also don't do the aggressive recompilation avoidance things we do either..
corrupt hi files wouldn't be an issue if the next time it would override them :)
Trac metadata
Trac field Value
Version 8.2.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC nh2
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking