Re: [PATCH v3 3/3] selftests: pidfd: add tests for PIDFD_SELF_*

Sean Christopherson
2025-05-01T19:50:06Z

On Thu, May 01, 2025, Peter Zijlstra wrote:
> On Thu, May 01, 2025 at 01:42:35PM +0200, Peter Zijlstra wrote:
> > On Wed, Oct 16, 2024 at 07:14:34PM -0700, John Hubbard wrote:
> > > Peter Zijlstra's "NAK NAK NAK" response [1] last year was the most
> > > colorful, so I'll helpfully cite it here. :)
> >
> > Let me re-try this.
> >
> > This is driving me insane. I've spend the past _TWO_ days trying to
> > build KVM selftests and I'm still failing.
> >
> > This is absolute atrocious crap and is costing me valuable time.
> >
> > Please fix this fucking selftests shit to just build. This is unusable
> > garbage.
>
> So after spending more time trying to remember how to debug Makefiles (I
> hate my life), I found that not only do I need this headers shit, the
> kvm selftests Makefile is actively broken if you use: make O=foo
>
> -INSTALL_HDR_PATH = $(top_srcdir)/usr
> +INSTALL_HDR_PATH = $(top_srcdir)/$(O)/usr
>
>
> And then finally, I can do:
>
> make O=foo headers_install
> make O=foo -C tools/testing/selftests/kvm/

This doesn't actually work either, because for whatever reason, the selftests
infrastructure uses OUTPUT, not O, for the output directory.

And the whole top_srcdir crud doesn't work if O/OUTPUT is completely out-of-tree,
e.g. I use absolute paths that have nothing to do with the source tree.

I am more than happy to support any cleanup of KVM selftests, but I've more or
less given up myself because so much of the ugliness is inhereted from selftests.
I've resorted to hacked wrappers to make it work for my setup. E.g. I force
KHDR_INCLUDES and INSTALL_HDR_PATH so that make doesn't try to grab usr/ files
from the source tree.