[Qemu-devel] [PATCH] configure: copy MacOS NDRV driver into sharedir for out-of-tree builds

Mark Cave-Ayland posted 1 patch 4 years, 11 months ago
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test checkpatch passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190510163536.4242-1-mark.cave-ayland@ilande.co.uk
configure | 1 +
1 file changed, 1 insertion(+)
[Qemu-devel] [PATCH] configure: copy MacOS NDRV driver into sharedir for out-of-tree builds
Posted by Mark Cave-Ayland 4 years, 11 months ago
Make sure that we include *.ndrv files with those being copied to sharedir
during out-of-tree builds. This ensures that the MacOS driver is correctly
located and loaded by qemu-system-ppc.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 63f312bd1f..9493537301 100755
--- a/configure
+++ b/configure
@@ -7886,6 +7886,7 @@ for bios_file in \
     $source_path/pc-bios/*.dtb \
     $source_path/pc-bios/*.img \
     $source_path/pc-bios/openbios-* \
+    $source_path/pc-bios/*.ndrv \
     $source_path/pc-bios/u-boot.* \
     $source_path/pc-bios/edk2-*.fd.bz2 \
     $source_path/pc-bios/palcode-*
-- 
2.11.0


Re: [Qemu-devel] [PATCH] configure: copy MacOS NDRV driver into sharedir for out-of-tree builds
Posted by Peter Maydell 4 years, 11 months ago
On Fri, 10 May 2019 at 17:37, Mark Cave-Ayland
<mark.cave-ayland@ilande.co.uk> wrote:
>
> Make sure that we include *.ndrv files with those being copied to sharedir
> during out-of-tree builds. This ensures that the MacOS driver is correctly
> located and loaded by qemu-system-ppc.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
>  configure | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/configure b/configure
> index 63f312bd1f..9493537301 100755
> --- a/configure
> +++ b/configure
> @@ -7886,6 +7886,7 @@ for bios_file in \
>      $source_path/pc-bios/*.dtb \
>      $source_path/pc-bios/*.img \
>      $source_path/pc-bios/openbios-* \
> +    $source_path/pc-bios/*.ndrv \
>      $source_path/pc-bios/u-boot.* \
>      $source_path/pc-bios/edk2-*.fd.bz2 \
>      $source_path/pc-bios/palcode-*

The comment above this bit of code says:

# Caution: do not add files or directories here using wildcards. This
# will result in problems later if a new file matching the wildcard is
# added to the source tree -- nothing will cause configure to be rerun
# so the build tree will be missing the link back to the new file, and
# tests might fail.

The pc-bios/ directory is awkward legacy which we
can't really apply the next part of the comment to
("Prefer to keep the relevant files in their own
directory and symlink the directory instead"), but since
there is only one *.ndrv file we can at least avoid the
wildcard by writing "qemu_vga.ndrv" instead of "*.ndrv".

thanks
-- PMM

Re: [Qemu-devel] [PATCH] configure: copy MacOS NDRV driver into sharedir for out-of-tree builds
Posted by Mark Cave-Ayland 4 years, 11 months ago
On 10/05/2019 17:49, Peter Maydell wrote:

> On Fri, 10 May 2019 at 17:37, Mark Cave-Ayland
> <mark.cave-ayland@ilande.co.uk> wrote:
>>
>> Make sure that we include *.ndrv files with those being copied to sharedir
>> during out-of-tree builds. This ensures that the MacOS driver is correctly
>> located and loaded by qemu-system-ppc.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> ---
>>  configure | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/configure b/configure
>> index 63f312bd1f..9493537301 100755
>> --- a/configure
>> +++ b/configure
>> @@ -7886,6 +7886,7 @@ for bios_file in \
>>      $source_path/pc-bios/*.dtb \
>>      $source_path/pc-bios/*.img \
>>      $source_path/pc-bios/openbios-* \
>> +    $source_path/pc-bios/*.ndrv \
>>      $source_path/pc-bios/u-boot.* \
>>      $source_path/pc-bios/edk2-*.fd.bz2 \
>>      $source_path/pc-bios/palcode-*
> 
> The comment above this bit of code says:
> 
> # Caution: do not add files or directories here using wildcards. This
> # will result in problems later if a new file matching the wildcard is
> # added to the source tree -- nothing will cause configure to be rerun
> # so the build tree will be missing the link back to the new file, and
> # tests might fail.
> 
> The pc-bios/ directory is awkward legacy which we
> can't really apply the next part of the comment to
> ("Prefer to keep the relevant files in their own
> directory and symlink the directory instead"), but since
> there is only one *.ndrv file we can at least avoid the
> wildcard by writing "qemu_vga.ndrv" instead of "*.ndrv".

I did spot that, but figured that it was outdated because no-one else was really
following it. The reason for adding the explicit wildcard is that the driver build
produces 2 separate .ndrv files - debug, and non-debug - and so it saves me a bit of
effort after a rebase and rebuild.

Should we say up front as part of the conversion to o-o-t builds that all files must
be explicitly listed in that section as per the comment? Or should each type of
driver live in its own subdirectory?


ATB,

Mark.

Re: [Qemu-devel] [PATCH] configure: copy MacOS NDRV driver into sharedir for out-of-tree builds
Posted by Peter Maydell 4 years, 11 months ago
On Fri, 10 May 2019 at 18:18, Mark Cave-Ayland
<mark.cave-ayland@ilande.co.uk> wrote:
>
> On 10/05/2019 17:49, Peter Maydell wrote:
> > The comment above this bit of code says:
> >
> > # Caution: do not add files or directories here using wildcards. This
> > # will result in problems later if a new file matching the wildcard is
> > # added to the source tree -- nothing will cause configure to be rerun
> > # so the build tree will be missing the link back to the new file, and
> > # tests might fail.
> >
> > The pc-bios/ directory is awkward legacy which we
> > can't really apply the next part of the comment to
> > ("Prefer to keep the relevant files in their own
> > directory and symlink the directory instead"), but since
> > there is only one *.ndrv file we can at least avoid the
> > wildcard by writing "qemu_vga.ndrv" instead of "*.ndrv".
>
> I did spot that, but figured that it was outdated because no-one else was really
> following it. The reason for adding the explicit wildcard is that the driver build
> produces 2 separate .ndrv files - debug, and non-debug - and so it saves me a bit of
> effort after a rebase and rebuild.

It's followed by everything except for the legacy pc-bios
files that were too painful to clean up.

> Should we say up front as part of the conversion to o-o-t builds that all files must
> be explicitly listed in that section as per the comment? Or should each type of
> driver live in its own subdirectory?

The problem here really is that there are two possible
failure modes:
 (1) we use a wildcard, and then when we add a new file
     the link isn't added, and incremental builds fail
 (2) we don't use a wildcard, and then when we add a new
     file we have to manually list it, and if we forget
     then builds fail (both incremental and not)

The ideal way to avoid this is to have an entire directory
which contains pregenerated bios blobs and nothing else,
so we can just symlink the whole directory into the build
tree. But pc-bios has this awkward mix of files which
are pre-generated (and thus in git in the source tree)
and files which will get built by make (and which must
live only in the build tree).

thanks
-- PMM