All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Bruce Ashfield <bruce.ashfield@windriver.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 02/18] kernel-yocto: move SRCREV validation to patching phase
Date: Sat, 30 Aug 2014 14:55:41 +0100	[thread overview]
Message-ID: <1409406941.29296.216.camel@ted> (raw)
In-Reply-To: <efcd26d4f457c8f5f658a1a3ab9e5c2aa03a6a65.1409345003.git.bruce.ashfield@windriver.com>

On Sat, 2014-08-30 at 00:38 -0400, Bruce Ashfield wrote:
> Rather than attempting to condition the entire tree to machine SRCREV (since
> we don't know what branch will be built), we can instead wait until patching
> has completed and then confirm that we are indeed building a decendant of the
> specified SRCREV. The result is a much simpler check, and no mangling of the
> tree.
> 
> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> ---
>  meta/classes/kernel-yocto.bbclass | 39 +++++++++++++++++++++++----------------
>  1 file changed, 23 insertions(+), 16 deletions(-)

Looks like some versions of git on the AB cluster don't support this. Do
we need to bump the minimum git version and install buildtools-tarball
on the affected machines? Or can we use some other construct here?

https://autobuilder.yoctoproject.org/main/builders/nightly-x86-64/builds/24/steps/BuildImages/logs/stdio

Cheers,

Richard


> diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
> index 38c886b21b09..4938712c7cff 100644
> --- a/meta/classes/kernel-yocto.bbclass
> +++ b/meta/classes/kernel-yocto.bbclass
> @@ -71,6 +71,7 @@ do_patch() {
>  	fi
>  
>  	machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
> +	machine_srcrev="${SRCREV_machine}"
>  
>  	# if we have a defined/set meta branch we should not be generating
>  	# any meta data. The passed branch has what we need.
> @@ -122,6 +123,17 @@ do_patch() {
>  		exit 1
>  	fi
>  
> +	# see if the branch we are about to patch has been properly reset to the defined
> +	# SRCREV .. if not, we reset it.
> +	branch_head=`git rev-parse HEAD`
> +	if [ "${machine_srcrev}" != "AUTOINC" ]; then
> +	 	if [ "${machine_srcrev}" != "${branch_head}" ]; then
> +			current_branch=`git rev-parse --abbrev-ref HEAD`
> +			git branch "$current_branch-orig"
> +			git reset --hard ${machine_srcrev}
> +		fi
> +	fi
> +
>  	# executes and modifies the source tree as required
>  	patchme ${KMACHINE}
>  	if [ $? -ne 0 ]; then
> @@ -130,6 +142,17 @@ do_patch() {
>  		exit 1
>  	fi
>  
> +	# check to see if the specified SRCREV is reachable from the final branch.
> +	# if it wasn't something wrong has happened, and we should error.
> +	if [ "${machine_srcrev}" != "AUTOINC" ]; then
> +		git merge-base --is-ancestor ${machine_srcrev} HEAD
> +	 	if [ $? -ne 0 ]; then
> +			bbnote "ERROR: SRCREV ${machine_srcrev} was specified, but is not reachable"
> +			bbnote "       Check the BSP description for incorrect branch selection, or other errors."
> +			exit 1
> +		fi
> +	fi
> +
>  	# Perform a final check. If something other than the default kernel
>  	# branch was requested, and that's not where we ended up, then we 
>  	# should thrown an error, since we aren't building what was expected
> @@ -335,22 +358,6 @@ do_validate_branches() {
>  		exit 1
>  	fi
>  
> -	# force the SRCREV in each branch that contains the specified
> -	# SRCREV (if it isn't the current HEAD of that branch)
> -	git checkout -q master
> -	for b in $containing_branches; do
> -		branch_head=`git show-ref -s --heads ${b}`		
> -		if [ "$branch_head" != "$machine_srcrev" ]; then
> -			echo "[INFO] Setting branch $b to ${machine_srcrev}"
> -			if [ "$b" = "master" ]; then
> -				git reset --hard $machine_srcrev > /dev/null
> -			else
> -				git branch -D $b > /dev/null
> -				git branch $b $machine_srcrev > /dev/null
> -			fi
> -		fi
> -	done
> -
>  	## KMETA branch validation.
>  	## We do validation if the meta branch exists, and AUTOREV hasn't been set
>   	meta_head=`git show-ref -s --heads ${KMETA}`




  reply	other threads:[~2014-08-30 13:55 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-30  4:38 [PATCH 00/18] kernel-yocto: consolidated pull request Bruce Ashfield
2014-08-30  4:38 ` [PATCH 01/18] kernel-yocto: use cat-file instead of git-show Bruce Ashfield
2014-08-30  4:38 ` [PATCH 02/18] kernel-yocto: move SRCREV validation to patching phase Bruce Ashfield
2014-08-30 13:55   ` Richard Purdie [this message]
2014-08-31  0:52     ` Bruce Ashfield
2014-08-31  5:25     ` Bruce Ashfield
2014-08-30  4:38 ` [PATCH 03/18] kernel-yocto: remove containing branch check Bruce Ashfield
2014-08-30  4:38 ` [PATCH 04/18] kernel-yocto: remove SRC_URI kbranch validation Bruce Ashfield
2014-08-30  4:38 ` [PATCH 05/18] kernel-yocto: remove branch existence checking in do_validate_branches Bruce Ashfield
2014-08-30  4:38 ` [PATCH 06/18] kernel-yocto: remove KBRANCH_DEFAULT Bruce Ashfield
2014-08-30  4:38 ` [PATCH 07/18] kernel-yocto: simplify branch SRCREV validation Bruce Ashfield
2014-08-30  4:38 ` [PATCH 08/18] kernel-yocto: use show-ref instead of branch -a Bruce Ashfield
2014-08-30  4:38 ` [PATCH 09/18] kernel-yocto: clean overly complex branch checkout Bruce Ashfield
2014-08-30  4:38 ` [PATCH 10/18] kernel-yocto: allow custom non-meta, SRCREV format builds Bruce Ashfield
2014-08-30  4:38 ` [PATCH 11/18] kernel-yocto: remove KBRANCH_DEFAULT Bruce Ashfield
2014-08-30  4:38 ` [PATCH 12/18] kernel-yocto: convert echo statements to bb* equivalents Bruce Ashfield
2014-08-30  4:38 ` [PATCH 13/18] kern-tools: allow meta branch and meta data directory to differ Bruce Ashfield
2014-08-30  4:38 ` [PATCH 14/18] images: introduce core-image-kernel-dev Bruce Ashfield
2014-08-30  4:38 ` [PATCH 15/18] linux-yocto/3.14: vhost, vxland, openvswitch and block/bfq updates Bruce Ashfield
2014-08-30  4:38 ` [PATCH 16/18] linux-yocto/3.14: update to v3.14.17 Bruce Ashfield
2014-08-30  4:38 ` [PATCH 17/18] linux-yocto/3.4: remove 3.4 name recipes Bruce Ashfield
2014-08-30  4:38 ` [PATCH 18/18] linux-libc-headers: update to 3.16 Bruce Ashfield
2014-08-31 10:07 ` [PATCH 00/18] kernel-yocto: consolidated pull request Richard Purdie
2014-08-31 13:57   ` Bruce Ashfield
2014-09-01  1:53   ` Bruce Ashfield
2014-09-01  2:39   ` Bruce Ashfield
2014-09-01 16:12     ` Richard Purdie
2014-09-02 12:11       ` Bruce Ashfield
2014-08-31 23:41 ` Otavio Salvador
2014-09-01  1:18   ` Bruce Ashfield

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=1409406941.29296.216.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bruce.ashfield@windriver.com \
    --cc=openembedded-core@lists.openembedded.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.