haskell / haskell-platform

Distribution of Haskell with batteries included
http://www.haskell.org/platform/
Other
381 stars 91 forks source link

Installation of Haskell platform should not insist on root permission #212

Open nrnrnr opened 9 years ago

nrnrnr commented 9 years ago

I don't like to grant root permission when not necessary. The Haskell platform needs only to be able to write into /usr/local, and if the scripts don't find themselves with root permission or with permission to write /, they should try to continue silently with the permissions they need.

gbaz commented 8 years ago

@dagit also curious if you have any insight on how we might tweak the scripts here?

I think just this script: https://github.com/haskell/haskell-platform/blob/master/hptool/os-extras/posix/installer/install-haskell-platform.sh.mu

and this script: https://github.com/haskell/haskell-platform/blob/master/hptool/os-extras/posix/bin/activate-hs

need to be modified.

And in fact it may just be the former script A) removing the root check and B) unpacking to a lower level directory (if even that?)

NicoleRauch commented 8 years ago

Today I tried exactly that (prefixing all paths in install_haskell_platform.sh and adjusting the prefix in activate-hs), and this allowed me to install the Haskell platform without root access. But whenever I tried to execute any of the commands (stack, ghc, ...) it complained that it could not find something in /usr/local. So there must be something else that needs to be done.

I ended up following these instructions https://github.com/yantonov/install-ghc/blob/master/ubuntu/install-ghc-ubuntu.md which allowed me to install stack without root access, so I got Haskell "through the backdoor". Not nice, though, and I agree that I'd rather prefer the Haskell platform installer to ask me for a path prefix, and then it should place everything into that folder.

gbaz commented 8 years ago

Thanks for the report!

I think all the stuff as described here https://github.com/haskell/haskell-platform/issues/234#issuecomment-191046183 also need to happen, just to maintain continuity across the related tickets...