haskell / haskell/cabal

Error: The process cannot access the file because it is being used by another process

Open
#9,587 1 comment 0 reactions 0 assignees View on GitHub
cabal-install: cmd/build platform: windows type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**
When compiling on Windows:

The following error occurs:

```
Installing library in C:\cabal\store\ghc-9.2.8\incoming\new-3144\cabal\store\ghc-9.2.8\bytestring-bu_-0.10.8._-b8a4e372acfcff40320e5e31ea22798d79297bbd\lib
D:\a\cardano-node\cardano-node\dist-newstyle\tmp\src-3144\bytestring-builder-0.10.8.2.0\bytestring-builder.cabal: removeDirectoryRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:DeleteFile "\\\\?\\D:\\a\\cardano-node\\cardano-node\\dist-newstyle\\tmp\\src-3144\\bytestring-builder-0.10.8.2.0\\bytestring-builder.cabal": permission denied (The process cannot access the file because it is being used by another process.)
```

**To Reproduce**
This is reproducible in Github Actions:

https://github.com/IntersectMBO/cardano-node/actions/runs/7418459148/job/20186416497?pr=5624

**Expected behavior**
Either the files are opened without an exclusive lock, or the file is closed in a timely manner or the file deletion is retried until the file is unlocked. Whichever way `cabal` should never fail with this error.

**System information**
- Windows
- `cabal-3.10.2.0`
- `ghc-8.2.8`

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.