bzr bd in SVN checkout from DPMT repo fails with invalid URL

Bug #605585 reported by Elliot Murphy
This bug report is a duplicate of:  Bug #676456: builddeb fails in a checkout. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bzr-builddeb
Triaged
Medium
Unassigned

Bug Description

I heard that there was this amazing new feature where I could go run bzr bd in the subversion checkout of my debian packages from debian python modules team (these all use svn-buildpackage). When I tried this, I got an error:

emurphy@sunk:~/python-packaging/django-lean$ bzr bd
Initialising Subversion metadata cache in /home/emurphy/.cache/bazaar/svn/771dd761-d7fa-0310-a302-f036d1c1ebb6.
Building using working tree
Running in merge mode
bzr: ERROR: Invalid url supplied to transport: "svn+ssh://<email address hidden>/svn/python-modules/packages/django-lean/trunk": local urls must start with file:/// or file://localhost/

emurphy@sunk:~/python-packaging/django-lean$ apt-cache policy bzr bzr-builddeb bzr-svn
bzr:
  Installed: 2.1.2-1
  Candidate: 2.1.2-1
  Version table:
 *** 2.1.2-1 0
        500 http://archive.ubuntu.com/ubuntu/ maverick/main Packages
        100 /var/lib/dpkg/status
     2.1.1-1~bazaar2~karmic 0
        500 http://ppa.launchpad.net/bzr/ppa/ubuntu/ karmic/main Packages
bzr-builddeb:
  Installed: 2.4.2
  Candidate: 2.4.2
  Version table:
 *** 2.4.2 0
        500 http://archive.ubuntu.com/ubuntu/ maverick/universe Packages
        100 /var/lib/dpkg/status
     2.4 0
        500 http://ppa.launchpad.net/bzr/ppa/ubuntu/ karmic/main Packages
bzr-svn:
  Installed: 1.0.2-2
  Candidate: 1.0.2-2
  Version table:
 *** 1.0.2-2 0
        500 http://archive.ubuntu.com/ubuntu/ maverick/universe Packages
        100 /var/lib/dpkg/status
     1.0.2-2~bazaar2~karmic1 0
        500 http://ppa.launchpad.net/bzr/ppa/ubuntu/ karmic/main Packages

snippet from ~/.bzr.log:

Wed 2010-07-14 15:40:25 -0400
0.033 bazaar version: 2.1.2
0.033 bzr arguments: [u'bd']
0.046 looking for plugins in /home/emurphy/.bazaar/plugins
0.047 looking for plugins in /usr/lib/python2.6/dist-packages/bzrlib/plugins
0.172 encoding stdout as sys.stdout encoding 'UTF-8'
0.186 bzr-svn: using Subversion 1.6.12 ()
[16286] 2010-07-14 15:40:28.634 INFO: Initialising Subversion metadata cache in /home/emurphy/.cache/bazaar/svn/771dd761-d7fa-0310-a302-f036d1c1ebb6.
401.332 potential branching layouts: [('trunk2', 295), ('root', 6)]
401.332 Guessed repository layout: TrunkLayout(2), guess layout to use: TrunkLayout(2)
402.992 saving file id map for 'svn-v4:771dd761-d7fa-0310-a302-f036d1c1ebb6:packages/django-lean/trunk:13305'
[16286] 2010-07-14 15:47:08.464 INFO: Building using working tree
403.015 Using True for merge, taken from the tree
[16286] 2010-07-14 15:47:08.481 INFO: Running in merge mode
403.016 Using 'debian/changelog' to get package information
403.026 Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 853, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1055, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 661, in run_argv_aliases
    return self.run_direct(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 665, in run_direct
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 122, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 156, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb/cmds.py", line 356, in run
    is_local, result_dir or result, build_dir, orig_dir)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb/cmds.py", line 266, in _get_dirs
    config.user_build_dir or 'build-area')
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb/cmds.py", line 259, in _get_dir
    urlutils.local_path_from_url(branch.base),
  File "/usr/lib/python2.6/dist-packages/bzrlib/urlutils.py", line 225, in _posix_local_path_from_url
    url, 'local urls must start with file:/// or file://localhost/')
InvalidURL: Invalid url supplied to transport: "svn+ssh://<email address hidden>/svn/python-modules/packages/django-lean/trunk": local urls must start with file:/// or file://localhost/

403.027 Transferred: 4593KiB (11.5K/s r:0K w:0K u:4593K)
403.027 return code 3

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 605585] [NEW] bzr bd in SVN checkout from DPMT repo fails with invalid URL

On Wed, 14 Jul 2010 19:56:18 -0000, Elliot Murphy <email address hidden> wrote:
> Public bug reported:
>
> I heard that there was this amazing new feature where I could go run bzr
> bd in the subversion checkout of my debian packages from debian python
> modules team (these all use svn-buildpackage). When I tried this, I got
> an error:
>
>
> emurphy@sunk:~/python-packaging/django-lean$ bzr bd
> Initialising Subversion metadata cache in /home/emurphy/.cache/bazaar/svn/771dd761-d7fa-0310-a302-f036d1c1ebb6.
> Building using working tree
> Running in merge mode
> bzr: ERROR: Invalid url supplied to transport: "svn+ssh://<email address hidden>/svn/python-modules/packages/django-lean/trunk": local urls must start with file:/// or file://localhost/

Hi Elliot,

Thanks for the bug.

So, it thinks that the branch that you passed is a local build, which it
is, because you didn't pass one.

In that case it assumes that the branch.base will be be local, but I'm
guessing that it is not forced to be in a checkout.

Thefore we need to be a bit smarter here and take the root of the tree
instead, if we have a tree.

We won't have one if you pass a remote branch to build, or if you are in
a treeless branch. If it is the latter then branch.base will be local
and all will work, if it is the former then it will be remote and the
existing code will cope with this.

I'm not quite sure how to untwist the logic around this right now, but
it shouldn't be hard to make the necessary tweaks in cmds.py if you want
to hack it and see how far you get after this error is removed.

Thanks,

James

James Westby (james-w)
Changed in bzr-builddeb:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Elliot Murphy (statik) wrote :

When I run bzr bd in an svn checkout and get this error, I set BZR_PDB=1 and see that branch.base is 'svn+ssh://<email address hidden>/svn/python-modules/packages/django-lean/trunk'

Revision history for this message
Elliot Murphy (statik) wrote :

And when commenting like this:

=== modified file 'cmds.py'
--- cmds.py 2010-07-02 22:15:05 +0000
+++ cmds.py 2010-07-16 03:58:13 +0000
@@ -267,9 +267,9 @@
                     supplied = if_not
             if supplied is not None:
                 if is_local:
- supplied = os.path.join(
- urlutils.local_path_from_url(branch.base),
- supplied)
+ #supplied = os.path.join(
+ # urlutils.local_path_from_url(branch.base),
+ # supplied)
                     supplied = os.path.realpath(supplied)
             return supplied

@@ -303,6 +303,7 @@
             export_upstream_revision, config, version):
         upstream_branch = None
         upstream_revision = None
+ import pdb;pdb.set_trace()
         if merge:
             if export_upstream is None:
                 export_upstream = config.export_upstream

I see failures triggered by _get_upstream_branch() returning None because config.export_upstream is None.
At this point I am pretty lost so I didn't try anything else.

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 605585] Re: bzr bd in SVN checkout from DPMT repo fails with invalid URL

On Fri, 16 Jul 2010 04:02:15 -0000, Elliot Murphy <email address hidden> wrote:
> I see failures triggered by _get_upstream_branch() returning None because config.export_upstream is None.
> At this point I am pretty lost so I didn't try anything else.

Ok, that suggests that the magic to detect the mergeUpstream property in
SVN isn't working.

    if tree is not None:
      try:
        # Imported here, since not everybody will have bzr-svn installed
        from bzrlib.plugins.svn.config import
      SubversionBuildPackageConfig, NoSubversionBuildPackageConfig
        try:
          self._tree_config =
      SvnBuildPackageMappedConfig(SubversionBuildPackageConfig(tree))
        except NoSubversionBuildPackageConfig:
          pass # Not a svn tree
      except ImportError:
        pass # No svn, apparently

I'm not sure which of the many things could be going wrong here, I would
have to try it to work that out.

Thanks,

James

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Fixes have landed for two bugs that this is affected by:

bzr-builddeb no longer attempts to use the branch URL to determine the local path to store build results, tarballs, etc. (bug 676456) and it now has a sensible way of figuring out the build type so the information set in the svn branch properties actually gets picked up (bug 655277)

The upstream tarball also doesn't seem to be fetched at the moment, even though there is a debian/watch file. This seems related to bug 552893, which I'm working on that at the moment.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Building django-learn was affected by various bugs that have all been fixed now. I'm going to mark this bug as a dupe of the first relevant bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.