* [Qemu-devel] [PATCH] rules: don't try to create missing include dirs
@ 2017-02-06 11:29 Daniel P. Berrange
2017-02-06 11:42 ` Alberto Garcia
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Daniel P. Berrange @ 2017-02-06 11:29 UTC (permalink / raw)
To: qemu-devel
Cc: Stefan Hajnoczi, Alberto Garcia, Paolo Bonzini, Eric Blake,
Daniel P. Berrange
In
commit ba78db44f6532d66a1e704bd44613e841baa2fc5
Author: Daniel P. Berrange <berrange@redhat.com>
Date: Wed Jan 25 16:14:10 2017 +0000
make: move top level dir to end of include search path
The dir $(BUILD_DIR)/$(@D) was added to the include
path. This would sometimes point to a non-existant
directory, if the sub-dir in question did not contain
any target-independant files (eg tcg/). To deal with
this the rules.mak attempted to create the directory.
While this was succesful, it also caused accidental
creation of files in the parent of the build dir.
e.g. when building common source files into target
specific output files.
Rather than trying to workaround this, just revert
the code that attempted to mkdir the missing include
directories. Instead just turn off the compiler warning
in question as the missing dir is expected & harmless
in general.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
configure | 2 +-
rules.mak | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/configure b/configure
index 86fd833..6325339 100755
--- a/configure
+++ b/configure
@@ -1474,7 +1474,7 @@ fi
gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
-gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
+gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
gcc_flags="-Wno-initializer-overrides $gcc_flags"
gcc_flags="-Wno-string-plus-int $gcc_flags"
diff --git a/rules.mak b/rules.mak
index 575a3af..83d6dd1 100644
--- a/rules.mak
+++ b/rules.mak
@@ -374,7 +374,6 @@ define unnest-vars
$(eval $(o:%.mo=%$(DSOSUF)): module-common.o $($o-objs)),
$(error $o added in $v but $o-objs is not set)))
$(shell mkdir -p ./ $(sort $(dir $($v))))
- $(shell cd $(BUILD_DIR) && mkdir -p ./ $(sort $(dir $($v))))
# Include all the .d files
$(eval -include $(patsubst %.o,%.d,$(patsubst %.mo,%.d,$($v))))
$(eval $v := $(filter-out %/,$($v))))
--
2.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] rules: don't try to create missing include dirs
2017-02-06 11:29 [Qemu-devel] [PATCH] rules: don't try to create missing include dirs Daniel P. Berrange
@ 2017-02-06 11:42 ` Alberto Garcia
2017-02-06 11:50 ` Peter Maydell
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Alberto Garcia @ 2017-02-06 11:42 UTC (permalink / raw)
To: Daniel P. Berrange, qemu-devel; +Cc: Stefan Hajnoczi, Paolo Bonzini, Eric Blake
On Mon 06 Feb 2017 12:29:53 PM CET, "Daniel P. Berrange" wrote:
> Rather than trying to workaround this, just revert the code that
> attempted to mkdir the missing include directories. Instead just turn
> off the compiler warning in question as the missing dir is expected &
> harmless in general.
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Tested-by: Alberto Garcia <berto@igalia.com>
Berto
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] rules: don't try to create missing include dirs
2017-02-06 11:29 [Qemu-devel] [PATCH] rules: don't try to create missing include dirs Daniel P. Berrange
2017-02-06 11:42 ` Alberto Garcia
@ 2017-02-06 11:50 ` Peter Maydell
2017-02-06 12:05 ` Daniel P. Berrange
2017-02-07 12:04 ` Peter Maydell
2017-02-07 15:13 ` Stefan Hajnoczi
3 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2017-02-06 11:50 UTC (permalink / raw)
To: Daniel P. Berrange
Cc: QEMU Developers, Paolo Bonzini, Alberto Garcia, Stefan Hajnoczi
On 6 February 2017 at 11:29, Daniel P. Berrange <berrange@redhat.com> wrote:
> In
>
> commit ba78db44f6532d66a1e704bd44613e841baa2fc5
> Author: Daniel P. Berrange <berrange@redhat.com>
> Date: Wed Jan 25 16:14:10 2017 +0000
>
> make: move top level dir to end of include search path
>
> The dir $(BUILD_DIR)/$(@D) was added to the include
> path. This would sometimes point to a non-existant
> directory, if the sub-dir in question did not contain
> any target-independant files (eg tcg/). To deal with
> this the rules.mak attempted to create the directory.
>
> While this was succesful, it also caused accidental
> creation of files in the parent of the build dir.
> e.g. when building common source files into target
> specific output files.
Aha, that's where those directories came from!
> Rather than trying to workaround this, just revert
> the code that attempted to mkdir the missing include
> directories. Instead just turn off the compiler warning
> in question as the missing dir is expected & harmless
> in general.
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> configure | 2 +-
> rules.mak | 1 -
> 2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 86fd833..6325339 100755
> --- a/configure
> +++ b/configure
> @@ -1474,7 +1474,7 @@ fi
>
> gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
> gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
> -gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
> +gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
> gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
> gcc_flags="-Wno-initializer-overrides $gcc_flags"
> gcc_flags="-Wno-string-plus-int $gcc_flags"
> diff --git a/rules.mak b/rules.mak
> index 575a3af..83d6dd1 100644
> --- a/rules.mak
> +++ b/rules.mak
> @@ -374,7 +374,6 @@ define unnest-vars
> $(eval $(o:%.mo=%$(DSOSUF)): module-common.o $($o-objs)),
> $(error $o added in $v but $o-objs is not set)))
> $(shell mkdir -p ./ $(sort $(dir $($v))))
> - $(shell cd $(BUILD_DIR) && mkdir -p ./ $(sort $(dir $($v))))
I know this is the same syntax as the existing line above
and we're deleting it anyway, but what does it actually do?
When does telling mkdir to create "./" make sense?
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] rules: don't try to create missing include dirs
2017-02-06 11:50 ` Peter Maydell
@ 2017-02-06 12:05 ` Daniel P. Berrange
2017-02-06 12:22 ` Paolo Bonzini
0 siblings, 1 reply; 8+ messages in thread
From: Daniel P. Berrange @ 2017-02-06 12:05 UTC (permalink / raw)
To: Peter Maydell
Cc: QEMU Developers, Paolo Bonzini, Alberto Garcia, Stefan Hajnoczi
On Mon, Feb 06, 2017 at 11:50:09AM +0000, Peter Maydell wrote:
> On 6 February 2017 at 11:29, Daniel P. Berrange <berrange@redhat.com> wrote:
> > In
> >
> > commit ba78db44f6532d66a1e704bd44613e841baa2fc5
> > Author: Daniel P. Berrange <berrange@redhat.com>
> > Date: Wed Jan 25 16:14:10 2017 +0000
> >
> > make: move top level dir to end of include search path
> >
> > The dir $(BUILD_DIR)/$(@D) was added to the include
> > path. This would sometimes point to a non-existant
> > directory, if the sub-dir in question did not contain
> > any target-independant files (eg tcg/). To deal with
> > this the rules.mak attempted to create the directory.
> >
> > While this was succesful, it also caused accidental
> > creation of files in the parent of the build dir.
> > e.g. when building common source files into target
> > specific output files.
>
> Aha, that's where those directories came from!
>
> > Rather than trying to workaround this, just revert
> > the code that attempted to mkdir the missing include
> > directories. Instead just turn off the compiler warning
> > in question as the missing dir is expected & harmless
> > in general.
> >
> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> > ---
> > configure | 2 +-
> > rules.mak | 1 -
> > 2 files changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 86fd833..6325339 100755
> > --- a/configure
> > +++ b/configure
> > @@ -1474,7 +1474,7 @@ fi
> >
> > gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
> > gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
> > -gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
> > +gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
> > gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
> > gcc_flags="-Wno-initializer-overrides $gcc_flags"
> > gcc_flags="-Wno-string-plus-int $gcc_flags"
> > diff --git a/rules.mak b/rules.mak
> > index 575a3af..83d6dd1 100644
> > --- a/rules.mak
> > +++ b/rules.mak
> > @@ -374,7 +374,6 @@ define unnest-vars
> > $(eval $(o:%.mo=%$(DSOSUF)): module-common.o $($o-objs)),
> > $(error $o added in $v but $o-objs is not set)))
> > $(shell mkdir -p ./ $(sort $(dir $($v))))
> > - $(shell cd $(BUILD_DIR) && mkdir -p ./ $(sort $(dir $($v))))
>
> I know this is the same syntax as the existing line above
> and we're deleting it anyway, but what does it actually do?
> When does telling mkdir to create "./" make sense?
No idea why the ./ was there originally - it appears to serve no
purpose. The useful bit is the stuff afterwards - the $($v) bit.
It gets populated based on the variable being unnested. For example
block-obj-y = block.o blockjob.o block/ nbd/
will make $v contain "block nbd", hence cause creation of those
dirs in the the build dir.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] rules: don't try to create missing include dirs
2017-02-06 12:05 ` Daniel P. Berrange
@ 2017-02-06 12:22 ` Paolo Bonzini
2017-02-06 12:23 ` Daniel P. Berrange
0 siblings, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2017-02-06 12:22 UTC (permalink / raw)
To: Daniel P. Berrange, Peter Maydell
Cc: QEMU Developers, Alberto Garcia, Stefan Hajnoczi
On 06/02/2017 13:05, Daniel P. Berrange wrote:
>>> $(shell mkdir -p ./ $(sort $(dir $($v))))
>>> - $(shell cd $(BUILD_DIR) && mkdir -p ./ $(sort $(dir $($v))))
>> I know this is the same syntax as the existing line above
>> and we're deleting it anyway, but what does it actually do?
>> When does telling mkdir to create "./" make sense?
> No idea why the ./ was there originally - it appears to serve no
> purpose. The useful bit is the stuff afterwards - the $($v) bit.
> It gets populated based on the variable being unnested. For example
>
> block-obj-y = block.o blockjob.o block/ nbd/
>
> will make $v contain "block nbd", hence cause creation of those
> dirs in the the build dir.
"mkdir -p" with no arguments gives an error, the "./" shuts it up.
Paolo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] rules: don't try to create missing include dirs
2017-02-06 12:22 ` Paolo Bonzini
@ 2017-02-06 12:23 ` Daniel P. Berrange
0 siblings, 0 replies; 8+ messages in thread
From: Daniel P. Berrange @ 2017-02-06 12:23 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Peter Maydell, QEMU Developers, Alberto Garcia, Stefan Hajnoczi
On Mon, Feb 06, 2017 at 01:22:08PM +0100, Paolo Bonzini wrote:
>
>
> On 06/02/2017 13:05, Daniel P. Berrange wrote:
> >>> $(shell mkdir -p ./ $(sort $(dir $($v))))
> >>> - $(shell cd $(BUILD_DIR) && mkdir -p ./ $(sort $(dir $($v))))
> >> I know this is the same syntax as the existing line above
> >> and we're deleting it anyway, but what does it actually do?
> >> When does telling mkdir to create "./" make sense?
> > No idea why the ./ was there originally - it appears to serve no
> > purpose. The useful bit is the stuff afterwards - the $($v) bit.
> > It gets populated based on the variable being unnested. For example
> >
> > block-obj-y = block.o blockjob.o block/ nbd/
> >
> > will make $v contain "block nbd", hence cause creation of those
> > dirs in the the build dir.
>
> "mkdir -p" with no arguments gives an error, the "./" shuts it up.
Ah yes, clever. So that deals with case of unnesting a variable which
does not contain any nested dirs.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] rules: don't try to create missing include dirs
2017-02-06 11:29 [Qemu-devel] [PATCH] rules: don't try to create missing include dirs Daniel P. Berrange
2017-02-06 11:42 ` Alberto Garcia
2017-02-06 11:50 ` Peter Maydell
@ 2017-02-07 12:04 ` Peter Maydell
2017-02-07 15:13 ` Stefan Hajnoczi
3 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2017-02-07 12:04 UTC (permalink / raw)
To: Daniel P. Berrange
Cc: QEMU Developers, Paolo Bonzini, Alberto Garcia, Stefan Hajnoczi
On 6 February 2017 at 11:29, Daniel P. Berrange <berrange@redhat.com> wrote:
> In
>
> commit ba78db44f6532d66a1e704bd44613e841baa2fc5
> Author: Daniel P. Berrange <berrange@redhat.com>
> Date: Wed Jan 25 16:14:10 2017 +0000
>
> make: move top level dir to end of include search path
>
> The dir $(BUILD_DIR)/$(@D) was added to the include
> path. This would sometimes point to a non-existant
> directory, if the sub-dir in question did not contain
> any target-independant files (eg tcg/). To deal with
> this the rules.mak attempted to create the directory.
>
> While this was succesful, it also caused accidental
> creation of files in the parent of the build dir.
> e.g. when building common source files into target
> specific output files.
>
> Rather than trying to workaround this, just revert
> the code that attempted to mkdir the missing include
> directories. Instead just turn off the compiler warning
> in question as the missing dir is expected & harmless
> in general.
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
Thanks; planning to apply this to master as a buildfix with the
following added to the commit message:
NB: you can clean up a build directory parent that has
been filled with empty directories by commit ba78db44f653
using this GNU find command in that parent directory:
find audio backends block chardev crypto disas fsdev hw io linux-user \
migration nbd net qapi qom replay slirp target ui util \
-type d -empty -delete
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] rules: don't try to create missing include dirs
2017-02-06 11:29 [Qemu-devel] [PATCH] rules: don't try to create missing include dirs Daniel P. Berrange
` (2 preceding siblings ...)
2017-02-07 12:04 ` Peter Maydell
@ 2017-02-07 15:13 ` Stefan Hajnoczi
3 siblings, 0 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2017-02-07 15:13 UTC (permalink / raw)
To: Daniel P. Berrange; +Cc: qemu-devel, Alberto Garcia, Paolo Bonzini, Eric Blake
[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]
On Mon, Feb 06, 2017 at 11:29:53AM +0000, Daniel P. Berrange wrote:
> In
>
> commit ba78db44f6532d66a1e704bd44613e841baa2fc5
> Author: Daniel P. Berrange <berrange@redhat.com>
> Date: Wed Jan 25 16:14:10 2017 +0000
>
> make: move top level dir to end of include search path
>
> The dir $(BUILD_DIR)/$(@D) was added to the include
> path. This would sometimes point to a non-existant
> directory, if the sub-dir in question did not contain
> any target-independant files (eg tcg/). To deal with
> this the rules.mak attempted to create the directory.
>
> While this was succesful, it also caused accidental
> creation of files in the parent of the build dir.
> e.g. when building common source files into target
> specific output files.
>
> Rather than trying to workaround this, just revert
> the code that attempted to mkdir the missing include
> directories. Instead just turn off the compiler warning
> in question as the missing dir is expected & harmless
> in general.
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> configure | 2 +-
> rules.mak | 1 -
> 2 files changed, 1 insertion(+), 2 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-02-07 15:13 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-06 11:29 [Qemu-devel] [PATCH] rules: don't try to create missing include dirs Daniel P. Berrange
2017-02-06 11:42 ` Alberto Garcia
2017-02-06 11:50 ` Peter Maydell
2017-02-06 12:05 ` Daniel P. Berrange
2017-02-06 12:22 ` Paolo Bonzini
2017-02-06 12:23 ` Daniel P. Berrange
2017-02-07 12:04 ` Peter Maydell
2017-02-07 15:13 ` Stefan Hajnoczi
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).