Merge lp:~vila/bzr-gtk/388790-windows-setup into lp:bzr-gtk/gtk2

Proposed by Vincent Ladeuil
Status: Merged
Merge reported by: Vincent Ladeuil
Merged at revision: not available
Proposed branch: lp:~vila/bzr-gtk/388790-windows-setup
Merge into: lp:bzr-gtk/gtk2
Diff against target: 31 lines (+14/-1)
1 file modified
__init__.py (+14/-1)
To merge this branch: bzr merge lp:~vila/bzr-gtk/388790-windows-setup
Reviewer Review Type Date Requested Status
GuilhemBichot (community) Approve
Alexander Belchenko Approve
Bazaar GTK maintainers Pending
Review via email: mp+15541@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

This is a cleaned up version of the patch proposed in https://bugs.edge.launchpad.net/bzr/+bug/388790.

Guilhem, can you test it again on the two cited envs (Vladislav's and yours) and report here.

Bialix, can you comment again about the validity of the approach (the path needs to be tweaked for bzr.exe *only*) ?

If no bzr-gtk dev objects, I'll land this patch as soon as I get confirmation from both of you plus a little delay (for objections).

Revision history for this message
Alexander Belchenko (bialix) wrote :

Yes, that's correct, sys.path manipulations needed only for bzr.exe. This approach assumes that all extra libs required for <email address hidden> is placed in _lib subdirectory inside directory where plugin resides.

And:

#sys.path.append(here)

^-- yep, you really don't need this append. I dunno why it was there.

review: Approve
Revision history for this message
Vincent Ladeuil (vila) wrote :

> Yes, that's correct, sys.path manipulations needed only for bzr.exe. This
> approach assumes that all extra libs required for <email address hidden> is placed in
> _lib subdirectory inside directory where plugin resides.

Oh my, I understand the intent now :-(
So that's really a workaround waiting for a better windows packaging that can provide
the needed gtk libraries, I'll add a comment to clarify that.

>
> And:
>
> #sys.path.append(here)
>
> ^-- yep, you really don't need this append. I dunno why it was there.

Ok. Good.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Vincent Ladeuil пишет:
>> Yes, that's correct, sys.path manipulations needed only for bzr.exe. This
>> approach assumes that all extra libs required for <email address hidden> is placed in
>> _lib subdirectory inside directory where plugin resides.
>
> Oh my, I understand the intent now :-(

And why it makes you sad? We did this for QBzr for couple of years long
before QBzr was accepted to be a part of TortoiseBzr and therefore
starting bundled into bzr.exe installer.

> So that's really a workaround waiting for a better windows packaging that can provide
> the needed gtk libraries, I'll add a comment to clarify that.

To be clear, yes, this is workaround, and it required not only for
bzr-gtk. But for bzr-git as well, and many other plugins which dare to
use some extra libs. This is how py2exe worked. There is nothing special
about bzr-gtk. We all in the same boat.

But please, don't start the thread about "bzr.exe must die". Pretty please.

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4469 (20090930) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru

Revision history for this message
GuilhemBichot (guilhem-bichot) wrote :

Vladislav Vaintroub my colleague and me confirm that the patch works. I branched Vincent's bzr-gtk branch into my plugins directory, also put there (inside bzr-gtk) the _lib directory found in Kevin Light's package (available at http://bazaar-vcs.org/bzr-gtk?action=show&redirect=BzrGtk), and then gannotate/viz/gcommit work.
Vincent: about what your patch does. We had observed that when using the standalone bzr Windows installer, bzr-gtk cannot find pygtk (even though pygtk is properly installed). Looks like that version of bzr cannot look for modules out of certain predefined places. Kevin Light's solution is
1) to bundle pygtk and other modules in one directory (makes a quicker install than installing pygtk, pygobject, etc etc)
2) to instruct bzr to look into that directory (which is done through a patch to bzr-gtk adding the directory to the search path).
He created a patched version of bzr-gtk available at http://bazaar-vcs.org/bzr-gtk?action=show&redirect=BzrGtk, but that is based on bzr-gtk 0.96. And it's annoying to have to use the old 0.96 for us.
With your patch, we can use Kevin's approach (put a _lib directory when you install) but without using 0.96: we can do it with the bzr-gtk dev branch, which is better.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Guilhem, bzr.exe can't find pygtk because it working with bundled python interpreter and therefore even don't try to find your installed Python. Therefore you need to place any extra libs to _lib.

Revision history for this message
GuilhemBichot (guilhem-bichot) wrote :

Alexander: yes, this is what we are doing and it works :-)

Revision history for this message
Alexander Belchenko (bialix) wrote :

Yes, I know that it works, we do the same in qbzr. I'm just trying to explain why bzr.exe "can't" find installed pygtk.

Revision history for this message
GuilhemBichot (guilhem-bichot) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '__init__.py'
--- __init__.py 2009-09-17 14:35:47 +0000
+++ __init__.py 2009-12-02 11:30:24 +0000
@@ -34,6 +34,20 @@
34visualise Graphically visualise this branch. 34visualise Graphically visualise this branch.
35"""35"""
3636
37import os
38import sys
39
40if getattr(sys, "frozen", None) is not None: # we run bzr.exe
41 # NOTE: _lib must be ahead of bzrlib or sax.saxutils (in olive) fails
42 here = os.path.dirname(__file__)
43 sys.path.insert(0, os.path.join(here, '_lib'))
44 sys.path.append(os.path.join(here, '_lib/gtk-2.0'))
45 # Do we really need the following (since we are executing that code, we
46 # should already be on the path at the appropriate place, I'm concerned
47 # about masking import bugs by adding that)? Can someone test and report?
48 #sys.path.append(here)
49
50
37import bzrlib51import bzrlib
38import bzrlib.api52import bzrlib.api
39from bzrlib import (53from bzrlib import (
@@ -43,7 +57,6 @@
43 )57 )
44from bzrlib.commands import plugin_cmds58from bzrlib.commands import plugin_cmds
4559
46import os.path
4760
48version_info = (0, 98, 0, 'dev', 1)61version_info = (0, 98, 0, 'dev', 1)
4962

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: