commercialhaskell / commercialhaskell/stack

openTempFileWithDefaultPermissions may fail with "permission denied" message on Virtual Box mounted folder

Open
#1,918 2 comments 0 reactions 0 assignees View on GitHub
component: Windows
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

To reproduce this error you will need:
1. Virtual Box 5 running on Windows host (I had no opportunity to test it on other systems, possibly it is not Windows specific).
2. Linux runnig on Virtual Box (in my case CentOS 7) and host folder mounted in.
3. Project located in mounted folder.
4. Project sould contain .zip-ed package in remote location, in my case it was:

```
- location: https://github.com/tweag/sparkle/archive/master.zip
subdirs:
- sparkle
```

This is important, because projects from hackage will be builded without issues.

stack build command will fail with following message:

```
ghc-pkg: .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/package.conf.inplace/:
openTempFileWithDefaultPermissions: permission denied (Operation not
permitted)
```

I had not much time to investigate it further, but I suspect that the problem is in mounted folder - it provides quite a litte functionality and possibly does not supports openTempFileWithDefaultPermissions. To resolve this issue I suggest to add parameter to stack.yaml which will specify working dirrectory location (.stack-work by default). This would allow to move stack working dirrectory outside the host-mounted folder, in this case build will work just fine.

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.