dspinellis / git-issue

Git-based decentralized issue management
GNU General Public License v3.0
776 stars 66 forks source link

installation paths for non-system-wide installs and runtime path checking inconsistency #61

Closed jmtd closed 4 years ago

jmtd commented 4 years ago

If a user does not wish to install system-wide, they might invoke make PREFIX="$HOME", as recommended by your youtube script/session for example.

In that circumstance, the library file(s) will be installed into $HOME/lib. However, git-issue does not default to check that location for the library file at start-up. The places it looks are as follows (ignoring GIT_ISSUE_LIB_PATH), and in this descending order

  1. lib adjacent to the invoked script. This makes a lot of sense for local
    development of git-issue.
  2. LD_LIBRARY_PATH, the linux loader's path for shared object files. This doesn't make a lot of sense to me, but it does not seem harmful.
  3. system-wide /usr/lib
  4. local system-wide /usr/local/lib.

3 and 4 should really be swapped; normal would be for distro packages to install into /usr/lib, and if the same is present in /usr/local/lib then the local system owner has installed that by hand and as such it is most likely the preferred version.

But really whatever the user supplied as PREFIX to the make invocation should be checked under by the installed script. This probably means the script needs to be pre-processed by the install phase (or a phase depended upon by the install phase) of the Makefile to insert the necessary PREFIX value. I don't think you are currently performing any such pre-processing for any other purpose. How do you feel about it?

As a side-issue I think installing into $HOME/.local/lib, $HOME/.local/bin etc. would be nicer for when a user installs into HOME. (I planned to write "this would be conformant the XDG base specification but then I checked and was surprised to find it did not define these places. I suppose a quick fix might be to add $HOME/.local/lib to the search path regardless). But PREFIX is perhaps not exclusively used for installing into HOME so this is tricky to establish.