Bug 891909 - Can't make install with non-standard prefix as non-root
Can't make install with non-standard prefix as non-root
Status: NEW
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-04 07:24 EST by Matthew Booth
Modified: 2014-09-07 19:02 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Matthew Booth 2013-01-04 07:24:53 EST
./configure ... -prefix=$(pwd)/install-root
make install

I have found failures in the ocaml and python directories. There are probably others, but I stopped looking.

In the ocaml directory, the issue is:

  $(OCAMLFIND) install \
    -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
    guestfs \
    META *.so *.a *.cma *.cmx *.cmxa *.cmi $(srcdir)/*.mli

It tries to install to $(OCAMLLIB), which was obtained from 'ocamlc -where', and therefore points to the system location rather than a directory under $(prefix). Note that DESTDIR is orthoganal to this issue.

Similarly, the issue in the python directory relates to the use of PYTHON_INSTALLDIR which was obtain from the system tool, and is therefore not a directory under $(prefix).
Comment 1 Richard W.M. Jones 2013-01-16 03:49:28 EST
Yeah I suspect there are lots of issues with using a prefix.
We have never tested this.  (DESTDIR OTOH *does* work, since that's
what we use to build RPMs).

Anyhow, patches welcome!

(In reply to comment #0)
> In the ocaml directory, the issue is:
> 
>   $(OCAMLFIND) install \
>     -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
>     guestfs \
>     META *.so *.a *.cma *.cmx *.cmxa *.cmi $(srcdir)/*.mli
> 
> It tries to install to $(OCAMLLIB), which was obtained from 'ocamlc -where',
> and therefore points to the system location rather than a directory under
> $(prefix). Note that DESTDIR is orthoganal to this issue.

About this, I don't really think you would want this to
obey $(prefix).  The correct place to install OCaml libraries
is in `ocamlc -where`.  If you install them some other place
then you end up having to set environment variables.
Comment 2 Daniel Berrange 2013-01-18 10:35:39 EST
(In reply to comment #1)
> > In the ocaml directory, the issue is:
> > 
> >   $(OCAMLFIND) install \
> >     -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
> >     guestfs \
> >     META *.so *.a *.cma *.cmx *.cmxa *.cmi $(srcdir)/*.mli
> > 
> > It tries to install to $(OCAMLLIB), which was obtained from 'ocamlc -where',
> > and therefore points to the system location rather than a directory under
> > $(prefix). Note that DESTDIR is orthoganal to this issue.
> 
> About this, I don't really think you would want this to
> obey $(prefix).  The correct place to install OCaml libraries
> is in `ocamlc -where`.  If you install them some other place
> then you end up having to set environment variables.

IMHO if you are trying to build into a non-standard prefix, then setting environment variables is to be expected. eg if you build into $HOME/libguestfs you'll already need to set $PATH, $LD_LIBRARY_PATH for the binaries/libraries. Setting other things like PERL5LIB, PYTHONPATH, and whatever for OCAML is totally reasonable.

Note You need to log in before you can comment on or make changes to this bug.