[libvirt] [python PATCH] maint: document development against uninstalled libvirt

Thanks to Dan's recent work in libvirt.git, it is much easier to develop against uninstalled libvirt. Mention how. * README: More details. Signed-off-by: Eric Blake <eblake@redhat.com> --- README | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README b/README index ad50828..df1de59 100644 --- a/README +++ b/README @@ -21,6 +21,21 @@ or to install as non-root python setup.py build python setup.py install --user +If python-nose is installed, you can test the package with + + python setup.py test + +A makefile shim is provided so that you can do + + make && make check + +rather than directly invoking setup.py. + +As of libvirt 1.2.6, it is possible to develop against an uninstalled +libvirt.git checkout, by setting some environment variables: + + export PKG_CONFIG_PATH=/path/to/libvirt/git/src/ + export LD_LIBRARY_PATH=/path/to/libvirt/git/src/.libs/ Patches for this code should be sent to the main libvirt development mailing list -- 1.9.3

On 06/25/14 18:53, Eric Blake wrote:
Thanks to Dan's recent work in libvirt.git, it is much easier to develop against uninstalled libvirt. Mention how.
* README: More details.
Signed-off-by: Eric Blake <eblake@redhat.com> --- README | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
ACK, Peter

On 06/25/2014 10:59 AM, Peter Krempa wrote:
On 06/25/14 18:53, Eric Blake wrote:
Thanks to Dan's recent work in libvirt.git, it is much easier to develop against uninstalled libvirt. Mention how.
* README: More details.
Signed-off-by: Eric Blake <eblake@redhat.com> --- README | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
ACK,
Thanks; pushed. FYI: I'm also using this (but considered it hackish enough to not publish as a formal patch): $ echo /GNUmakefile >> .git/info/exclude $ cat GNUmakefile # My hidden wrapper to preset things that I like... include Makefile export LD_LIBRARY_PATH=/home/eblake/libvirt/src/.libs/ export PKG_CONFIG_PATH=/home/eblake/libvirt/src/ $ Now all I have to do is run 'python setup.py build' to build against installed libvirt, vs. 'make' to build against development libvirt, at least for my machine. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Wed, Jun 25, 2014 at 11:12:52AM -0600, Eric Blake wrote:
On 06/25/2014 10:59 AM, Peter Krempa wrote:
On 06/25/14 18:53, Eric Blake wrote:
Thanks to Dan's recent work in libvirt.git, it is much easier to develop against uninstalled libvirt. Mention how.
* README: More details.
Signed-off-by: Eric Blake <eblake@redhat.com> --- README | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
ACK,
Thanks; pushed.
FYI: I'm also using this (but considered it hackish enough to not publish as a formal patch):
$ echo /GNUmakefile >> .git/info/exclude $ cat GNUmakefile # My hidden wrapper to preset things that I like... include Makefile export LD_LIBRARY_PATH=/home/eblake/libvirt/src/.libs/ export PKG_CONFIG_PATH=/home/eblake/libvirt/src/ $
Now all I have to do is run 'python setup.py build' to build against installed libvirt, vs. 'make' to build against development libvirt, at least for my machine.
It occurs to me that if we edit the 'run' script in libvirt GIT to set that PKG_CONFIG_PATH setting, then you could build and test the python bindings by doing /home/eblake/libvirt/run python setup.py build Or in your case with the make wrapper /home/eblake/libvirt/run make Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 06/26/2014 03:38 AM, Daniel P. Berrange wrote:
Now all I have to do is run 'python setup.py build' to build against installed libvirt, vs. 'make' to build against development libvirt, at least for my machine.
It occurs to me that if we edit the 'run' script in libvirt GIT to set that PKG_CONFIG_PATH setting, then you could build and test the python bindings by doing
/home/eblake/libvirt/run python setup.py build
Or in your case with the make wrapper
/home/eblake/libvirt/run make
Nice; I'll post a followup patch to document that (it fits well with the run script being able to do anything else that favors the uninstalled libvirt). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Wed, Jun 25, 2014 at 11:12:52AM -0600, Eric Blake wrote:
On 06/25/2014 10:59 AM, Peter Krempa wrote:
On 06/25/14 18:53, Eric Blake wrote:
Thanks to Dan's recent work in libvirt.git, it is much easier to develop against uninstalled libvirt. Mention how.
* README: More details.
Signed-off-by: Eric Blake <eblake@redhat.com> --- README | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
ACK,
Thanks; pushed.
FYI: I'm also using this (but considered it hackish enough to not publish as a formal patch):
$ echo /GNUmakefile >> .git/info/exclude $ cat GNUmakefile # My hidden wrapper to preset things that I like... include Makefile export LD_LIBRARY_PATH=/home/eblake/libvirt/src/.libs/ export PKG_CONFIG_PATH=/home/eblake/libvirt/src/ $
For people like me, who use 'git clean -fxd'; it removes such excludes. :( How about either adding similar GNUmakefile, of modifying the Makefile you added into the repo liike this" The path used for the exports would be something like: $(pwd | sed -e 's_/libvirt\(\.git\)\?/_/libvirt-python\1/') but only if such path exists. There would be nothing changed for those who do not have such paths. It could be also hidden under some other make command (e.g. make devel). Does that make sense or is it not worth trying to do that at all? Martin
Now all I have to do is run 'python setup.py build' to build against installed libvirt, vs. 'make' to build against development libvirt, at least for my machine.

On Mon, Jun 30, 2014 at 02:53:04PM +0200, Martin Kletzander wrote:
On Wed, Jun 25, 2014 at 11:12:52AM -0600, Eric Blake wrote:
On 06/25/2014 10:59 AM, Peter Krempa wrote:
On 06/25/14 18:53, Eric Blake wrote:
Thanks to Dan's recent work in libvirt.git, it is much easier to develop against uninstalled libvirt. Mention how.
* README: More details.
Signed-off-by: Eric Blake <eblake@redhat.com> --- README | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
ACK,
Thanks; pushed.
FYI: I'm also using this (but considered it hackish enough to not publish as a formal patch):
$ echo /GNUmakefile >> .git/info/exclude $ cat GNUmakefile # My hidden wrapper to preset things that I like... include Makefile export LD_LIBRARY_PATH=/home/eblake/libvirt/src/.libs/ export PKG_CONFIG_PATH=/home/eblake/libvirt/src/ $
For people like me, who use 'git clean -fxd'; it removes such excludes. :(
How about either adding similar GNUmakefile, of modifying the Makefile you added into the repo liike this"
The path used for the exports would be something like: $(pwd | sed -e 's_/libvirt\(\.git\)\?/_/libvirt-python\1/') but only if such path exists. There would be nothing changed for those who do not have such paths. It could be also hidden under some other make command (e.g. make devel).
Does that make sense or is it not worth trying to do that at all?
IMHO this GNUmakefile Eric suggests is just duplicating what the 'run' script already does. eg if you have libvirt & libvirt-python checked out at the same place, you can just do '../libvirt/run make' or '../libvirt run python setup.py build' Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Mon, Jun 30, 2014 at 02:05:39PM +0100, Daniel P. Berrange wrote:
On Mon, Jun 30, 2014 at 02:53:04PM +0200, Martin Kletzander wrote:
On Wed, Jun 25, 2014 at 11:12:52AM -0600, Eric Blake wrote:
On 06/25/2014 10:59 AM, Peter Krempa wrote:
On 06/25/14 18:53, Eric Blake wrote:
Thanks to Dan's recent work in libvirt.git, it is much easier to develop against uninstalled libvirt. Mention how.
* README: More details.
Signed-off-by: Eric Blake <eblake@redhat.com> --- README | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
ACK,
Thanks; pushed.
FYI: I'm also using this (but considered it hackish enough to not publish as a formal patch):
$ echo /GNUmakefile >> .git/info/exclude $ cat GNUmakefile # My hidden wrapper to preset things that I like... include Makefile export LD_LIBRARY_PATH=/home/eblake/libvirt/src/.libs/ export PKG_CONFIG_PATH=/home/eblake/libvirt/src/ $
For people like me, who use 'git clean -fxd'; it removes such excludes. :(
How about either adding similar GNUmakefile, of modifying the Makefile you added into the repo liike this"
The path used for the exports would be something like: $(pwd | sed -e 's_/libvirt\(\.git\)\?/_/libvirt-python\1/') but only if such path exists. There would be nothing changed for those who do not have such paths. It could be also hidden under some other make command (e.g. make devel).
Does that make sense or is it not worth trying to do that at all?
IMHO this GNUmakefile Eric suggests is just duplicating what the 'run' script already does. eg if you have libvirt & libvirt-python checked out at the same place, you can just do '../libvirt/run make' or '../libvirt run python setup.py build'
Yep, you can, but if you don't (and have some subdirs for example), than might help, someone. I'm doing "~lv/run make", so that was not for me anyway ;) Martin
Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 06/30/2014 06:53 AM, Martin Kletzander wrote:
FYI: I'm also using this (but considered it hackish enough to not publish as a formal patch):
$ echo /GNUmakefile >> .git/info/exclude $ cat GNUmakefile # My hidden wrapper to preset things that I like... include Makefile export LD_LIBRARY_PATH=/home/eblake/libvirt/src/.libs/ export PKG_CONFIG_PATH=/home/eblake/libvirt/src/ $
For people like me, who use 'git clean -fxd'; it removes such excludes. :(
Daniel's trick of using 'path/to/libvirt/run make' is good enough to not need this file. Or, you could modify your $PATH to include /path/to/libvirt, and just use 'run make', even after nuking non-tracked files in the repository.
How about either adding similar GNUmakefile, of modifying the Makefile you added into the repo liike this"
At this point, I still don't think it's worth adding anything further to the libvirt-python repository, other than documentation in README about using Dan's 'run' trick. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (4)
-
Daniel P. Berrange
-
Eric Blake
-
Martin Kletzander
-
Peter Krempa