Merge lp:~mbp/bzr/430529-extension-warnings into lp:bzr

Proposed by Martin Pool
Status: Merged
Merged at revision: not available
Proposed branch: lp:~mbp/bzr/430529-extension-warnings
Merge into: lp:bzr
Diff against target: None lines
To merge this branch: bzr merge lp:~mbp/bzr/430529-extension-warnings
Reviewer Review Type Date Requested Status
Vincent Ladeuil Approve
Robert Collins (community) Approve
Review via email: mp+11950@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

Not broken in 2.0, therefore not proposed for it.

You now get just this:

mbp@lithe% ./bzr st
default2a plugin set default format to 2a
unknown:
  bzrlib/tmp.diff
bzr: warning: some compiled extensions could not be loaded; see <https://answers.launchpad.net/bzr/+faq/703>

Revision history for this message
Robert Collins (lifeless) wrote :

> You now get just this:
>
> mbp@lithe% ./bzr st
> default2a plugin set default format to 2a
> unknown:
> bzrlib/tmp.diff
> bzr: warning: some compiled extensions could not be loaded; see <https://answers.launchpad.net/bzr/+faq/703>

That looks a lot nicer. Using a FAQ is ok, but it might be nicer to make
a small help topic for it instead; that way it will be present on the
users machine even if they are offline.

 review +1

review: Approve
Revision history for this message
Vincent Ladeuil (vila) :
review: Approve
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
> Review: Approve
>> You now get just this:
>>
>> mbp@lithe% ./bzr st
>> default2a plugin set default format to 2a
>> unknown:
>> bzrlib/tmp.diff
>> bzr: warning: some compiled extensions could not be loaded; see <https://answers.launchpad.net/bzr/+faq/703>
>
> That looks a lot nicer. Using a FAQ is ok, but it might be nicer to make
> a small help topic for it instead; that way it will be present on the
> users machine even if they are offline.
>
> review +1
>

Aren't you missing a:
trace.mutter('Some extensions failed to load:\n%s'
             % ('\n '.join(_extension_load_failures,))

At least, in the FAQ you say that the failures are in ~/.bzr.log. Maybe
they are there when they are first imported? It might be nice to have a
simple summary at the end.

I agree that it would probably be better as a help topic.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqyKykACgkQJdeBCYSNAANRxgCeLEPSAHcNZ9uhjjVIly7sualI
mSAAn0QGSB6qEmtN2XAQebdpfJNAJAtE
=gJTX
-----END PGP SIGNATURE-----

Revision history for this message
Martin Pool (mbp) wrote :

2009/9/17 John A Meinel <email address hidden>:
> Aren't you missing a:
> trace.mutter('Some extensions failed to load:\n%s'
>             % ('\n    '.join(_extension_load_failures,))
>
> At least, in the FAQ you say that the failures are in ~/.bzr.log. Maybe
> they are there when they are first imported? It might be nice to have a
> simple summary at the end.

That's done at the time the exception originally occurs.

> I agree that it would probably be better as a help topic.

You may be right. I put it here for a couple of reasons:

 - A help topic about 'c extensions' seems like it out to have a
larger scope than just how to deal with this warning and I didn't want
to write that today :-)
 - In general I'm wondering if advice to users should be moved onto the web

--
Martin <http://launchpad.net/~mbp/>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2009-09-16 10:29:18 +0000
+++ NEWS 2009-09-17 06:49:43 +0000
@@ -68,7 +68,7 @@
68* Make sure that we unlock the tree if we fail to create a TreeTransform68* Make sure that we unlock the tree if we fail to create a TreeTransform
69 object when doing a merge, and there is limbo, or pending-deletions69 object when doing a merge, and there is limbo, or pending-deletions
70 directory. (Gary van der Merwe, #427773)70 directory. (Gary van der Merwe, #427773)
71 71
72* Prevent some kinds of incomplete data from being committed to a 2a72* Prevent some kinds of incomplete data from being committed to a 2a
73 repository, such as revisions without inventories or inventories without73 repository, such as revisions without inventories or inventories without
74 chk_bytes root records.74 chk_bytes root records.
@@ -83,7 +83,8 @@
83 running using pure-Python versions, but this may be substantially83 running using pure-Python versions, but this may be substantially
84 slower. The warning can be disabled by setting84 slower. The warning can be disabled by setting
85 ``ignore_missing_extensions = True`` in ``bazaar.conf``.85 ``ignore_missing_extensions = True`` in ``bazaar.conf``.
86 (Martin Pool, #406113)86 See also <https://answers.launchpad.net/bzr/+faq/703>.
87 (Martin Pool, #406113, #430529)
8788
88Documentation89Documentation
89*************90*************
9091
=== modified file 'bzrlib/osutils.py'
--- bzrlib/osutils.py 2009-09-11 06:39:56 +0000
+++ bzrlib/osutils.py 2009-09-17 06:49:43 +0000
@@ -920,12 +920,13 @@
920 if GlobalConfig().get_user_option_as_bool('ignore_missing_extensions'):920 if GlobalConfig().get_user_option_as_bool('ignore_missing_extensions'):
921 return921 return
922 # the warnings framework should by default show this only once922 # the warnings framework should by default show this only once
923 warnings.warn(923 from bzrlib.trace import warning
924 "bzr: warning: Failed to load compiled extensions:\n"924 warning(
925 " %s\n" 925 "bzr: warning: some compiled extensions could not be loaded; "
926 " Bazaar can run, but performance may be reduced.\n"926 "see <https://answers.launchpad.net/bzr/+faq/703>")
927 " Check Bazaar is correctly installed or set ignore_missing_extensions"927 # we no longer show the specific missing extensions here, because it makes
928 % '\n '.join(_extension_load_failures,))928 # the message too long and scary - see
929 # https://bugs.launchpad.net/bzr/+bug/430529
929930
930931
931try:932try:
932933
=== modified file 'bzrlib/tests/test_osutils.py'
--- bzrlib/tests/test_osutils.py 2009-09-11 06:36:50 +0000
+++ bzrlib/tests/test_osutils.py 2009-09-17 06:49:43 +0000
@@ -29,6 +29,7 @@
29 errors,29 errors,
30 osutils,30 osutils,
31 tests,31 tests,
32 trace,
32 win32utils,33 win32utils,
33 )34 )
34from bzrlib.tests import (35from bzrlib.tests import (
@@ -1824,7 +1825,19 @@
1824 self.assertEquals(osutils._extension_load_failures[0],1825 self.assertEquals(osutils._extension_load_failures[0],
1825 "No module named _fictional_extension_py")1826 "No module named _fictional_extension_py")
18261827
1827 def test_report_extension_load_failures(self):1828 def test_report_extension_load_failures_no_warning(self):
1828 self.assertTrue(self._try_loading())1829 self.assertTrue(self._try_loading())
1829 warnings, result = self.callCatchWarnings(osutils.report_extension_load_failures)1830 warnings, result = self.callCatchWarnings(osutils.report_extension_load_failures)
1830 self.assertLength(1, warnings)1831 # it used to give a Python warning; it no longer does
1832 self.assertLength(0, warnings)
1833
1834 def test_report_extension_load_failures_message(self):
1835 log = StringIO()
1836 trace.push_log_file(log)
1837 self.assertTrue(self._try_loading())
1838 osutils.report_extension_load_failures()
1839 self.assertContainsRe(
1840 log.getvalue(),
1841 r"bzr: warning: some compiled extensions could not be loaded; "
1842 "see <https://answers\.launchpad\.net/bzr/\+faq/703>\n"
1843 )