Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 434746 - bzr.eclass should use bzr branch rather than bzr export to populate $WORKDIR
Summary: bzr.eclass should use bzr branch rather than bzr export to populate $WORKDIR
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Emacs project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-11 18:51 UTC by James Cloos
Modified: 2012-11-04 15:23 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Cloos 2012-09-11 18:51:26 UTC
Using bzr branch --stacked instead of bzr export will use no more space in $WORKDIR and will permit the packages’s build systems to better report the
details of what version is installed.

As an example, GNU Emacs has an emacs-bzr-version variable which would help app-editors/emacs-vcs users report any emacs bugs they encounter upstream.

As it is, one needs to know that EBZR_REVNO is set in the build environment and to look for it in /var/db/pkg/.

The git-2 eclass does something similar.  This has proved beneficial when dealing with upstreams.
Comment 1 Ulrich Müller gentoo-dev 2012-09-11 22:36:05 UTC
I believe that export is the right command to use. The exported tree looks like what one would get from unpacking a tarball; especially, there should be no need for a .bzr directory. Also bzr branch (or bzr checkout) is significantly slower than bzr export.

Concerning Emacs, our live ebuilds are passing EBZR_BRANCH and EBZR_REVNO to configure, so that they're available in the system-configuration-options variable.
Comment 2 James Cloos 2012-09-11 23:25:46 UTC
> The exported tree looks like what one would get from unpacking a tarball

Which is exactly why export is the *wrong* choice.

Live builds should look like checkouts to the packages’s build systems.
Comment 3 James Cloos 2012-09-11 23:29:21 UTC
> Concerning Emacs, our live ebuilds are passing EBZR_BRANCH and EBZR_REVNO to
> configure, so that they're available in the system-configuration-options
> variable.

emacs-bzr-version needs the info, too.  It gets it by recognizing the tree as a bzr branch.

Emacs was only one example.

The fix for this issue in the git eclasses was very welcome and helpful when it was done.  bzr.eclass should get this right, too.
Comment 4 Ulrich Müller gentoo-dev 2012-09-12 07:09:18 UTC
Still, if we decide to do this, we should use a lightweight checkout, not a branch. Commands like "bzr revno" or "bzr testament" also work for checkouts, and that's all that should be needed.

There could be issues with the sandbox too. bzr.eclass does addwrite ${EBZR_STORE_DIR}, but certainly the package's build system shouldn't write to that location.
Comment 5 Ulrich Müller gentoo-dev 2012-09-12 07:13:29 UTC
Hm, would have been nice if the ebuild could simply redefine EBZR_EXPORT_CMD. However, bzr commands lack uniformity in their arguments:
   bzr branch <src> <dest>
   bzr checkout <src> <dest>
   bzr export <dest> <src>
Comment 6 James Cloos 2012-09-12 18:31:57 UTC
I did suggest bzr branch --stacked, which uses the branch in DISTDIR for the .bzr data, yes?

At least my intent was bzr’s equivalent to git’s «clone -l -s».
Comment 7 James Cloos 2012-09-12 18:33:22 UTC
> but certainly the package's build system shouldn't write to [${EBZR_STORE_DIR}]

agreed.
Comment 8 Ulrich Müller gentoo-dev 2012-09-12 22:01:49 UTC
(In reply to comment #6)
> I did suggest bzr branch --stacked, which uses the branch in DISTDIR for the
> .bzr data, yes?

> At least my intent was bzr’s equivalent to git’s «clone -l -s».

There's no exact correspondence between git and bzr commands, so it's difficult to say which one matches it better. And a lightweight checkout is slightly smaller.

I've added experimental support to bzr.eclass in the Emacs overlay:
<http://overlays.gentoo.org/proj/emacs/browser/emacs-overlay/eclass/bzr.eclass>

The feature can be enabled by setting EBZR_WORKDIR_CHECKOUT to a non-empty value, so the default (i.e. using export) isn't changed.

There's also emacs-vcs-24.2.9999.ebuild in the overlay which can be used for testing. (emacs-bzr-version is properly initialised, it seems.)
Comment 9 James Cloos 2012-09-14 01:50:06 UTC
I’m still compiling, but those looks good.
Comment 10 Ulrich Müller gentoo-dev 2012-09-18 11:29:43 UTC
Updated bzr.eclass and app-editors/emacs-vcs ebuild committed to Portage tree. Thank you for bringing this up.

Should we use this bug as tracker for package updates? Otherwise, I'll close it.