nest-part unable to nest files

Bug #771568 reported by Michael Lustfield on 2011-04-27
60
This bug affects 11 people
Affects Status Importance Assigned to Milestone
bzr-builder
High
Unassigned
launchpad-buildd
Low
Unassigned

Bug Description

I'm trying to use the following recipe:

# bzr-builder format 0.3 deb-version {debupstream}-svn{revno}-ppa{revno:packaging}
lp:nginx
nest-part configure lp:nginx auto/configure configure
nest-part license lp:nginx docs/text/LICENSE LICENSE
nest-part readme lp:nginx docs/text/README README
nest packaging lp:nginx/debian debian

The goal is to copy those three files from buried locations to the root location. Because launchpad recipes do not allow any sort of shell command, the obvious 'cp' isn't available. (If it were I'd be producing the CHANGES file as well.)

When I try to build this recipe, I get somewhat of a cryptic error.
bzr: ERROR: The file id "configure-20110426174632-p69sn47yvfrkiyl8-1" is not present in the tree <bzrlib.inventory.CHKInventory object at 0x1586110>.

I don't really have any idea how to debug this any further.

Build log from a failed build: https://launchpadlibrarian.net/70460437/buildlog.txt.gz

Tags: udd Edit Tag help
Andrew Bennetts (spiv) wrote :

IIRC, nest-part was only intended for directories, not individual files. I'm not sure there's a a good reason for that restriction, other than that it was convenient to implement, so it's probably something we should fix.

Even if we don't allow files, we should at least give a decent error, rather the cryptic error you've encountered.

affects: bzr → bzr-builder
Changed in bzr-builder:
importance: Undecided → High
status: New → Confirmed
Andrew Bennetts (spiv) wrote :

Yep, at a brief inspection of the code, the MergeIntoMergeType._entries_to_incorporate logic in bzrlib doesn't cope well with the case where the source path is anything other than a directory. It's probably not very hard to fix.

tags: added: udd
Andrew Bennetts (spiv) wrote :

Added launchpad to the bug, as this obviously affects the recipe builds feature.

Andrew Bennetts (spiv) wrote :

Oh! On re-reading this, I see that the recipe in this bug description is actually trying to nest a file from the same branch, i.e. a file that already exists at a different path. So this is abusing nest-part to try be 'cp'. I don't think this is something that nest-part should support. If this is really worth doing, we should add a 'cp' (or 'mv'?) directive for it.

I see the current (failing) recipe on <https://code.launchpad.net/~nginx/+recipe/nginx-nightly> does have lines like the ones I was thinking of, e.g.:

    lp:nginx
    …
    nest-part readme lp:nginx/stable docs/text/README README

Which is indeed trying to nest just one file from another branch. That seems reasonable to me (although hopefully most cases of this can be addressed with the 'merge' directive).

On Wed, Apr 27, 2011 at 2:52 PM, Andrew Bennetts
<email address hidden> wrote:
> Oh!  On re-reading this, I see that the recipe in this bug description
> is actually trying to nest a file from the same branch, i.e. a file that
> already exists at a different path.  So this is abusing nest-part to try
> be 'cp'.  I don't think this is something that nest-part should support

This would be the ideal recipe...

# bzr-builder format 0.3 deb-version {debupstream}-svn{revno}-ppa{revno:packaging}
lp:nginx
nest packaging lp:nginx/debian debian
run cp docs/text/LICENSE ./
run cp docs/text/README ./
run cp -r docs/html ./
run cp -r docs/man ./
run aptitude install -y make xsltproc
run make -f docs/GNUmakefile changes

Testing inside of a brand new sid chroot with bzr-builder installed, this seemed to work perfect.

The better option (to keep from needing to be able to install new packages for makefiles...)

# bzr-builder format 0.3 deb-version {debupstream}-svn{revno}-ppa{revno:packaging}
lp:nginx
nest packaging lp:nginx/debian debian
run cp docs/text/LICENSE ./
run cp docs/text/README ./
run cp -r docs/html ./
run cp -r docs/man ./
nest-part changes lp:nginx/stable CHANGES CHANGES
nest-part changesru lp:nginx/stable CHANGES.ru CHANGES.ru

That's probably the most ideal recipe for my case.

j.c.sackett (jcsackett) on 2011-04-27
Changed in launchpad:
importance: Undecided → High
status: New → Triaged
Changed in launchpad:
importance: High → Low
Colin Watson (cjwatson) on 2014-07-31
affects: launchpad → launchpad-buildd
Khurshid Alam (khurshid-alam) wrote :

So any progress on this? Can we nest-part files from different branch or not?

Khurshid Alam (khurshid-alam) wrote :

@Michael Lustfield Run-command simply doesn't work for git build recipes

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

Duplicates of this bug

Other bug subscribers

Related questions