mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vegard Nossum <vegard.nossum@oracle.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [RFC PATCH] kbuild: only prompt for compressors that are actually usable
Date: Wed, 13 Oct 2021 07:39:16 +0200	[thread overview]
Message-ID: <68df3063-1dda-4736-27b4-8716321620c7@oracle.com> (raw)
In-Reply-To: <CAK7LNAT_0PnW0opWQoCiF5mWH4YEKxXHbdiTrSGqGFRv5nhY=w@mail.gmail.com>


On 10/13/21 3:34 AM, Masahiro Yamada wrote:
> On Wed, Oct 13, 2021 at 2:01 AM Vegard Nossum <vegard.nossum@oracle.com> wrote:
>>
>> If a given compression algorithm for the kernel image is not usable on
>> the host system, there is no point prompting for it.
>>
>> We can use the kconfig preprocessing feature to check if the command is
>> available or not. I've chosen to test this using "which", which exits
>> with success if the given command exists in PATH (or it is an absolute
>> path), which mimics exactly how it would be found in the kernel's
>> Makefiles.
>>
>> This uses the make variables that are set in Makefile and/or the
>> command line, so you can do e.g.
>>
>>   make KGZIP=pigz menuconfig
>>
>> and it will test for the correct program.
>>
>> I am intentionally adding these dependencies to e.g. KERNEL_LZ4, as
>> opposed to HAVE_KERNEL_LZ4, since the latter are "select"-ed
>> unconditionally by the architectures that use them, so they are not
>> suitable for depending on anything else.
>>
>> I've put RFC in the subject as maybe there are downsides to this that
>> I'm not aware of.
>>
>> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
>> ---
> 
> 
> I think we should keep the host-tools dependency open in general.
> You can easily install necessary packages.

So just to be clear, you object to the patch because it hides the
possibility of using a different compression algorithm from the user and
doesn't give them a chance to know that it exists when it's not already
installed?

I don't really think this is much different from any other choice block
in the config where the visibility of the choices have dependencies on
other config options.

In my case, the reason for doing this patch was that I was seeing build
failures during randomized testing (satrandconfig) due to missing
programs, and these build failures appear only at the end of potentially
very time-consuming builds.

Maybe we can introduce a new option similar to COMPILE_TEST (or
ADVANCED_OPTIONS) so that the options are showed by default, even when
the host program is not available?

+config UNAVAILABLE_COMPRESSORS
+       bool "Prompt for compressors that are not available"
+       help
+         Note: Enabling this option can lead to build failures if
+         the chosen compressor is not available on the host machine.

 config KERNEL_GZIP
        bool "Gzip"
        depends on HAVE_KERNEL_GZIP
+       depends on UNAVAILABLE_COMPRESSORS || $(success,which $(KGZIP))
        help
          The old and tried gzip compression. It provides a good balance
          between compression ratio and decompression speed.


Vegard

  reply	other threads:[~2021-10-13  5:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12 17:01 Vegard Nossum
2021-10-12 19:44 ` Randy Dunlap
2021-10-13  1:34 ` Masahiro Yamada
2021-10-13  5:39   ` Vegard Nossum [this message]
2021-10-13  7:00     ` Masahiro Yamada

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=68df3063-1dda-4736-27b4-8716321620c7@oracle.com \
    --to=vegard.nossum@oracle.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=rdunlap@infradead.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

all inboxes | Powered by JetHome®