Diff for "LaunchpadOnKarmic"

Not logged in - Log In / Register

Differences between revisions 1 and 53 (spanning 52 versions)
Revision 1 as of 2009-07-27 23:40:32
Size: 1374
Editor: maxb
Comment:
Revision 53 as of 2009-09-23 18:18:12
Size: 9431
Editor: maxb
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
As mentioned on [[Getting]], Launchpad is not currently supported on Ubuntu Karmic Koala, primarily because it currently has a hard dependency on Python 2.4, which is no longer included in Karmic. This page is a place to collect notes written for and by people living on the bleeding edge and developing Launchpad on Karmic.
Line 3: Line 3:
This page is a place to collect notes written for and by people living on the bleeding edge and attempting to get Launchpad working on Karmic / Python 2.5 It has also become slightly co-opted as a place to manage the migration towards compatibility with the newer Python versions which Karmic prefers by default.
Line 5: Line 5:
== launchpad-dependencies ==
First, there is the issue that the ~launchpad PPA doesn't have any packages for Karmic. I (maxb) have tweaked the launchpad-dependencies package to have a first approximation of suitable dependencies for Python 2.5, and uploaded it to my PPA [[https://launchpad.net/~maxb/+archive/ppa]], and copied the geoip-data-city-lite package from the ~launchpad PPA there as well for convenience.
= PPA Dependencies =
The [[https://launchpad.net/~launchpad/+archive/ppa|Launchpad PPA]] now contains a complete set of packages for the Karmic series.

= Launchpad on Karmic with Python 2.4 =
It works pretty much, but there's an unresolved issue wherein setuptools' way of supporting Python namespace packages tends to leave you using the lazr.* packages installed into the system site-packages directory, despite the Launchpad buildout's best efforts.

This manifests as the following test failures:
 * Problems importing `lazr.enum`:
  * lp.codehosting.puller.tests.test_scheduler.!TestPullerMasterIntegration.test_mirror
  * lp.codehosting.puller.tests.test_scheduler.!TestPullerMasterIntegration.test_mirror_with_destination_self_locked
  * lp.codehosting.puller.tests.test_acceptance.!TestBranchPuller.test_hosted_branch_stacked_on_mirrored_branch
  * lp.codehosting.puller.tests.test_acceptance.!TestBranchPuller.test_manual_stacking
  * lp.codehosting.puller.tests.test_acceptance.!TestBranchPuller.test_mirror_hosted_branch
  * lp.codehosting.puller.tests.test_acceptance.!TestBranchPuller.test_mirror_hosted_loom_branch
  * lp.codehosting.puller.tests.test_acceptance.!TestBranchPuller.test_mirror_imported_branch
  * lp.codehosting.puller.tests.test_acceptance.!TestBranchPuller.test_mirror_mirrored_branch
  * lp.codehosting.puller.tests.test_acceptance.!TestBranchPuller.test_mirror_private_branch
  * lp.codehosting.puller.tests.test_acceptance.!TestBranchPuller.test_remirror_hosted_branch
  * lp.codehosting.puller.tests.test_acceptance.!TestBranchPuller.test_stack_mirrored_branch
  * lp.codehosting.puller.tests.test_acceptance.!TestBranchPuller.test_stack_mirrored_branch_onto_private
  * lp.services.scripts.tests.test_all_scripts.!ScriptsTestCase.test_scripts
 * Unicode vs. bytestring issues:
  * eggs/launchpadlib-1.5.1-py2.4.egg/launchpadlib/docs/people.txt
  * eggs/launchpadlib-1.5.1-py2.4.egg/launchpadlib/docs/toplevel.txt

Workaround: Remove the symlinks at `/usr/lib/python2.{4,5}/site-packages/lazr.*-nspkg.pth` and trust to the fact that Karmic's default Python is 2.6 to hopefully not break anything on your system that wanted to use them.

= Moving to newer Python versions: Python 2.5 =

The ultimate goal is to migrate Launchpad to Python 2.6. Rather than go straight to Python 2.6, I (maxb) am focusing on Python 2.5 first as a stepping stone.

https://bugs.launchpad.net/launchpad-foundations/+bugs?field.tag=python-upgrade
Line 9: Line 39:
https://code.launchpad.net/~maxb/launchpad/python2.5 contains a few fixes:
 * Adjusting the Python version in the Makefiles
 * Adjusting import statements to handle the built-in location of cElementTree in Python 2.5
https://code.launchpad.net/~maxb/launchpad/python2.5 tracks `lp:launchpad/stable` (or occasionally `devel`), on a manual basis, and acts as a one-stop-shop for something that people can check out and build using Python 2.5
Line 13: Line 41:
== Launchpad source dependencies - Zope ==
https://code.launchpad.net/~maxb/zope3/launchpad-3.4-py2.5 contains backports of some changes to zope.proxy and zope.security in post-3.4 Zope releases which are required for Python 2.5 compatibility (possibly only on 64-bit architectures). Without these, Launchpad produces perplexing MemoryErrors.
Remaining changes in `python2.5` branch:
 * Changed `PYTHON_VERSION` in Makefiles
 * Changed shebang in `cronscripts/*`, `scripts/*`,

== Launchpad source dependencies (sourcecode bzr trees) ==
The `Makefile`s of pygettextpo & pygpgme make direct reference to Python 2.4, you'll need to amend them appropriately.

== Test Status for lp:~maxb/launchpad/python2.5@9026 based on lp:launchpad/stable@9539 ==
 * ''canonical.testing.layers.!BaseLayer tests: Ran 256 tests with 0 failures and 0 errors''
 * ''canonical.testing.layers.!LibrarianLayer tests: Ran 8 tests with 0 failures and 0 errors''
 * ''canonical.testing.layers.!DatabaseLayer tests: Ran 43 tests with 0 failures and 0 errors''
 * ''canonical.testing.layers.!LaunchpadLayer tests: Ran 23 tests with 0 failures and 0 errors''
 * ''canonical.testing.layers.!ZopelessLayer tests: Ran 19 tests with 0 failures and 0 errors''
 * ''canonical.testing.layers.!LaunchpadScriptLayer tests: Ran 72 tests with 0 failures and 0 errors''
 * canonical.testing.layers.!LaunchpadZopelessLayer tests: Ran 3192 tests with '''2 failures''' and 0 errors
  1. lib/lp/bugs/doc/checkwatches-cli-switches.txt: Looks to be formatting differences in help message
  1. lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt: Sort order problem.
 * ''canonical.launchpad.ftests.test_system_documentation.!ProcessMailLayer tests: Ran 269 tests with 0 failures and 0 errors''
 * ''canonical.testing.layers.!FunctionalLayer tests: Ran 164 tests with 0 failures and 0 errors''
 * canonical.testing.layers.!LaunchpadFunctionalLayer tests: Ran 8001 tests with '''11 failures''' and 0 errors
  1. lib/canonical/launchpad/ftests/../doc/pagetest-helpers.txt: CDATA section introduced
  1. lib/canonical/launchpad/ftests/../doc/tales.txt: Exception message concerning no len() changed in Py2.5.
  1. lib/canonical/launchpad/ftests/../doc/unicode_csv.txt: Py2.5 behaviour change in comparison of unicode / nonunicode
  1. lib/canonical/launchpad/scripts/ftests/librarianformatter.txt: Spurious characters.
  1. lib/lp/bugs/tests/externalbugtracker-xmlrpc-transport.txt: urllib2 seems to be behaving differently concerning installed handlers
  1. lib/lp/registry/browser/tests/person-views.txt: bytestring vs unicode issue
  1. lp.soyuz.scripts.tests.test_copypackage.!ReUploadFileTestCase.test_re_upload_file_does_not_leak_file_descriptors - `1 != 0`
  1. lib/lp/translations/tests/../doc/poexport-language-pack.txt: Hints at tarfile.getnames() behaviour change as seen in unit tests too
  1. lib/lp/translations/tests/../doc/poexport-request-productseries.txt: Ditto.
  1. lib/lp/translations/tests/../doc/poexport-request.txt: Ditto.
  1. lib/lp/translations/tests/../doc/potemplate.txt: Ditto.
 * ''canonical.testing.layers.!AppServerLayer tests: Ran 72 tests with 0 failures and 0 errors''
 * canonical.testing.layers.!DatabaseFunctionalLayer tests: Ran 3677 tests with '''1 failures''' and 0 errors
  1. lib/lp/registry/doc/teammembership.txt: Looks like benign formatting issue.
 * canonical.testing.layers.!PageTestLayer tests: Ran 5965 tests with '''7 failures''' and 0 errors
  1. lib/canonical/launchpad/pagetests/feeds/xx-links.txt: No longer replaces " with ".
  1. lib/lp/answers/stories/question-add.txt: Escaping issues as above, but with < and > too.
  1. lib/lp/answers/stories/question-obfuscation.txt: Ditto.
  1. lib/lp/bugs/stories/feeds/xx-bug-atom.txt: Looks like benign formatting issue
  1. lib/lp/bugs/stories/feeds/xx-bug-html.txt: Looks like benign formatting issue.
  1. lib/lp/bugs/stories/distribution/xx-distribution-upstream-bug-report.txt: Formatting issue.
  1. lib/lp/registry/tests/../stories/foaf/xx-person-working-on.txt: bytestring vs unicode issue
 * ''canonical.testing.layers.!TwistedLayer tests: Ran 219 tests with 0 failures and 0 errors''
 * ''canonical.testing.layers.!TwistedLaunchpadZopelessLayer tests: Ran 23 tests with 0 failures and 0 errors''
 * ''canonical.testing.layers.!TwistedAppServerLayer tests: Ran 5 tests with 0 failures and 0 errors''
 * ''canonical.testing.layers.!ZopelessAppServerLayer tests: Ran 73 tests with 0 failures and 0 errors''
 * ''canonical.testing.layers.!ZopelessDatabaseLayer tests: Ran 192 tests with 0 failures and 0 errors''
 * ''lp.codehosting.tests.test_acceptance.SSHServerLayer tests: Ran 46 tests with 0 failures and 0 errors''
 * zope.testing.testrunner.layer.!UnitTests tests: Ran 1378 tests with '''8 failures''' and 0 errors
  1. librarianformatter_noca.txt: Py2.5 differences in traceback formatting
  1. test_helpers.make_test_tarball_2: odd discrepancy
  1. test_raising_with_unprintable_exception (canonical.launchpad.webapp.tests.test_errorlog.!TestErrorReportingUtility): looks benign
  1. test_!EscapedQuotesPropertyFileTest (lp.translations.utilities.tests.test_xpi_properties_format.!PropertyFileFormatTestCase)
  1. test_!InvalidPropertyFileUnicodeEscape (lp.translations.utilities.tests.test_xpi_properties_format.!PropertyFileFormatTestCase)
  1. test_!MultilinePropertyFileTest (lp.translations.utilities.tests.test_xpi_properties_format.!PropertyFileFormatTestCase)
  1. test_!TrailingBackslashPropertyFileTest (lp.translations.utilities.tests.test_xpi_properties_format.!PropertyFileFormatTestCase)
  1. test_!UnicodeEscapedPropertyFileTest (lp.translations.utilities.tests.test_xpi_properties_format.!PropertyFileFormatTestCase)

= Problems =

barry has found that `make schema` is flakey. Occasionally I'm getting these
errors:

{{{
make -C database/schema
make[1]: Entering directory `/home/barry/projects/launchpad/devel/database/schema'
$user,public,ts2
* Using launchpad-2109-00-0.sql as baseline
* If this fails you need to run as the postgresql superuser
* eg. sudo -u postgres make create

* Creating database "launchpad_empty".
Giving up waiting for connections to template1 to drop.
1 connections by postgres to template1
make[1]: *** [create] Error 10
make[1]: Leaving directory `/home/barry/projects/launchpad/devel/database/schema'
make: *** [schema] Error 2
}}}

Note that the `sudo` command has to be run from `database/schema` but does not
seem to help. Note too that sometimes `/etc/init.d/postgresql-8.3 restart`
fixes the problem, but not always.

maxb says: Surely the answer is simply to find what's maintaining the open connection and stop it?

This page is a place to collect notes written for and by people living on the bleeding edge and developing Launchpad on Karmic.

It has also become slightly co-opted as a place to manage the migration towards compatibility with the newer Python versions which Karmic prefers by default.

PPA Dependencies

The Launchpad PPA now contains a complete set of packages for the Karmic series.

Launchpad on Karmic with Python 2.4

It works pretty much, but there's an unresolved issue wherein setuptools' way of supporting Python namespace packages tends to leave you using the lazr.* packages installed into the system site-packages directory, despite the Launchpad buildout's best efforts.

This manifests as the following test failures:

  • Problems importing lazr.enum:

    • lp.codehosting.puller.tests.test_scheduler.TestPullerMasterIntegration.test_mirror

    • lp.codehosting.puller.tests.test_scheduler.TestPullerMasterIntegration.test_mirror_with_destination_self_locked

    • lp.codehosting.puller.tests.test_acceptance.TestBranchPuller.test_hosted_branch_stacked_on_mirrored_branch

    • lp.codehosting.puller.tests.test_acceptance.TestBranchPuller.test_manual_stacking

    • lp.codehosting.puller.tests.test_acceptance.TestBranchPuller.test_mirror_hosted_branch

    • lp.codehosting.puller.tests.test_acceptance.TestBranchPuller.test_mirror_hosted_loom_branch

    • lp.codehosting.puller.tests.test_acceptance.TestBranchPuller.test_mirror_imported_branch

    • lp.codehosting.puller.tests.test_acceptance.TestBranchPuller.test_mirror_mirrored_branch

    • lp.codehosting.puller.tests.test_acceptance.TestBranchPuller.test_mirror_private_branch

    • lp.codehosting.puller.tests.test_acceptance.TestBranchPuller.test_remirror_hosted_branch

    • lp.codehosting.puller.tests.test_acceptance.TestBranchPuller.test_stack_mirrored_branch

    • lp.codehosting.puller.tests.test_acceptance.TestBranchPuller.test_stack_mirrored_branch_onto_private

    • lp.services.scripts.tests.test_all_scripts.ScriptsTestCase.test_scripts

  • Unicode vs. bytestring issues:
    • eggs/launchpadlib-1.5.1-py2.4.egg/launchpadlib/docs/people.txt
    • eggs/launchpadlib-1.5.1-py2.4.egg/launchpadlib/docs/toplevel.txt

Workaround: Remove the symlinks at /usr/lib/python2.{4,5}/site-packages/lazr.*-nspkg.pth and trust to the fact that Karmic's default Python is 2.6 to hopefully not break anything on your system that wanted to use them.

Moving to newer Python versions: Python 2.5

The ultimate goal is to migrate Launchpad to Python 2.6. Rather than go straight to Python 2.6, I (maxb) am focusing on Python 2.5 first as a stepping stone.

https://bugs.launchpad.net/launchpad-foundations/+bugs?field.tag=python-upgrade

Launchpad code itself

https://code.launchpad.net/~maxb/launchpad/python2.5 tracks lp:launchpad/stable (or occasionally devel), on a manual basis, and acts as a one-stop-shop for something that people can check out and build using Python 2.5

Remaining changes in python2.5 branch:

  • Changed PYTHON_VERSION in Makefiles

  • Changed shebang in cronscripts/*, scripts/*,

Launchpad source dependencies (sourcecode bzr trees)

The Makefiles of pygettextpo & pygpgme make direct reference to Python 2.4, you'll need to amend them appropriately.

Test Status for lp:~maxb/launchpad/python2.5@9026 based on lp:launchpad/stable@9539

  • canonical.testing.layers.BaseLayer tests: Ran 256 tests with 0 failures and 0 errors

  • canonical.testing.layers.LibrarianLayer tests: Ran 8 tests with 0 failures and 0 errors

  • canonical.testing.layers.DatabaseLayer tests: Ran 43 tests with 0 failures and 0 errors

  • canonical.testing.layers.LaunchpadLayer tests: Ran 23 tests with 0 failures and 0 errors

  • canonical.testing.layers.ZopelessLayer tests: Ran 19 tests with 0 failures and 0 errors

  • canonical.testing.layers.LaunchpadScriptLayer tests: Ran 72 tests with 0 failures and 0 errors

  • canonical.testing.layers.LaunchpadZopelessLayer tests: Ran 3192 tests with 2 failures and 0 errors

    1. lib/lp/bugs/doc/checkwatches-cli-switches.txt: Looks to be formatting differences in help message
    2. lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt: Sort order problem.
  • canonical.launchpad.ftests.test_system_documentation.ProcessMailLayer tests: Ran 269 tests with 0 failures and 0 errors

  • canonical.testing.layers.FunctionalLayer tests: Ran 164 tests with 0 failures and 0 errors

  • canonical.testing.layers.LaunchpadFunctionalLayer tests: Ran 8001 tests with 11 failures and 0 errors

    1. lib/canonical/launchpad/ftests/../doc/pagetest-helpers.txt: CDATA section introduced
    2. lib/canonical/launchpad/ftests/../doc/tales.txt: Exception message concerning no len() changed in Py2.5.
    3. lib/canonical/launchpad/ftests/../doc/unicode_csv.txt: Py2.5 behaviour change in comparison of unicode / nonunicode
    4. lib/canonical/launchpad/scripts/ftests/librarianformatter.txt: Spurious characters.
    5. lib/lp/bugs/tests/externalbugtracker-xmlrpc-transport.txt: urllib2 seems to be behaving differently concerning installed handlers
    6. lib/lp/registry/browser/tests/person-views.txt: bytestring vs unicode issue
    7. lp.soyuz.scripts.tests.test_copypackage.ReUploadFileTestCase.test_re_upload_file_does_not_leak_file_descriptors - 1 != 0

    8. lib/lp/translations/tests/../doc/poexport-language-pack.txt: Hints at tarfile.getnames() behaviour change as seen in unit tests too
    9. lib/lp/translations/tests/../doc/poexport-request-productseries.txt: Ditto.
    10. lib/lp/translations/tests/../doc/poexport-request.txt: Ditto.
    11. lib/lp/translations/tests/../doc/potemplate.txt: Ditto.
  • canonical.testing.layers.AppServerLayer tests: Ran 72 tests with 0 failures and 0 errors

  • canonical.testing.layers.DatabaseFunctionalLayer tests: Ran 3677 tests with 1 failures and 0 errors

    1. lib/lp/registry/doc/teammembership.txt: Looks like benign formatting issue.
  • canonical.testing.layers.PageTestLayer tests: Ran 5965 tests with 7 failures and 0 errors

    1. lib/canonical/launchpad/pagetests/feeds/xx-links.txt: No longer replaces " with &quot;.

    2. lib/lp/answers/stories/question-add.txt: Escaping issues as above, but with < and > too.

    3. lib/lp/answers/stories/question-obfuscation.txt: Ditto.
    4. lib/lp/bugs/stories/feeds/xx-bug-atom.txt: Looks like benign formatting issue
    5. lib/lp/bugs/stories/feeds/xx-bug-html.txt: Looks like benign formatting issue.
    6. lib/lp/bugs/stories/distribution/xx-distribution-upstream-bug-report.txt: Formatting issue.
    7. lib/lp/registry/tests/../stories/foaf/xx-person-working-on.txt: bytestring vs unicode issue
  • canonical.testing.layers.TwistedLayer tests: Ran 219 tests with 0 failures and 0 errors

  • canonical.testing.layers.TwistedLaunchpadZopelessLayer tests: Ran 23 tests with 0 failures and 0 errors

  • canonical.testing.layers.TwistedAppServerLayer tests: Ran 5 tests with 0 failures and 0 errors

  • canonical.testing.layers.ZopelessAppServerLayer tests: Ran 73 tests with 0 failures and 0 errors

  • canonical.testing.layers.ZopelessDatabaseLayer tests: Ran 192 tests with 0 failures and 0 errors

  • lp.codehosting.tests.test_acceptance.SSHServerLayer tests: Ran 46 tests with 0 failures and 0 errors

  • zope.testing.testrunner.layer.UnitTests tests: Ran 1378 tests with 8 failures and 0 errors

    1. librarianformatter_noca.txt: Py2.5 differences in traceback formatting
    2. test_helpers.make_test_tarball_2: odd discrepancy
    3. test_raising_with_unprintable_exception (canonical.launchpad.webapp.tests.test_errorlog.TestErrorReportingUtility): looks benign

    4. test_EscapedQuotesPropertyFileTest (lp.translations.utilities.tests.test_xpi_properties_format.PropertyFileFormatTestCase)

    5. test_InvalidPropertyFileUnicodeEscape (lp.translations.utilities.tests.test_xpi_properties_format.PropertyFileFormatTestCase)

    6. test_MultilinePropertyFileTest (lp.translations.utilities.tests.test_xpi_properties_format.PropertyFileFormatTestCase)

    7. test_TrailingBackslashPropertyFileTest (lp.translations.utilities.tests.test_xpi_properties_format.PropertyFileFormatTestCase)

    8. test_UnicodeEscapedPropertyFileTest (lp.translations.utilities.tests.test_xpi_properties_format.PropertyFileFormatTestCase)

Problems

barry has found that make schema is flakey. Occasionally I'm getting these errors:

make -C database/schema
make[1]: Entering directory `/home/barry/projects/launchpad/devel/database/schema'
$user,public,ts2
* Using launchpad-2109-00-0.sql as baseline
* If this fails you need to run as the postgresql superuser
* eg. sudo -u postgres make create

* Creating database "launchpad_empty".
Giving up waiting for connections to template1 to drop.
1 connections by postgres to template1
make[1]: *** [create] Error 10
make[1]: Leaving directory `/home/barry/projects/launchpad/devel/database/schema'
make: *** [schema] Error 2

Note that the sudo command has to be run from database/schema but does not seem to help. Note too that sometimes /etc/init.d/postgresql-8.3 restart fixes the problem, but not always.

maxb says: Surely the answer is simply to find what's maintaining the open connection and stop it?