Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Permission denied" error: cabal v2-clean + windows + source-repository-package #6933

Closed
jneira opened this issue Jun 29, 2020 · 3 comments · Fixed by #10190
Closed

"Permission denied" error: cabal v2-clean + windows + source-repository-package #6933

jneira opened this issue Jun 29, 2020 · 3 comments · Fixed by #10190

Comments

@jneira
Copy link
Member

jneira commented Jun 29, 2020

Describe the bug

  • In a project with a source-repository-package, after whatever command that triggers the checkout of the remote package, a cabal v2-clean fails with:
D:\dev\ws\haskell\hls\dist-newstyle\src\cabal-plan-42253b883cc08e6b\.git\objects\pack\pack-c3bf961b7416d8452ca36187ab82474e84f77980.pack: removeDirectoryRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:DeleteFile "\\\\?\\D:\\dev\\ws\\haskell\\hls\\dist-newstyle\\src\\cabal-plan-42253b883cc08e6b\\.git\\objects\\pack\\pack-c3bf961b7416d8452ca36187ab82474e84f77980.pack": permission denied (Acceso denegado.)
  • rmdir .\dist-newstyle -for -rec deletes the directory succesfully

To Reproduce

> cabal v2-build any-pkg-with-source-repo-package
> cabal v2-clean

Expected behavior

cabal clean should delete the directory dist-newstyle

System information

  • Operating system: windows 10
  • cabal-3.2.0.0, ghc-8.8.3
  • git version: 2.27.0.windows.1
@fendor
Copy link
Collaborator

fendor commented Mar 15, 2023

To Reproduce
Steps to reproduce the behavior:

$ mkdir some-dir
$ cd some-dir
$ cabal init -n
$ cat cabal.project
packages: ./

source-repository-package
  type:git
  location: https://github.com/pepeiborra/ekg-json
  tag: 7a0af7a8fd38045fd15fb13445bdcc7085325460

Now run the commands:

$ cabal v2-build
$ cabal v2-clean
D:\Privat\Documents\programming\haskell\cabal-bug-extra-sources\dist-newstyle\src\ekg-json-22461580dac5d569\.git\objects\pack\pack-e4512fa369e17e4072b6931011453082eace5e88.pack: removeDirectoryRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:DeleteFile "\\\\?\\D:\\Privat\\Documents\\programming\\haskell\\cabal-bug-extra-sources\\dist-newstyle\\src\\ekg-json-22461580dac5d569\\.git\\objects\\pack\\pack-e4512fa369e17e4072b6931011453082eace5e88.pack": permission denied (Access is denied.)

@avently
Copy link

avently commented Sep 15, 2023

Any news about this issue? Actually, it stops from building on Windows (happens with cabal build).
dist-newstyle/src/somePackage/.git/modules/someModule/objects/pack/packFileName.pack has permissions r-r-r, which means it can not be deleted by "directory" package, see for more info:
commercialhaskell/stack#2426
If you want to build, you have to delete such pack file yourself or at least make it writable. All builds in Github actions fails and need workaround to be applied.

@jasagredo
Copy link
Collaborator

Closing as a duplicate of #10182 (which IMO has more concrete information)

@jasagredo jasagredo closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2024
@mergify mergify bot closed this as completed in #10190 Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants