Share a .stack folder between different users

113 views
Skip to first unread message

Ben MacAdam

unread,
Oct 23, 2019, 5:25:43 PM10/23/19
to haskell-stack
Hi,

I'm trying to figure out a way to share the same .stack file between different users, including one user who will not have write access to the .stack file. The specific use case I'm interested in is setting up a global .stack for a university lab, so that students in the class I'm TAing can use stack without running up against storage constraints. Ideally this would allow for a shared pantry, since some projects can still use upwards of 1GB of packages.

Thanks,
Ben

Steven Shaw

unread,
Oct 23, 2019, 6:18:11 PM10/23/19
to Ben MacAdam, haskell-stack
Assuming your students are logged into the same machine you should be able to use the STACK_ROOT environment variable. You should be able to use OS permissions to prevent write access to a particular user.

Ben MacAdam

unread,
Oct 24, 2019, 3:34:09 PM10/24/19
to haskell-stack
There seems to be an issue trying this out on my own machine - the students seem to need write access to stack.sqlite3.pantry-write-lock

>/Users/ROOT_ACCOUNT/.stack/pantry/pantry.sqlite3.pantry-write-lock: openFd: permission denied (Permission denied)

Is there any way to have a local lock file?

Steven Shaw

unread,
Oct 24, 2019, 8:01:46 PM10/24/19
to Ben MacAdam, haskell-stack
I don't think you want to have a local lock file. I imagine it's there to prevent corruption when used from multiple processes.

Assuming your student are in the same group, try this:

chmod g+w "${STACK_ROOT}/stack.sqlite3.pantry-write-lock"
chmod g+w "${STACK_ROOT}/pantry/pantry.sqlite3.pantry-write-lock"
echo 'allow-different-user: true' >>"${STACK_ROOT}/config.yaml"


--
You received this message because you are subscribed to the Google Groups "haskell-stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stac...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/efb09866-399c-4fb7-ad74-47d075f93f06%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages