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

spago shouldn't try to create $HOME if it doesn't exist #711

Closed
dhess opened this issue Dec 14, 2020 · 3 comments
Closed

spago shouldn't try to create $HOME if it doesn't exist #711

dhess opened this issue Dec 14, 2020 · 3 comments

Comments

@dhess
Copy link

dhess commented Dec 14, 2020

While trying to make spago test work in a nixpkgs derivation, I ran into this issue:

[error] Directory "/" is not accessible. Permissions {readable = True, writable = False, executable = False, searchable = True}

This happens because, when nixpkgs builds a derivation, it sets $HOME to a non-existent location:

2020-12-14 14:15:37.905847: [debug] Running `getGlobalCacheDir`
@(src/Spago/RunEnv.hs:44:7)
2020-12-14 14:15:37.906423: [debug] Directory "/homeless-shelter/.cache/spago" does not exist, creating...
@(src/Spago/Prelude.hs:189:7)
2020-12-14 14:15:37.906462: [debug] Directory "/homeless-shelter/.cache" does not exist, creating...
@(src/Spago/Prelude.hs:189:7)
2020-12-14 14:15:37.906487: [debug] Directory "/homeless-shelter" does not exist, creating...
@(src/Spago/Prelude.hs:189:7)
2020-12-14 14:15:37.906559: [error] Directory "/" is not accessible. Permissions {readable = True, writable = False, executable = False, searchable = True}
@(src/Spago/Prelude.hs:125:13)

Note that spago tries to do this even when spago test is run with --global-cache=skip!

So I think there are 2 issues here:

  1. Don't go any further up the path than $HOME when trying to create the global cache directory.
  2. --global-cache=skip should not try to create $HOME/.cache/spago at all.
@f-f
Copy link
Member

f-f commented Dec 14, 2020

It sounds like this is a duplicate of #704, which was fixed in #705?

The fix will be shipped in the upcoming 0.18 release, which I'm about to cut.

@dhess
Copy link
Author

dhess commented Dec 14, 2020

Sorry! I searched for a similar issue, but obviously not well enough!

@dhess dhess closed this as completed Dec 14, 2020
@f-f
Copy link
Member

f-f commented Dec 14, 2020

No worries at all 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants