bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Michal Marek <michal.lkml@markovi.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>,
	Sedat Dilek <sedat.dilek@gmail.com>
Subject: Re: [PATCH] bpf: Hoise pahole version checks into Kconfig
Date: Mon, 11 Jan 2021 13:00:10 -0700	[thread overview]
Message-ID: <20210111200010.GA3635011@ubuntu-m3-large-x86> (raw)
In-Reply-To: <CAK7LNASZuWp=aPOCKo6QkdHwM5KG6MUv8305v3x-2yR7cKEX-w@mail.gmail.com>

On Tue, Jan 12, 2021 at 04:50:50AM +0900, Masahiro Yamada wrote:
> On Tue, Jan 12, 2021 at 4:34 AM Nathan Chancellor
> <natechancellor@gmail.com> wrote:
> >
> > On Tue, Jan 12, 2021 at 04:19:01AM +0900, Masahiro Yamada wrote:
> > > On Tue, Jan 12, 2021 at 3:06 AM Nathan Chancellor
> > > <natechancellor@gmail.com> wrote:
> > > >
> > > > After commit da5fb18225b4 ("bpf: Support pre-2.25-binutils objcopy for
> > > > vmlinux BTF"), having CONFIG_DEBUG_INFO_BTF enabled but lacking a valid
> > > > copy of pahole results in a kernel that will fully compile but fail to
> > > > link. The user then has to either install pahole or disable
> > > > CONFIG_DEBUG_INFO_BTF and rebuild the kernel but only after their build
> > > > has failed, which could have been a significant amount of time depending
> > > > on the hardware.
> > > >
> > > > Avoid a poor user experience and require pahole to be installed with an
> > > > appropriate version to select and use CONFIG_DEBUG_INFO_BTF, which is
> > > > standard for options that require a specific tools version.
> > > >
> > > > Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > > > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> > >
> > >
> > >
> > > I am not sure if this is the right direction.
> > >
> > >
> > > I used to believe moving any tool test to the Kconfig
> > > was the right thing to do.
> > >
> > > For example, I tried to move the libelf test to Kconfig,
> > > and make STACK_VALIDATION depend on it.
> > >
> > > https://patchwork.kernel.org/project/linux-kbuild/patch/1531186516-15764-1-git-send-email-yamada.masahiro@socionext.com/
> > >
> > > It was rejected.
> > >
> > >
> > > In my understanding, it is good to test target toolchains
> > > in Kconfig (e.g. cc-option, ld-option, etc).
> > >
> > > As for host tools, in contrast, it is better to _intentionally_
> > > break the build in order to let users know that something needed is missing.
> > > Then, they will install necessary tools or libraries.
> > > It is just a one-time setup, in most cases,
> > > just running 'apt install' or 'dnf install'.
> > >
> > >
> > >
> > > Recently, a similar thing happened to GCC_PLUGINS
> > > https://patchwork.kernel.org/project/linux-kbuild/patch/20201203125700.161354-1-masahiroy@kernel.org/#23855673
> > >
> > >
> > >
> > >
> > > Following this pattern, if a new pahole is not installed,
> > > it might be better to break the build instead of hiding
> > > the CONFIG option.
> > >
> > > In my case, it is just a matter of 'apt install pahole'.
> > > On some distributions, the bundled pahole is not new enough,
> > > and people may end up with building pahole from the source code.
> >
> > This is fair enough. However, I think that parts of this patch could
> > still be salvaged into something that fits this by making it so that if
> > pahole is not installed (CONFIG_PAHOLE_VERSION=0) or too old, the build
> > errors at the beginning, rather at the end. I am not sure where the best
> > place to put that check would be though.
> 
> Me neither.
> 
> 
> Collecting tool checks to the beginning would be user-friendly.
> However, scattering the related code to multiple places is not
> nice from the developer point of view.
> 
> How big is it a problem if the build fails
> at the very last stage?
> 
> You can install pahole, then resume "make".
> 
> Kbuild skips unneeded building, then you will
> be able to come back to the last build stage shortly.

There will often be times where I am testing multiple configurations in
a row serially and the longer that a build takes to fail, the longer it
takes for me to get a "real" result. That is my motivation behind this
change. If people are happy with the current state of things, I will
just stick with universally disabling CONFIG_DEBUG_INFO_BTF in my test
framework.

Cheers,
Nathan

  reply	other threads:[~2021-01-11 20:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 18:06 [PATCH] bpf: Hoise pahole version checks into Kconfig Nathan Chancellor
2021-01-11 19:19 ` Masahiro Yamada
2021-01-11 19:34   ` Nathan Chancellor
2021-01-11 19:50     ` Masahiro Yamada
2021-01-11 20:00       ` Nathan Chancellor [this message]
2021-01-11 21:24         ` Andrii Nakryiko
2021-01-13 22:38           ` Andrii Nakryiko
2021-01-13 23:07             ` Nathan Chancellor
2021-02-04  7:22               ` Sedat Dilek
2021-01-12 23:43 ` Sedat Dilek
2021-02-04 18:11 ` Sedat Dilek

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=20210111200010.GA3635011@ubuntu-m3-large-x86 \
    --to=natechancellor@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=netdev@vger.kernel.org \
    --cc=sedat.dilek@gmail.com \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /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).