haskell - Moving .ghc and .cabal to a different user -
how can move ghc , cabal installed packages different user? i've copied directories i'm getting error messages like:
configparser.hs:15:8:     not find module `data.bytestring.char8'     there files missing in `bytestring-0.10.2.0' package,     try running 'ghc-pkg check'.     use -v see list of files searched for. ghc-pkg check shows file package missing. how can resolve this?
note: question intentionally not show research effort, because answered q&a-style.
first, need copy .ghc , .cabal. these contain binary files , configurations.
for simplicity, assume moving user foo user bar. note moving between architectures not possible, binaries produced ghc not platform-independent.
after copying aforementioned directories, there paths /home/foo remaining in different locations. use sed replace (run bar):
sed -i -e "s/foo/bar/g" ~/.cabal/config sed -i -e "s/foo/bar/g" ~/.ghc/*-*/package.conf.d/*.conf however, file ~/.ghc/*-*/package.conf.d/package.cache still contains file references containing username. can't use sed replace, however, because it's binary file , might destroy package cache.
you can use ghc-pkg recache --user re-cache packages.
after performing these steps, should able use cabal packages expected.
Comments
Post a Comment