Re: [Libguestfs] make install ignoring PREFIX for bash_completion
Date: Tue, 3 Feb 2015 09:36:01 -0800 Subject: make install ignoring PREFIX for bash_completion
I am trying to install the libguestfs python bindings in my virtualenv. Since this cannot be done through PIP,
The PIP problem is https://bugzilla.redhat.com/show_bug.cgi?id=1075594 Unfortunately we are stuck here because the pypi website still has a license that we cannot live with (it would have the effect of assigning all work we upload to them). They have said this is not their intention, but declined to do anything about the actual wording.
I was trying to do the following:
https://github.com/libguestfs/libguestfs/commit/fcbfc4775fa2a44020974073594a...
To get to building the python dist, I did the following:
git clone https://github.com/libguestfs/libguestfs.git git checkout 1.28.5 ./autogen.sh --disable-php --disable-ruby --disable-gobject --disable-golang --disable-erlang --disable-lua --prefix=/home/dev/venv make rm po-docs/podfiles; make -C po-docs update-po make make -C python sdist make install
However at the "make install" step, I get the following error:
make[2]: Entering directory '/home/dev/libguestfs/bash' make[2]: Nothing to be done for 'install-exec-am'. /bin/mkdir -p /usr/share/bash-completion/completions cp -d guestfish guestmount virt-alignment-scan virt-rescue virt-resize virt-builder virt-cat virt-df virt-edit virt-filesystems virt-format virt-inspector virt-log virt-ls virt-sparsify virt-sysprep /usr/share/bash-completion/completions cp: cannot create regular file '/usr/share/bash-completion/completions/guestfish': Permission denied cp: cannot create regular file '/usr/share/bash-completion/completions/guestmount': Permission denied cp: cannot create regular file '/usr/share/bash-completion/completions/virt-alignment-scan': Permission denied cp: cannot create regular file '/usr/share/bash-completion/completions/virt-rescue': Permission denied cp: cannot create regular file '/usr/share/bash-completion/completions/virt-resize': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-builder': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-cat': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-df': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-edit': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-filesystems': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-format': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-inspector': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-log': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-ls': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-sparsify': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-sysprep': Permission denied Makefile:1671: recipe for target 'install-data-local' failed make[2]: *** [install-data-local] Error 1
Why is the install process trying to copy files in to /usr/share/ and not /home/dev/venv/usr/share/? Am I doing something wrong or is there a workaround for this?
After trying './configure --prefix=/tmp && make && make install' I see there's a disturbingly large number of problems/bugs in this area ... The configure script only uses --prefix so far, but frequently overrides it. eg: OCaml scripts are always installed in `ocamlc -where' and in the case above bash-completion scripts are always installed in `pkg-config --variable=completionsdir bash-completion'. I guess whether you think this is a bug or a feature depends on your point of view ... After using 'python sdist', can't you use the tarball (in python/dist) in order to create a venv directly? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
I am trying to install the libguestfs python bindings in my virtualenv. Since this cannot be done through PIP,
The PIP problem is https://bugzilla.redhat.com/show_bug.cgi?id=1075594 Unfortunately we are stuck here because the pypi website still has a license that we cannot live with (it would have the effect of assigning all work we upload to them). They have said this is not their intention, but declined to do anything about the actual wording.
I was trying to do the following:
https://github.com/libguestfs/libguestfs/commit/fcbfc4775fa2a44020974073594a...
To get to building the python dist, I did the following:
git clone https://github.com/libguestfs/libguestfs.git git checkout 1.28.5 ./autogen.sh --disable-php --disable-ruby --disable-gobject --disable-golang --disable-erlang --disable-lua --prefix=/home/dev/venv make rm po-docs/podfiles; make -C po-docs update-po make make -C python sdist make install
However at the "make install" step, I get the following error:
make[2]: Entering directory '/home/dev/libguestfs/bash' make[2]: Nothing to be done for 'install-exec-am'. /bin/mkdir -p /usr/share/bash-completion/completions cp -d guestfish guestmount virt-alignment-scan virt-rescue virt-resize virt-builder virt-cat virt-df virt-edit virt-filesystems virt-format virt-inspector virt-log virt-ls virt-sparsify virt-sysprep /usr/share/bash-completion/completions cp: cannot create regular file '/usr/share/bash-completion/completions/guestfish': Permission denied cp: cannot create regular file '/usr/share/bash-completion/completions/guestmount': Permission denied cp: cannot create regular file '/usr/share/bash-completion/completions/virt-alignment-scan': Permission denied cp: cannot create regular file '/usr/share/bash-completion/completions/virt-rescue': Permission denied cp: cannot create regular file '/usr/share/bash-completion/completions/virt-resize': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-builder': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-cat': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-df': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-edit': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-filesystems': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-format': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-inspector': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-log': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-ls': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-sparsify': Permission denied cp: cannot remove '/usr/share/bash-completion/completions/virt-sysprep': Permission denied Makefile:1671: recipe for target 'install-data-local' failed make[2]: *** [install-data-local] Error 1
Why is the install process trying to copy files in to /usr/share/ and not /home/dev/venv/usr/share/? Am I doing something wrong or is there a workaround for this?
After trying './configure --prefix=/tmp && make && make install' I see there's a disturbingly large number of problems/bugs in this area ...
The configure script only uses --prefix so far, but frequently overrides it. eg: OCaml scripts are always installed in `ocamlc -where' and in the case above bash-completion scripts are always installed in `pkg-config --variable=completionsdir bash-completion'.
Ah I see what is going on now. Interestingly I had this somehow working with 1.27.49. I unfortunately did not keep detailed notes.
I guess whether you think this is a bug or a feature depends on your point of view ...
After using 'python sdist', can't you use the tarball (in python/dist) in order to create a venv directly?
I think I will be able to install the python library in the venv using the tarball. However, won't my liguestfs application require some of the binaries installed as part of 'make install' for running? I am trying to not have libguestfs installed outside of the venv. Thanks, Aravindh
After using 'python sdist', can't you use the tarball (in python/dist) in order to create a venv directly?
I think I will be able to install the python library in the venv using the tarball. However, won't my liguestfs application require some of the binaries installed as part of 'make install' for running? I am trying to not have libguestfs installed outside of the venv.
Yes, it'll require only the following files and directory (using their normal install location): /usr/lib64/libguestfs.so.0 -> libguestfs.so.0.<N>.0 /usr/lib64/libguestfs.so.0.<N>.0 /usr/lib64/guestfs/supermin.d You can move these files/directory anywhere you want. You will need to set the environment variables `LD_LIBRARY_PATH' so that the shared library is found, and `LIBGUESTFS_PATH' so that the supermin.d directory can be found (you have to set LIBGUESTFS_PATH to the *parent* directory of supermin.d). If you look at the 'run' script which is created in the top level source directory you can see some of the many environment variables that may be set and how they are used. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
After using 'python sdist', can't you use the tarball (in python/dist) in order to create a venv directly?
I think I will be able to install the python library in the venv using the tarball. However, won't my liguestfs application require some of the binaries installed as part of 'make install' for running? I am trying to not have libguestfs installed outside of the venv.
Yes, it'll require only the following files and directory (using their normal install location):
/usr/lib64/libguestfs.so.0 -> libguestfs.so.0.<N>.0 /usr/lib64/libguestfs.so.0.<N>.0 /usr/lib64/guestfs/supermin.d
I noticed that these files are already present in the venv, at the end of the failed "make install". (venv)apxeng@virt:~/devel/venv/lib$ ls guestfs libguestfs.a libguestfs.la libguestfs.so libguestfs.so.0 libguestfs.so.0.423.0 pkgconfig python2.7 x86_64-linux-gnu So I went to the next step of building the python bindings. I untarred guestfs-1.28.5.tar.gz and ran: (venv)apxeng@virt:~/devel/libguestfs/python/dist/guestfs-1.28.5 (ba8179d...)$ python setup.py build running build running build_py creating build creating build/lib.linux-x86_64-2.7 copying guestfs.py -> build/lib.linux-x86_64-2.7 running build_ext building 'libguestfsmod' extension creating build/temp.linux-x86_64-2.7 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGUESTFS_PRIVATE=1 -I. -I../src -I/usr/include/python2.7 -c guestfs-py-byhand.c -o build/temp.linux-x86_64-2.7/guestfs-py-byhand.o x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGUESTFS_PRIVATE=1 -I. -I../src -I/usr/include/python2.7 -c guestfs-py.c -o build/temp.linux-x86_64-2.7/guestfs-py.o x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGUESTFS_PRIVATE=1 -I. -I../src -I/usr/include/python2.7 -c utils.c -o build/temp.linux-x86_64-2.7/utils.o x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/guestfs-py-byhand.o build/temp.linux-x86_64-2.7/guestfs-py.o build/temp.linux-x86_64-2.7/utils.o -lguestfs -o build/lib.linux-x86_64-2.7/libguestfsmod.so /usr/bin/ld: cannot find -lguestfs collect2: error: ld returned 1 exit status error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 I did set the LD_LIBRARY_PATH to the one in the venv. "export LD_LIBRARY_PATH=~/devel/venv/lib/" BTW, the command complained about not finding guestfs.h, so I copied it over to that directory. Do I need to do something for the python build process to find the libguestfs library? Thanks, AP
participants (2)
-
AP -
Richard W.M. Jones