All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] build: remove use of MAKELEVEL optimization in submodule handling
@ 2017-11-06 11:41 Daniel P. Berrange
  2017-11-06 12:26 ` Greg Kurz
  2017-11-06 17:12 ` Eric Blake
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel P. Berrange @ 2017-11-06 11:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: Greg Kurz, Peter Maydell, Daniel P. Berrange

The Makefile attempts to optimize the handling of submodules by using MAKELEVEL
to only check the submodule status when running from the top level make
invokation. This causes problems for people who are using a makefile of their
own to in turn invoke QEMU's makefile, as MAKELEVEL is already set to 1 (or
more) when QEMU's makefile runs.

This optimization should not really be needed, since the git-submodule.sh
script is already used to detect if a submodule update is required. This by
removing the MAKELEVEL check, we at most add an extra 'git-submodule.sh status'
call to each make level, the overhead of which is lost in noise of building
QEMU.

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

NB this is on top of https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg00449.html

 Makefile | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index a92d7b8e14..0496c5057a 100644
--- a/Makefile
+++ b/Makefile
@@ -18,12 +18,11 @@ git-submodule-update:
 
 .PHONY: git-submodule-update
 
-ifeq (0,$(MAKELEVEL))
-  git_module_status := $(shell \
-    cd '$(SRC_PATH)' && \
-    GIT="$(GIT)" ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \
-    echo $$?; \
-  )
+git_module_status := $(shell \
+  cd '$(SRC_PATH)' && \
+  GIT="$(GIT)" ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \
+  echo $$?; \
+)
 
 ifeq (1,$(git_module_status))
 ifeq (no,$(GIT_UPDATE))
@@ -42,7 +41,6 @@ git-submodule-update:
           "GIT","$(GIT_SUBMODULES)")
 endif
 endif
-endif
 
 .git-submodule-status: git-submodule-update config-host.mak
 
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] build: remove use of MAKELEVEL optimization in submodule handling
  2017-11-06 11:41 [Qemu-devel] [PATCH] build: remove use of MAKELEVEL optimization in submodule handling Daniel P. Berrange
@ 2017-11-06 12:26 ` Greg Kurz
  2017-11-06 17:12 ` Eric Blake
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kurz @ 2017-11-06 12:26 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Peter Maydell

On Mon,  6 Nov 2017 11:41:34 +0000
"Daniel P. Berrange" <berrange@redhat.com> wrote:

> The Makefile attempts to optimize the handling of submodules by using MAKELEVEL
> to only check the submodule status when running from the top level make
> invokation. This causes problems for people who are using a makefile of their
> own to in turn invoke QEMU's makefile, as MAKELEVEL is already set to 1 (or
> more) when QEMU's makefile runs.
> 
> This optimization should not really be needed, since the git-submodule.sh
> script is already used to detect if a submodule update is required. This by
> removing the MAKELEVEL check, we at most add an extra 'git-submodule.sh status'
> call to each make level, the overhead of which is lost in noise of building
> QEMU.
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> 

Heh, I had come up with a similar patch based on master and nearly the
same commit message. :)

Reviewed-by: Greg Kurz <groug@kaod.org>

> NB this is on top of https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg00449.html
> 

I could check that this patch applied on top of the series mentioned above
fixes the issue for me.

Tested-by: Greg Kurz <groug@kaod.org>

>  Makefile | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index a92d7b8e14..0496c5057a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -18,12 +18,11 @@ git-submodule-update:
>  
>  .PHONY: git-submodule-update
>  
> -ifeq (0,$(MAKELEVEL))
> -  git_module_status := $(shell \
> -    cd '$(SRC_PATH)' && \
> -    GIT="$(GIT)" ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \
> -    echo $$?; \
> -  )
> +git_module_status := $(shell \
> +  cd '$(SRC_PATH)' && \
> +  GIT="$(GIT)" ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \
> +  echo $$?; \
> +)
>  
>  ifeq (1,$(git_module_status))
>  ifeq (no,$(GIT_UPDATE))
> @@ -42,7 +41,6 @@ git-submodule-update:
>            "GIT","$(GIT_SUBMODULES)")
>  endif
>  endif
> -endif
>  
>  .git-submodule-status: git-submodule-update config-host.mak
>  

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] build: remove use of MAKELEVEL optimization in submodule handling
  2017-11-06 11:41 [Qemu-devel] [PATCH] build: remove use of MAKELEVEL optimization in submodule handling Daniel P. Berrange
  2017-11-06 12:26 ` Greg Kurz
@ 2017-11-06 17:12 ` Eric Blake
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2017-11-06 17:12 UTC (permalink / raw)
  To: Daniel P. Berrange, qemu-devel; +Cc: Peter Maydell, Greg Kurz

[-- Attachment #1: Type: text/plain, Size: 1251 bytes --]

On 11/06/2017 05:41 AM, Daniel P. Berrange wrote:
> The Makefile attempts to optimize the handling of submodules by using MAKELEVEL
> to only check the submodule status when running from the top level make
> invokation. This causes problems for people who are using a makefile of their

s/invokation/invocation/

> own to in turn invoke QEMU's makefile, as MAKELEVEL is already set to 1 (or
> more) when QEMU's makefile runs.
> 
> This optimization should not really be needed, since the git-submodule.sh
> script is already used to detect if a submodule update is required. This by

s/This/Thus/

> removing the MAKELEVEL check, we at most add an extra 'git-submodule.sh status'
> call to each make level, the overhead of which is lost in noise of building
> QEMU.
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> 
> NB this is on top of https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg00449.html

Or in wording understood by patchew:

Based-on:
https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg00449.html

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-06 17:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-06 11:41 [Qemu-devel] [PATCH] build: remove use of MAKELEVEL optimization in submodule handling Daniel P. Berrange
2017-11-06 12:26 ` Greg Kurz
2017-11-06 17:12 ` Eric Blake

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.