[apparmor] [PATCH v2 3/5] Makefile: Convert shell variables into reusable make variables

Tyler Hicks tyhicks at canonical.com
Wed Jan 27 00:58:24 UTC 2016


On 2016-01-26 14:51:43, Steve Beattie wrote:
> On Tue, Jan 26, 2016 at 01:58:47PM -0800, Steve Beattie wrote:
> > On Wed, Jan 06, 2016 at 08:44:45PM -0600, Tyler Hicks wrote:
> > > Turn REPO_VERSION and SNAPSHOT_DIR into target-specific make variables
> > > that may be reused by future targets similar to the snapshot target.
> > > 
> > > The new REPO_VERSION make variable is turned into a "simply expanded"
> > > variable as to not require a callout to bzr each time it is expanded.
> > > 
> > > The SNAPSHOT_DIR shell variabel is renamed to SNAPSHOT_NAME as a make
> > > variable. The new name may be slightly more descriptive in the future as
> > > the variable will be reused in other ways besides a simple directory
> > > name.
> > > 
> > > Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
> > Acked-by: Steve Beattie <steve at nxnw.org>
> 
> Actually, I take this Ack back. I think with the rework, this ends up
> causing the bzr version-info command to get executed more than once,
> and for irrelevant targets; e.g. 'make clean' or 'make version'. That's
> okay for an unbound bzr branch, but for bound branches (i.e. branches
> grabbed via 'bzr checkout' rather than 'bzr branch'), that induces
> a round trip to launchpad to grab that info.
> 
>   $ bzr info .
>   Checkout (format: 2a)
>   Location:
>          checkout root: .
>     checkout of branch: bzr+ssh://bazaar.launchpad.net/+branch/apparmor/
> 
>   Related branches:
>       push branch: bzr+ssh://bazaar.launchpad.net/+branch/apparmor/
>     parent branch: bzr+ssh://bazaar.launchpad.net/+branch/apparmor/
>     submit branch: /home/steve/bzr/apparmor-lp-translations
>   $ time make version
>   2.10.90
> 
>   real    0m0.018s
>   user    0m0.000s
>   sys     0m0.000s
>   $ quilt push
>   Applying patch patches/tyhicks-03-coverity_make.patch
>   patching file Makefile
> 
>   Now at patch patches/tyhicks-03-coverity_make.patch
>   $ time make version
>   2.10.90
> 
>   real    0m7.634s
>   user    0m0.132s
>   sys     0m0.016s
> 
> I'll try to dig into how to make this not happen.

The target-specific, simply-expanded REPO_VERSION make variable is being
assigned even when the snapshot target isn't being called.

Converting this to a recursively expanded variable would prevent the
slowdown that you're seeing but would also mean that the snapshot target
would see a slowdown because bzr version-info command will be ran every
time that variable is referenced.

I'll need to think about this a bit more before I can propose a better
solution.

Tyler

> 
> -- 
> Steve Beattie
> <sbeattie at ubuntu.com>
> http://NxNW.org/~steve/



> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160126/4352922d/attachment.pgp>


More information about the AppArmor mailing list