haskell / haskell/cabal

Cope with `FileLockingNotSupported` in Store logic

Open
#5,072 17 comments 0 reactions 0 assignees View on GitHub
cabal-install: v2-build system type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

On some non-Windows archs (e.g. Solaris, as well as AIX depending on GHC version), `hLock` and `hTryLock` may (unconditionally) throw `FileLockingNotSupported`. This is a problem because the current nix-style store logic doesn't handle this exception thus on such platforms `cabal new-build` is currently unusable.

One simple way to simulate this issue on more mainstream archs is by modifying our `Distribution.Client.Compat.FileLock` module to have its exported `hLock` and `hTryLock` unconditionally throw `FileLockingNotSupported`.

Contributor guide

Open the contributing guide

Research direction

Start with Distribution.Client.Compat.FileLock and the nix-style store logic used by cabal new-build; simulate the issue by making hLock and hTryLock throw FileLockingNotSupported. Trace where the exception reaches store operations, then verify that cabal new-build works on the simulated failure path and on supported platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.