qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH qemu] git-submodule.sh: Do not try writing to source directory if not necessary
Date: Thu, 26 Oct 2017 08:02:53 +0100	[thread overview]
Message-ID: <20171026070253.GB5847@redhat.com> (raw)
In-Reply-To: <a862a41b-45c6-7b3e-9290-92abfa856e76@ozlabs.ru>

On Thu, Oct 26, 2017 at 11:54:59AM +1100, Alexey Kardashevskiy wrote:
> On 26/10/17 08:11, Daniel P. Berrange wrote:
> > On Wed, Oct 25, 2017 at 07:10:40PM +1100, Alexey Kardashevskiy wrote:
> >> On 25/10/17 17:57, Daniel P. Berrange wrote:
> >>> On Wed, Oct 25, 2017 at 12:45:10PM +1100, Alexey Kardashevskiy wrote:
> >>>> On 25/10/17 03:27, Daniel P. Berrange wrote:
> >>>>> On Tue, Oct 24, 2017 at 07:58:53PM +1100, Alexey Kardashevskiy wrote:
> >>>>>> The new git-submodule.sh script writes .git-submodule-status to
> >>>>>> the source directory every time no matter what. This makes it conditional.
> >>>>>>
> >>>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> >>>>>> ---
> >>>>>>
> >>>>>> I compile out of tree on a remote guest system where I mount the
> >>>>>> source directory as "readonly" and build directory as "rw" and
> >>>>>> scripts/git-submodule.sh tries writing to the source directory even when
> >>>>>> I manually update modules on a host machine which is quite annoying.
> >>>>>>
> >>>>>> Is this something acceptable? Or I am missing something here?
> >>>>>
> >>>>> How did you update the modules - did you manually run  'git submodule update...'
> >>>>> or did you use the git-submodule.sh script on your host machine ?
> >>>>
> >>>>
> >>>> I run scripts/git-submodule.sh. Which is not thrilling either as I rather
> >>>> expect source tree not to be affected in any way when running "make".
> >>>
> >>> Oh, did you pass the list of sub-modules to it when running
> >>>
> >>> eg, ./scripts/git-submodule.sh update ui/keycodemapdb
> >>>
> >>> the list of submodules you need is printed in the configure output summary.
> >>
> >> Sure, otherwise it does nothing.
> >>
> >>
> >>>
> >>>>> If you run git-submodule.sh on the host, then it should save the status
> >>>>> file, and then when you run make on the guest system, it should notice
> >>>>> that you're already updated and never even invoke 'git-submodule.sh update'
> >>>>
> >>>>
> >>>> scripts/git-submodule.sh also tries writing to the source directory (I
> >>>> should probably have fixed that branch too) but this failure is not fatal
> >>>> for "make" but makes it want to try "update" and then "make" fails.
> >>>
> >>> This shouldn't have happened in your case though, if you have already run
> >>> 'git-submodule.sh update ...list of modules...' on the host machine, with
> >>> the same list of modules that the guest 'configure' printed out.
> >>
> >> It does not matter if I run git-submodule.sh or not - "git-submodule.sh
> >> status" will try writing to the read only folder anyway and it will fail
> >> and Makefile's  git_module_status will be set to 1.
> > 
> > 
> > Ahhhh, great, now I understand why you're hitting the problem !
> > 
> >> If I do as below (and that's what I should have done as I said), then
> >> "git-submodule.sh update" is not invoked and we are good. I am not
> >> reposting it yet as 1) my shell skills are crap (need to delete the temp
> >> file or rewrite the whole thing not to use temp file or rewrite it in
> >> python - why do not people use python everywhere?!) 2) I still hope we stop
> >> doing this from Makefile :)
> > 
> > I agree using a tmpfile is the right fix here.
> 
> 
> I still think not doing "git update" from Makefile is the right fix here,
> is that a final decision? Why cannot "configure" do this (and ideally have
> a way not to do this at all, like --no-git-submodules-update)?  Just
> checking...

That ends up doing exactly the same thing. We would need to make sure that
configure gets re-run when the submodules change. So you just go from having
'make' run git-submodule.sh, to have make run config.status which runs
configure, which runs git-submodule.sh. 

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 :|

  reply	other threads:[~2017-10-26  7:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24  8:58 [Qemu-devel] [RFC PATCH qemu] git-submodule.sh: Do not try writing to source directory if not necessary Alexey Kardashevskiy
2017-10-24 16:27 ` Daniel P. Berrange
2017-10-24 16:33   ` Peter Maydell
2017-10-25  1:24     ` Alexey Kardashevskiy
2017-10-25  1:45   ` Alexey Kardashevskiy
2017-10-25  6:57     ` Daniel P. Berrange
2017-10-25  8:10       ` Alexey Kardashevskiy
2017-10-25 21:11         ` Daniel P. Berrange
2017-10-26  0:54           ` Alexey Kardashevskiy
2017-10-26  7:02             ` Daniel P. Berrange [this message]
2017-10-26  7:45               ` Alexey Kardashevskiy
2017-10-26  8:18                 ` Peter Maydell

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=20171026070253.GB5847@redhat.com \
    --to=berrange@redhat.com \
    --cc=aik@ozlabs.ru \
    --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).