qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Gerd Hoffmann <kraxel@redhat.com>,
	"Daniel P. Berrange" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PULL 01/11] build: automatically handle GIT submodule checkout for dtc
Date: Thu, 19 Oct 2017 15:05:45 +0100	[thread overview]
Message-ID: <20171019140545.GA30324@perard.uk.xensource.com> (raw)
In-Reply-To: <20171016131644.9565-2-kraxel@redhat.com>

On Mon, Oct 16, 2017 at 03:16:34PM +0200, Gerd Hoffmann wrote:
> From: "Daniel P. Berrange" <berrange@redhat.com>
> 
> Currently if DTC is required by configure and not available in the host
> OS install, we exit with an error message telling the user to checkout a
> git submodule or install the library.
> 
> This introduces automatic handling of the git submodule checkout process
> and enables it for dtc. This only runs if building from GIT, so users of
> release tarballs still need the system library install. The current state
> of the git checkout is stashed in .git-submodule-status, and a helper
> program is used to determine if this state matches the desired submodule
> state. A dependency against 'Makefile' ensures that the submodule state
> is refreshed at the start of the build process
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> Message-id: 20170929101201.21039-2-berrange@redhat.com
> 
> [ kraxel: use /bin/sh not bash for scripts/git-submodule.sh ]
> [ kraxel: fix Makefile dependencies ]
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> 
> [fixup] Makefile dep
> ---

> diff --git a/Makefile b/Makefile
> index 97b4508d7d..9866909e08 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -14,6 +14,27 @@ ifneq ($(wildcard config-host.mak),)
>  all:
>  include config-host.mak
>  
> +git-submodule-update:
> +
> +.PHONY: git-submodule-update
> +
> +ifeq (0,$(MAKELEVEL))

Hi,

this new patch, and especialy the use MAKELEVEL here does not work when
we build Xen, since we build QEMU when building Xen.

When Xen is built, a clone of qemu.git is made, and then configure/make
is called. At this point, MAKELEVEL would already be set so
the makefile rule git-submodule-update would be empty.

Is it possible to do things differently in the QEMU makefiles? (Or do we
have to simply unset MAKELEVEL in xen makefiles before building qemu.)

A build log of Xen (with the build failure of QEMU near the end):
http://logs.test-lab.xenproject.org/osstest/logs/114667/build-amd64/6.ts-xen-build.log

Thanks,

> +  git_module_status := $(shell \
> +    cd '$(SRC_PATH)' && \
> +    ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \
> +    echo $$?; \
> +  )
> +
> +ifeq (1,$(git_module_status))
> +git-submodule-update:
> +	$(call quiet-command, \
> +          (cd $(SRC_PATH) && ./scripts/git-submodule.sh update $(GIT_SUBMODULES)), \
> +          "GIT","$(GIT_SUBMODULES)")
> +endif
> +endif
> +
> +.git-submodule-status: git-submodule-update
> +
>  # Check that we're not trying to do an out-of-tree build from
>  # a tree that's been used for an in-tree build.
>  ifneq ($(realpath $(SRC_PATH)),$(realpath .))
> @@ -84,6 +105,7 @@ endif
>  GENERATED_FILES += $(TRACE_HEADERS)
>  GENERATED_FILES += $(TRACE_SOURCES)
>  GENERATED_FILES += $(BUILD_DIR)/trace-events-all
> +GENERATED_FILES += .git-submodule-status
>  
>  trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g')
>  
> @@ -330,7 +352,7 @@ DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_src
>  DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
>  DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
>  
> -subdir-dtc:dtc/libfdt dtc/tests
> +subdir-dtc: .git-submodule-status dtc/libfdt dtc/tests
>  	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)
>  
>  dtc/%:

-- 
Anthony PERARD

  reply	other threads:[~2017-10-19 14:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-16 13:16 [Qemu-devel] [PULL 00/11] Ui 20171016 patches Gerd Hoffmann
2017-10-16 13:16 ` [Qemu-devel] [PULL 01/11] build: automatically handle GIT submodule checkout for dtc Gerd Hoffmann
2017-10-19 14:05   ` Anthony PERARD [this message]
2017-10-19 14:15     ` Daniel P. Berrange
2017-10-16 13:16 ` [Qemu-devel] [PULL 02/11] docker: don't rely on submodules existing in the main checkout Gerd Hoffmann
2017-10-16 13:16 ` [Qemu-devel] [PULL 03/11] ui: add keycodemapdb repository as a GIT submodule Gerd Hoffmann
2017-10-16 13:16 ` [Qemu-devel] [PULL 04/11] ui: convert common input code to keycodemapdb Gerd Hoffmann
2017-10-16 13:16 ` [Qemu-devel] [PULL 05/11] ui: convert key events to QKeyCodes immediately Gerd Hoffmann
2017-10-16 13:16 ` [Qemu-devel] [PULL 06/11] ui: don't export qemu_input_event_new_key Gerd Hoffmann
2017-10-16 13:16 ` [Qemu-devel] [PULL 07/11] tools: add qemu-keymap Gerd Hoffmann
2017-10-19 22:09   ` Eric Blake
2017-10-19 22:12     ` Eric Blake
2017-10-20  6:52       ` Thomas Huth
2017-10-20  7:09         ` Fam Zheng
2017-10-16 13:16 ` [Qemu-devel] [PULL 08/11] Add pc-bios/keymaps/Makefile Gerd Hoffmann
2017-10-16 13:16 ` [Qemu-devel] [PULL 09/11] pc-bios/keymaps: keymaps update Gerd Hoffmann
2017-10-16 13:16 ` [Qemu-devel] [PULL 10/11] ui/gtk: Fix deprecation of vte_terminal_copy_clipboard Gerd Hoffmann
2017-10-16 13:16 ` [Qemu-devel] [PULL 11/11] gtk: fix wrong id between texture and framebuffer Gerd Hoffmann
2017-10-17  9:44 ` [Qemu-devel] [PULL 00/11] Ui 20171016 patches Peter Maydell
2017-10-19  6:50 ` Thomas Huth
2017-10-19  7:14   ` Gerd Hoffmann
2017-10-19  9:13     ` Daniel P. Berrange
2017-10-19  9:11   ` Daniel P. Berrange
  -- strict thread matches above, loose matches on Subject: below --
2017-10-13  8:14 [Qemu-devel] [PULL 00/11] Ui 20171013 patches Gerd Hoffmann
2017-10-13  8:14 ` [Qemu-devel] [PULL 01/11] build: automatically handle GIT submodule checkout for dtc Gerd Hoffmann

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=20171019140545.GA30324@perard.uk.xensource.com \
    --to=anthony.perard@citrix.com \
    --cc=berrange@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.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).