Hello
I have added this in my stack.yaml
- location:
git: https://github.com/bos/aeson.git
commit: 4de5a203eeeea593457bc92bc40062f3ea830426
The purpose is to use a aeson version that fixed one bug which is not yet supported in LTS-4.1(my version)
Then when i stack build, i got the error
removeDirectoryRecursive: permission denied (Access is denied.)
Potentially also related: #1917
@Osager can you post a more complete log?
I also wonder: why are all those folders read-only? What's up? Is it somehow stack's fault?
Thanks everyone
I've switched to LTS-6.10 and circumvent the issue
I have a similar issue. Yesterday I installed a git-related package for the Atom editor. Everything worked fine. Today, impossible to run stack in the project folder. I'm lost. I don't know whether this is related to git or to another Atom package such as haskell-ghc-mod, which causes strange things too.
I've just removed git from the path and it works now. So this is related to git.
Again: can somebody try a failing command with the -v option and post the log?
This seems now a duplicate of #2426 but it would be good to confirm.
I've just thought about something strange. I had something like this in stack.yaml:
packages:
- '.'
- location:
git: https://github.com/qrilka/xlsx.git
commit: 420e16ca238df80f9bb226d3f9c065463ccdc3e2
extra-dep: true
Yesterday, at a moment when git was not in my path, I had this misleading message: https://github.com/commercialhaskell/stack/issues/2420.
Then I put git in the path and everything worked fine.
Today stack install/build/exec -- ghci does not work when git is in my path.
I've just done a test: I've deleted the folder .stack-work/downloaded. Then, after deleting this folder, I can run stack while git is in my path. And I observed that after running stack exec -- ghci, the github link in stack.yaml has been downloaded again in .stack-work/downloaded, the folder just deleted.
Therefore, it seems that stack tries to delete this folder when git is in the path. And we get the message removeDirectoryRecursive: permission denied (Access is denied.) because this folder is not empty.
IIRC in some cases stack deletes checked out repos to reclone them (if updating fails for instance). Per #2426 that can fail because some files are read-only. Still, logs with -v would be useful to know what happens instead of guessing.
stack -v ? Ok, I'll try next time I have a problem. Now, after the update of the github repo, stack works whether git is in my path or not.
@stla Yes. More precisely, if say stack build fails, please attach the log of stack build -v.
Here is one log:
位 stack exec -v -- ghci
Version 1.1.2, Git revision c6dac65e3174dea79df54ce6d56f3e98bc060ecc (3647 commits) x86_64 hpack-0.14.0
2017-01-23 21:04:58.133523: [debug] Checking for project config at: C:\HaskellProjects\jsonxlsx\stack.yaml @(stack_9kewhubnl5WIl89fhd1ea2:Stack.Config src/Stack\Config.hs:811:9)
2017-01-23 21:04:58.133523: [debug] Loading project config file stack.yaml @(stack_9kewhubnl5WIl89fhd1ea2:Stack.Config src/Stack\Config.hs:829:13)
2017-01-23 21:04:58.149123: [debug] Trying to decode C:\stack_root\build-plan-cache\x86_64-windows\nightly-2017-01-17.cache @(stack_9kewhubnl5WIl89fhd1ea2:Data.Binary.VersionTagged src/Data\Binary\VersionTagged.hs:55:5)
2017-01-23 21:04:58.164723: [debug] Success decoding C:\stack_root\build-plan-cache\x86_64-windows\nightly-2017-01-17.cache @(stack_9kewhubnl5WIl89fhd1ea2:Data.Binary.VersionTagged src/Data\Binary\VersionTagged.hs:64:13)
2017-01-23 21:04:58.164723: [debug] Asking GHC for its version @(stack_9kewhubnl5WIl89fhd1ea2:Stack.Setup.Installed src/Stack\Setup\Installed.hs:94:13)
2017-01-23 21:04:58.164723: [debug] Run process: ghc --numeric-version @(stack_9kewhubnl5WIl89fhd1ea2:System.Process.Read src/System\Process\Read.hs:283:3)
2017-01-23 21:04:58.633724: [debug] Getting Cabal package version @(stack_9kewhubnl5WIl89fhd1ea2:Stack.GhcPkg src/Stack\GhcPkg.hs:165:5)
2017-01-23 21:04:58.633724: [debug] Run process: ghc-pkg --no-user-package-db field --simple-output Cabal version @(stack_9kewhubnl5WIl89fhd1ea2:System.Process.Read src/System\Process\Read.hs:283:3)
2017-01-23 21:04:58.773327: [debug] Resolving package entries @(stack_9kewhubnl5WIl89fhd1ea2:Stack.Setup src/Stack\Setup.hs:221:5)
2017-01-23 21:04:58.773327: [debug] Run process: git reset --hard 420e16ca238df80f9bb226d3f9c065463ccdc3e2 -- @(stack_9kewhubnl5WIl89fhd1ea2:System.Process.Read src/System\Process\Read.hs:283:3)
removeDirectoryRecursive: permission denied (Access is denied.)
Closing as an old need-repro. Feel free to re-open if it's still a problem.
It never occured anymore for me (maybe after I updated stack).