All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andriin@fb.com>,
	Song Liu <songliubraving@fb.com>,
	Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@chromium.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH bpf-next 4/4] kbuild: Add resolve_btfids clean to root clean target
Date: Fri, 12 Feb 2021 12:30:45 +0900	[thread overview]
Message-ID: <CAK7LNAT8oTvLJ9FRsrRB5GUS2K+y2QY36Wshb9x1YE5d=ZyA5g@mail.gmail.com> (raw)
In-Reply-To: <YCUgUlCDGTS85MCO@krava>

On Thu, Feb 11, 2021 at 9:17 PM Jiri Olsa <jolsa@redhat.com> wrote:
>
> On Wed, Feb 10, 2021 at 11:26:28AM -0800, Andrii Nakryiko wrote:
>
> SNIP
>
> > > > > Can't reproduce it. It works in all kinds of variants (relative and
> > > > > absolute O=, clean and not clean trees, etc). Jiri, please check as
> > > > > well.
> > > > >
> > > >
> > > > Odd, this reproduces for me on a completely clean checkout of bpf-next:
> > > >
> > > > $ git clone --depth=1 https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
> > > >
> > > > $ cd bpf-next
> > > >
> > > > $ make -s O=build distclean
> > > > ../../scripts/Makefile.include:4: *** O=/tmp/bpf-next/build/tools/bpf/resolve_btfids does not exist.  Stop.
> > > >
> > > > I do not really see how this could be environment related. It seems like
> > > > this comes from tools/scripts/Makefile.include, where there is no
> > > > guarantee that $(O) is created before being used like in the main
> > > > Makefile?
> > >
> > > right, we need to handle the case where tools/bpf/resolve_btfids
> > > does not exist, patch below fixes it for me
> > >
> > > jirka
> > >
> >
> > Looks good to me, please send it as a proper patch to bpf-next.
> >
> > But I'm curious, why is objtool not doing something like that? Is it
> > not doing clean at all? Or does it do it in some different way?
>
> yes, it's not connected to global make clean
>
> >
> > >
> > > ---
> > > diff --git a/Makefile b/Makefile
> > > index 159d9592b587..ce9685961abe 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -1088,8 +1088,14 @@ endif
> > >
> > >  PHONY += resolve_btfids_clean
> > >
> > > +resolve_btfids_O = $(abspath $(objtree))/tools/bpf/resolve_btfids
> > > +
> > > +# tools/bpf/resolve_btfids directory might not exist
> > > +# in output directory, skip its clean in that case
> > >  resolve_btfids_clean:
> > > -       $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(abspath $(objtree))/tools/bpf/resolve_btfids clean
> > > +ifneq (,$(wildcard $(resolve_btfids_O)))
> >
> > nit: kind of backwards, usually it's in a `ifneq($var,)` form
>
> ok
>
> thanks,
> jirka
>


I expected this kind of mess
when I saw 33a57ce0a54d498275f432db04850001175dfdfa


The tools/ directory is a completely different world
governed by a different build system
(no, not a build system, but a collection of adhoc makefile code)


All the other programs used during the kernel build
are located under scripts/, and can be built with
a simple syntax, and cleaned up correctly.
It is simple, clean and robust.

objtool is the first alien that opt out Kbuild,
and this is the second one.


It is scary to mix up two different things,
which run in different working directories.

See, this is wired up in the top Makefile
in an ugly way, and you are struggling
in suppressing issues, where you can never
do it in the right way.



-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2021-02-12  3:32 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 12:40 [PATCHv2 bpf-next 0/4] kbuild/resolve_btfids: Invoke resolve_btfids clean in root Makefile Jiri Olsa
2021-02-05 12:40 ` [PATCH bpf-next 1/4] tools/resolve_btfids: Build libbpf and libsubcmd in separate directories Jiri Olsa
2021-02-05 22:24   ` Andrii Nakryiko
2021-03-10 17:27   ` Viktor Jägersküpper
2021-03-10 19:27     ` Andrii Nakryiko
2021-03-10 22:42       ` Jiri Olsa
2021-02-05 12:40 ` [PATCH bpf-next 2/4] tools/resolve_btfids: Check objects before removing Jiri Olsa
2021-02-05 23:19   ` Andrii Nakryiko
2021-02-05 12:40 ` [PATCH bpf-next 3/4] tools/resolve_btfids: Set srctree variable unconditionally Jiri Olsa
2021-02-05 22:25   ` Andrii Nakryiko
2021-02-05 12:40 ` [PATCH bpf-next 4/4] kbuild: Add resolve_btfids clean to root clean target Jiri Olsa
2021-02-06  5:11   ` Amy Parker
2021-02-10 17:44   ` Nathan Chancellor
2021-02-10 17:52     ` Andrii Nakryiko
2021-02-10 18:02       ` Nathan Chancellor
2021-02-10 18:29         ` Jiri Olsa
2021-02-10 18:37           ` Nathan Chancellor
2021-02-10 19:26           ` Andrii Nakryiko
2021-02-11 12:17             ` Jiri Olsa
2021-02-12  3:30               ` Masahiro Yamada [this message]
2021-02-12 13:35                 ` Jiri Olsa
2021-02-10 19:23         ` Andrii Nakryiko
2021-02-10 18:14       ` Jiri Olsa
2021-02-05 22:27 ` [PATCHv2 bpf-next 0/4] kbuild/resolve_btfids: Invoke resolve_btfids clean in root Makefile Andrii Nakryiko
2021-02-05 22:32   ` Jiri Olsa
2021-02-06  0:00     ` Jiri Olsa
2021-02-09  5:36 ` Andrii Nakryiko
2021-02-09  9:30   ` Jiri Olsa
     [not found] <20210129134855.195810-1-jolsa@redhat.com>
2021-02-04 21:18 ` [PATCH " Jiri Olsa
2021-02-04 21:18   ` [PATCH bpf-next 4/4] kbuild: Add resolve_btfids clean to root clean target Jiri Olsa
2021-02-04 23:42     ` Song Liu

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='CAK7LNAT8oTvLJ9FRsrRB5GUS2K+y2QY36Wshb9x1YE5d=ZyA5g@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=nathan@kernel.org \
    --cc=netdev@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.