-
Notifications
You must be signed in to change notification settings - Fork 842
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 when run stack setup on Windows 10 #1917
Comments
Strange. And you have permission to write to that directory ( |
This comment may be relevant: #216 (comment) Perhaps the error message is really poor and the issue is really that the dir |
Yes, I do have permission. Also I run a shell (cmd.exe) as administrator.
No, there is no such directory. C:\Users\username\AppData\Local\Programs\stack\x86_64-windows\ does not contain any subdirectories at all. |
Unfortunately I have no idea, and I don't know much about windows. Please update this ticket if you find a solution |
Thanks msgloan for pointing, I indeed had the same issue. I ended up using an Admin cmd to do |
Found workaround: |
@Yury-Zakharov |
@louy2 |
@louy2 Perhaps you have an old stack version? |
|
As is pointed out in this cabal issue, the error could be caused by renameDirectory failing on Windows if the new path already exists. Curiously, the only place this function is used is in Fetch.hs as part of a work-around solution for #157. My naive approach to solve this would be to delete the directory at when exists $ do
when (newDist == oldDist) $ D.removeDirectoryRecursive newDist
-- Previously used takeDirectory, but that got confused
-- by trailing slashes, see:
-- https://github.com/commercialhaskell/stack/issues/216
--
-- Instead, use Path which is a bit more resilient
ensureDir . parent =<< parseAbsDir newDist
D.renameDirectory oldDist newDist |
Stack mostly uses |
Ah thanks for pointing that out I somehow missed it. |
@Narrative, @mgsloan - In my case (see the original posting) it behaves in just the opposite manner: when there is no destination directory, it fails, when the directory already exists it successfully rewrites it (deletes and creates a new one). Weird behavior for me... |
Strange! @mrkkrp Any possibility this has anything to do with path-io related changes? |
Well, |
@mrkkrp Cool thanks for the info! Since this issue is quite puzzling, I'm just considering all possibilities. |
Just wanted to say that I've also hit the problem (Windows 8.1 x64), and indeed the workaround of removing |
Funny enough, the second time (different machine, same OS) I had to manually create the 🎲 |
Ok, I can't get it to work:
Could it be that the move is too shortly after the 7z call and the old dir is still locked? |
I'm having this problem when cloning an existing stack project. I don't know if that makes any difference. The command that fails is:
And I'm running this as admin. |
In my case I ran
first as a non-admin user. After deleting the tar file and re-running the command as admin I managed to install ghc. |
There's a chance there may have been virus scanning in the directory. Cloning a repo will bring down a lot of files the scanner will find interesting unless you create a scanning exclusion. |
I have same permission issue when I try stack setup on Win10 x64. Is there any chance that it will work or is it better to setup Linux virtual. This issue is open for months. [SOLVED] |
I was having this exact same problem and indeed, after turning off antivirus, |
Definitely seems to be the antivirus. |
Seems like there isn't anything to fix in stack here, and the conversation has gotten long . Closing as a support ticket, where the suggested resolutions include:
Please open additional tickets for similar issues. |
I have the same problem, but only if I do stack build the second time (after changing code in any way). The first time after booting windows it works no problem, but later it doesn't. It might be related to some windows permissions problems, because I have the same problem (permission denied) with Steam actualization of some games on that machine. I also wonder if it's maybe related to windows 260 char path limtation, but I disabled that in registry and it didn't helped. |
No, this is due to anti-virus as indicated previously. |
I think I figured it out. I wasn't able to install |
I thought I had the problem, when running 'stack install' to generate some exes. But I still had the exes running, which gave a 'permission denied'. Closing them solved the problem. |
I don't know if this is related to anti-virus or not, but what worked for me was deleting everything in %localappdata%\Programs\stack\x86_64-windows, then running stack setup again. If you have other versions of GHC in that folder then maybe move them somewhere else before deleting and back after. |
Still having this issue. |
Confirmed exact same behavior with Kaspersky Internet Security 20.0.14.1085(i). Disabling it for a while does the trick |
I eccounter this error in a non-admin user, I had to extract manually the contents move to the expected folder (ghc-xxx and msys2-xxx) and run again stack. It's bad that I had to run multiple times |
By manually removing the destination folder indicated by the error message, the |
You don't have to disable it. Adding an Exclusion for |
Hello, and I met with the same problem.
I searched on the internet and found a possible solution in haskell-removedirectoryrecursive-permission-denied-on-windows requiring modification in the code of Fetch.hs Could it be mended? Or is there any other way to setup? thank you a lot! |
more possible information: https://groups.google.com/g/haskell-stack/c/imL8dwOxZFI?pli=1 |
OS: Windows 10 x64
stack version: Version 1.0.4, Git revision cf18703 (3220 commits) x86_64
GHC version: Not installed
Anamnesis:
after installing stack 1.0.4 run "stack new ..."
run "stack setup" stack downloads and extracts ghc files but then terminates with the following output:
C:\Users\username\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3-tmp9724\ghc-7.10.3: MoveFileEx "C:\Users\username\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3-tmp9724\ghc-7.10.3" "C:\Users\username\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3": permission denied (Access is denied.)
The text was updated successfully, but these errors were encountered: