Skip to content
  • Ben Gamari's avatar
    ghc-pkg: Try opening lockfiles in read-write mode first · f86de44d
    Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
    As pointed out in #13945, some filesystems only allow allow exclusive
    locks if the fd being locked was opened for write access. This causes
    ghc-pkg to fail as it first attempts to open and exclusively lock its
    lockfile in read-only mode to accomodate package databases for which we
    lack write permissions (e.g.  global package databases).
    
    Instead, we now try read-write mode first, falling back to read-only
    mode if this fails.
    
    Reviewers: austin
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #13945
    
    Differential Revision: https://phabricator.haskell.org/D3897
    f86de44d