Re: [OS-BUILD PATCH] Adding support for distro targets in Makefile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 24, 2022 at 1:08 AM Justin Forbes <jforbes@xxxxxxxxxxxxxxxxx> wrote:
>
> On Wed, Nov 23, 2022 at 9:59 AM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
> >
> > On Thu, Nov 24, 2022 at 12:32 AM Don Zickus <dzickus@xxxxxxxxxx> wrote:
> > >
> > > Fedora adds a directory to its source git tree to provide packaging
> > > information[1] specific for its distro.  We would like to propagate our
> > > 'help' section to the toplevel to be seen by 'make help' as it isn't
> > > obvious to users to use 'make dist-help'[2].
> > >
> > > Instead of keeping Fedora changes local, I am proposing a generic
> > > mechanism for other distros to use if they would like.  The change looks
> > > for a distro directory and leverages that Makefile if it exists.
> > > Otherwise it is ignored.
> > >
> > > [1] - https://gitlab.com/cki-project/kernel-ark/-/tree/os-build/redhat
> > > [2] - https://gitlab.com/cki-project/kernel-ark/-/blob/os-build/redhat/Makefile#L809
> > >
> > > Signed-off-by: Jonathan Toppins <jtoppins@xxxxxxxxxx>
> > > Signed-off-by: Don Zickus <dzickus@xxxxxxxxxx>
> > >
> > > ----
> > > This patch is more of a conversation starter than anything.
> > >
> > > I think other distros might find this useful and examples of what we would
> > > populate the directory with can be found in [1].
> > >
> > > Thoughts?
> >
> > I do not like to merge any code that is irrelevant to the upstream.
>
>
> While not directly relevant to the upstream tree, it is very relevant
> to the way the tree is being used. More importantly, it allows a
> "distro agnostic" mechanism without requiring distributions or other
> developers/users with their own additional make targets to avoid
> carrying a patch to make it all work.
>
> Justin



This is another contract to downstream code.

Once this is merged, it will be difficult to change it
because the upstream community never knows how it is used
in downstream.


For example,

   $(Q)$(MAKE) -C $(srctree)/distro $@

violates the rule on how Kbuild works
(in the sense of the working directory).


   $(Q)$(MAKE) -f $(srctree)/distro/Makefile $@

is more aligned with how O= build works, but
we cannot _fix_ it later since this changes the working directory.

And, I assume people will come back again, for example,
to insert another hook into "make clean" for cleaning distro artifacts.

So, it is better to not merge code like this.






> >
> > > ---
> > >  Makefile | 15 +++++++++++++++
> > >  1 file changed, 15 insertions(+)
> > >
> > > diff --git a/Makefile b/Makefile
> > > index 6f846b1f2618f..45fdb18dde46f 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -1635,6 +1635,16 @@ distclean: mrproper
> > >  %pkg: include/config/kernel.release FORCE
> > >         $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@
> > >
> > > +# Distribution of the kernel
> > > +# ---------------------------------------------------------------------------
> > > +
> > > +dist%: FORCE
> > > +       @if ! test -f $(srctree)/distro/Makefile; then \
> > > +               echo 'No distribution targets defined'; \
> > > +               exit 1; \
> > > +       fi
> > > +       $(Q)$(MAKE) -C $(srctree)/distro $@
> > > +
> > >  # Brief documentation of the typical targets used
> > >  # ---------------------------------------------------------------------------
> > >
> > > @@ -1732,6 +1742,11 @@ help:
> > >         @echo  ''
> > >         @echo  'Kernel packaging:'
> > >         @$(MAKE) -f $(srctree)/scripts/Makefile.package help
> > > +       @if test -f $(srctree)/distro/Makefile; then \
> > > +               echo ''; \
> > > +               echo 'Distro targets:'; \
> > > +               $(MAKE) -C $(srctree)/distro dist-help; \
> > > +       fi
> > >         @echo  ''
> > >         @echo  'Documentation targets:'
> > >         @$(MAKE) -f $(srctree)/Documentation/Makefile dochelp
> > > --
> > > 2.38.1
> > >
> >
> >
> > --
> > Best Regards
> > Masahiro Yamada
> >



-- 
Best Regards
Masahiro Yamada



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux