-
Notifications
You must be signed in to change notification settings - Fork 846
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
Stack complains about parent directory owned by different user #2187
Comments
I have a similar problem under Docker. But creating the folder doesn't help to solve it: Dockerfile:
error:
|
I've just run into this issue too, though it seems to be worse now.
Here's the dockerfile and relevant
|
Workaround: |
@dplusic That's good to know, thanks! Makes sense to me to have stack just always pass in that flag. |
Still exists in 2020 and I don't understand why stack would care about the permissions. |
If anyone is experiencing this issue when trying to run stack in a GitHub Action, you can work around it by manually setting the file ownership to the running user. Just add this step before running stack: - name: Permissions bug workaround
run: "chown -R $(id -un):$(id -gn) ~" |
@
I don't get that same problem using docker-compose builds :( This has to do on how the docker container is run by github actions... that really sucks ... I'm back to using docker-compose |
This error occurs when building with stack: ``` Run stack install --system-ghc --ghc-options='-split-sections -optl-static' 4 Preventing creation of stack root '/github/home/.stack/'. Parent directory '/github/home/' is owned by someone else. 5 Error: Process completed with exit code 1. ``` commercialhaskell/stack#2187
This error occurs when building with stack: ``` Run stack install --system-ghc --ghc-options='-split-sections -optl-static' 4 Preventing creation of stack root '/github/home/.stack/'. Parent directory '/github/home/' is owned by someone else. 5 Error: Process completed with exit code 1. ``` commercialhaskell/stack#2187
This doesn't work (anymore?). |
@hasufell, can you provide any more information about what you are experiencing? There is this code in unless config.allowDifferentUser $ do
unless userOwnsStackRoot $
throwM (UserDoesn'tOwnDirectory stackRoot) but that is behind the EDIT: There is also a distinct error |
Looking at its code, Stack can be configured (the default is otherwise) to use a Stack root 'owned' by another user, but it cannot currently create a Stack root on a absolute path where the user does not 'own' any directory on that path. None of this applies on Windows, and I don't know enough about Unix-like operating systems to know if that is a prudent approach. |
Some history: #471 |
Here's a recent example of this, in a Github linux workflow. |
I should clarify: stack is doing the right thing in my example ("Preventing creation of Stack root '/github/home/.stack/"), but it's another way to trigger this error message in a Github workflow (when using a container, there is confusion about the HOME path. For more info, see actions/runner#1146, actions/runner#863. Worked around with actions/runner#863 (comment) and stack's |
I just encountered an issue where stack complains (and exists with !=0) when it wants to create a stack-root in a location owned by another user. This would be fine in general but even happens when the
--allow-different-user
flag is provided. Of course the user executing stack has write permissions inside that other directory.If I manually create the folder beforehand (
mkdir
) stack doesn't complain at all.The text was updated successfully, but these errors were encountered: