xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH 5/5] make: Make "src-tarball" target actually make a source tarball
Date: Thu, 17 Jul 2014 17:46:56 +0100	[thread overview]
Message-ID: <53C7FE00.20109@eu.citrix.com> (raw)
In-Reply-To: <21446.38146.96203.437720@mariner.uk.xensource.com>

On 07/16/2014 04:06 PM, Ian Jackson wrote:
> George Dunlap writes ("[PATCH 5/5] make: Make "src-tarball" target actually make a source tarball"):
>> At the moment, making a release tarball is an annoyingly manual
>> process that involves running "git archive" into a temporary directory.
> ...
>> +src-tarball: subtree-update
>> +	bash ./tools/misc/mktarball $(XEN_ROOT) $$(git describe)
> Does this absolutely have to depend on subtree-update ?  Perhaps we
> need a new "make the subtrees exist" target ?

I'll add a "subtree-find" command (perhaps renaming the other to 
"subtree-force-update"; then as per IanC's suggestion, I'll make this 
depend on subtree-force-update unless some sensible parameter is set.

>
>> diff --git a/tools/misc/mktarball b/tools/misc/mktarball
> ...
>> +function finish {
>> +    [[ -n "$tdir" ]] && rm -rf $tdir
>> +}
> The use of the POSIX syntax
>     finish() {
> seems much more prevalent in-tree, than the use of `function'.

Ack.

>
>> +trap finish EXIT
> The EXIT trap handler should probably `set +e'.

Ack.

>
>> +function git_archive_into {
>> +    mkdir "$2"
>> +
>> +    git --git-dir="$1"/.git \
>> +	archive --format=tar HEAD | \
>> +	tar Cxf "$2" -
>> +}
>> +
>> +if [[ -z "$1" || -z "$2" ]] ; then
>> +  echo "usage: $0 path-to-XEN_ROOT xen-version"
>> +  exit 1
>> +fi
>> +
>> +xen_root="$1"
>> +desc="$2"
>> +
>> +mkdir -p $xen_root/dist/
>> +
>> +tdir="$(mktemp -d $xen_root/dist/xen.XXXXXXXX)"
> Why not use a fixed filename ?  This script isn't safe for concurrent
> invocation anyway, because the output filename is (mostly) fixed.

I'm not so much worried about concurrent invocation per se, but about 
dealing with stuff possibly left over from a previous run.  If we use a 
fixed path, we have to always rm -rf the path before starting, which 
seems unnecessarily risky to me.  (Or we could not rm -rf the path, 
which is even worse from a consistency point of view.)  Creating a new 
temporary directory just seems like the cleanest, safest thing to do.  
It's not like it's that expensive.

(Re concurrent invocation: The output filename may collide, but at least 
you'll get a consistent snapshot of that one particular tree. What I'd 
be more worried about is racing with make subdir-force-update and 
getting inconsisent subtree archives.)

>
> If you do that you can do away with the trap handler entirely.  You
> should probably make git_archive_into delete the destination
> directory.

I'm not sure what the fixed filename has to do with cleanup -- I would 
want to remove the temporary directory on a failure regardless.

>
>> +GZIP=-9v tar cz -f $xen_root/dist/xen-$desc.tar.gz -C $tdir xen-$desc
>> +
>> +echo "Source tarball in $xen_root/dist/xen-$desc.tar.gz"
>> \ No newline at end of file
> No newline at end of file.

Ack.

  -George

  parent reply	other threads:[~2014-07-17 16:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14 16:15 [PATCH 1/5] make: Check tools/qemu-xen[-traditional] for qemu before downloading George Dunlap
2014-07-14 16:15 ` [PATCH 2/5] make: Normalize config options for external trees George Dunlap
2014-07-16  8:58   ` Ian Campbell
2014-07-16 14:53   ` Ian Jackson
2014-07-21 10:22   ` Olaf Hering
2014-07-21 10:28     ` George Dunlap
2014-07-21 10:44       ` Olaf Hering
2014-07-21 10:46         ` George Dunlap
2014-07-21 10:49       ` Olaf Hering
2014-07-14 16:15 ` [PATCH 3/5] make: Make *-dir-force-update depend on *-dir-find George Dunlap
2014-07-16 14:53   ` Ian Jackson
2014-07-14 16:15 ` [PATCH 4/5] make: Add subtree-update target George Dunlap
2014-07-16  9:00   ` Ian Campbell
2014-07-16 14:54   ` Ian Jackson
2014-07-14 16:15 ` [PATCH 5/5] make: Make "src-tarball" target actually make a source tarball George Dunlap
2014-07-16 15:06   ` Ian Jackson
2014-07-16 16:56     ` Ian Campbell
2014-07-16 17:45       ` George Dunlap
2014-07-17  9:21         ` Ian Campbell
2014-07-17 16:46     ` George Dunlap [this message]
2014-07-18 10:45       ` Ian Jackson
2014-09-15 15:42       ` George Dunlap
2014-09-15 15:46         ` Ian Jackson
2014-07-16  9:02 ` [PATCH 1/5] make: Check tools/qemu-xen[-traditional] for qemu before downloading Ian Campbell
2014-07-16 14:50 ` Ian Jackson
2014-07-18 12:39 ` Ian Campbell
2014-07-23 10:52 ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53C7FE00.20109@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).