haskell / haskell/cabal

PackageTest fails calling removePathForcibly

Open
#11,933 2 comments 1 reaction 0 assignees View on GitHub
platform: windows type: bug type: testing
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

https://github.com/haskell/cabal/actions/runs/26943999676/job/79492266496?pr=11916 fails with a call to `removePathForcibly` in the test `PackageTests\MultiRepl\InternalLibs\cabal.test.hs` for "Validate windows-latest ghc-9.10.3", a "Validate cli-suite" test:

> permission denied (The process cannot access the file because it is being used by another process.)

```
D:\a\_temp\cabal-testsuite-117960\cabal.dist\work\.\dist\multi-out-146040\paths\foo-0.1.0.0-inplace-z: removePathForcibly:removePathForcibly:removePathForcibly:DeleteFile "\\\\?\\D:\\a\\_temp\\cabal-testsuite-117960\\cabal.dist\\work\\dist\\multi-out-146040\\paths\\foo-0.1.0.0-inplace-z": permission denied (The process cannot access the file because it is being used by another process.)
```

I haven't been able reproduce this locally running just this test with:

```
$ cabal run cabal-testsuite:cabal-tests -- --with-cabal=./dist-newstyle/build/x86_64-linux/ghc-9.10.3/cabal-install-3.17.0.0/x/cabal/build/cabal/cabal cabal-testsuite/PackageTests/MultiRepl/InternalLibs/cabal.test.hs
```

There are a few other tests in this directory:

```
$ ls -1 cabal-testsuite/PackageTests/InternalLibraries/*.test.hs
cabal-testsuite/PackageTests/InternalLibraries/cabal-per-package.test.hs
cabal-testsuite/PackageTests/InternalLibraries/cabal.test.hs
cabal-testsuite/PackageTests/InternalLibraries/setup-gen-pkg-config.test.hs
cabal-testsuite/PackageTests/InternalLibraries/setup-gen-script.test.hs
cabal-testsuite/PackageTests/InternalLibraries/setup-per-component.test.hs
cabal-testsuite/PackageTests/InternalLibraries/setup.test.hs
```

#11604 is a recent change to "Replace removeDirectoryRecursive with a more robust removePathForcibly".

Contributor guide

Open the contributing guide

Research direction

Start with PackageTests\MultiRepl\InternalLibs\cabal.test.hs and the linked Windows CI failure, then review #11604's change to removePathForcibly. Run the provided cabal-testsuite command and compare it with the windows-latest ghc-9.10.3 validation. Done means the affected test no longer fails with a permission-denied removePathForcibly error.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.