[Qemu-devel] [PATCH] docker: allow running from srcdir != builddir build

Paolo Bonzini posted 1 patch 6 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1508331989-142364-1-git-send-email-pbonzini@redhat.com
Test checkpatch passed
Test docker passed
Test s390x passed
tests/docker/Makefile.include | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[Qemu-devel] [PATCH] docker: allow running from srcdir != builddir build
Posted by Paolo Bonzini 6 years, 6 months ago
The new script uses "git submodule", which is picky about being invoked
from the top of the git checkout.  Invoke the script from $(SRC_PATH)
to avoid git's wrath.

Fixes: b7f404201e45e99da23b9764dec27ce5f965cdcd
Cc: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

---
 tests/docker/Makefile.include | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 6f9ea19..b6d9fa3 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -18,11 +18,11 @@ TESTS ?= %
 IMAGES ?= %
 
 CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$)
-DOCKER_SRC_COPY := docker-src.$(CUR_TIME)
+DOCKER_SRC_COPY := $(BUILD_DIR)/docker-src.$(CUR_TIME)
 
 $(DOCKER_SRC_COPY):
 	@mkdir $@
-	$(call quiet-command, $(SRC_PATH)/scripts/archive-source.sh $@/qemu.tar, \
+	$(call quiet-command, cd $(SRC_PATH) && scripts/archive-source.sh $@/qemu.tar, \
 		"GEN", "$@/qemu.tar")
 	$(call quiet-command, cp $(SRC_PATH)/tests/docker/run $@/run, \
 		"COPY","RUNNER")
-- 
1.8.3.1


Re: [Qemu-devel] [PATCH] docker: allow running from srcdir != builddir build
Posted by Daniel P. Berrange 6 years, 6 months ago
On Wed, Oct 18, 2017 at 03:06:29PM +0200, Paolo Bonzini wrote:
> The new script uses "git submodule", which is picky about being invoked
> from the top of the git checkout.  Invoke the script from $(SRC_PATH)
> to avoid git's wrath.

I wonder if there's interest in being "evil" and flat out refusing to
ever build with srcdir==builddir. We have a never ending stream of
bugs where we forget to consider one of the two possible scenarios.

> 
> Fixes: b7f404201e45e99da23b9764dec27ce5f965cdcd
> Cc: Fam Zheng <famz@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> ---
>  tests/docker/Makefile.include | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index 6f9ea19..b6d9fa3 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -18,11 +18,11 @@ TESTS ?= %
>  IMAGES ?= %
>  
>  CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$)
> -DOCKER_SRC_COPY := docker-src.$(CUR_TIME)
> +DOCKER_SRC_COPY := $(BUILD_DIR)/docker-src.$(CUR_TIME)
>  
>  $(DOCKER_SRC_COPY):
>  	@mkdir $@
> -	$(call quiet-command, $(SRC_PATH)/scripts/archive-source.sh $@/qemu.tar, \
> +	$(call quiet-command, cd $(SRC_PATH) && scripts/archive-source.sh $@/qemu.tar, \
>  		"GEN", "$@/qemu.tar")
>  	$(call quiet-command, cp $(SRC_PATH)/tests/docker/run $@/run, \
>  		"COPY","RUNNER")

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [Qemu-devel] [PATCH] docker: allow running from srcdir != builddir build
Posted by Fam Zheng 6 years, 6 months ago
On Wed, 10/18 15:06, Paolo Bonzini wrote:
> The new script uses "git submodule", which is picky about being invoked
> from the top of the git checkout.  Invoke the script from $(SRC_PATH)
> to avoid git's wrath.
> 
> Fixes: b7f404201e45e99da23b9764dec27ce5f965cdcd
> Cc: Fam Zheng <famz@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Queued, thanks!

Fam