haskell / ghcup-hs

https://www.haskell.org/ghcup/
GNU Lesser General Public License v3.0
267 stars 80 forks source link

Handling of `~/.ghcup/share` #1065

Open hasufell opened 1 month ago

hasufell commented 1 month ago

Unfortunately it's a symlink. If we want to install other manpages, we have to migrate it to a proper directory and only symlink the ghc manpage.

Related: https://github.com/haskell/ghcup-hs/issues/235

dfordivam commented 1 month ago

Currently the share dir is a link to the dir inside the currently set ghc.

.ghcup/share -> ./ghc/<ver>/share

The man page is located here .ghcup/share/man/man1/ghc.1

The ghcup man page should be put alongside ghc's, ie here .ghcup/share/man/man1/ghcup.1

There are at least three related concerns

  1. Fresh installation

During the fresh installation, ideally manpages should be installed by the bootstrap script. The bootstrap script will have knowledge of where manpages are published (hopefully alongside the exe?)

  1. Upgrade from older ghcup (when .ghcup/share is still a symlink)

when user upgrades from older ghcup, only the new exe would be installed. So the ghcup itself would have to do the migration of .ghcup/share, which would involve removing the link, and the perform rest of steps of the installation + setting the doc and ghc's man links.

The ghcup would need to know where the manpages are published for its own version.

  1. Upgrade ghcup, after the migration from symlink

    This should be straightforward, when the upgrade modifies the .ghcup/bin/ghcup, alongside this new manpage would be installed.

Another change required wrt the handling of .ghcup/share is about setting the currently set ghc's doc dir's contents to .ghcup/share/doc/, and link the ghc/share/man/man1/ghc.1 to .ghcup/share/man/man1/ghc.1.