mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Set environment variable `KVM` makes build fail
@ 2022-02-13  6:03 Paul Menzel
  2022-02-13  8:07 ` Zhouyi Zhou
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Menzel @ 2022-02-13  6:03 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: kvm, Masahiro Yamada, Michal Marek, linux-kbuild, linux-kernel,
	rcu, Paul E. McKenney, Zhouyi Zhou

Dear Linux folks,


Playing with rcutorture 
(`tools/testing/selftests/rcutorture/bin/torture.sh`), a Linux kernel 
build failed, because the script sets and exports the environment 
variable `KVM`. I was able to reproduce that manually (on x86_64):

     $ make defconfig
     $ scripts/config -m KVM
     $ scripts/config -m KVM_INTEL
     $ scripts/config -d KVM_AMD
     $ scripts/config -d KVM_XEN
     $ scripts/config -d KVM_MMU_AUDIT
     $ export KVM=XXX
     $ make arch/x86/kvm/kvm.o
     […]
       LINK    /dev/shm/linux-kvm/tools/objtool/objtool
     make[2]: *** No rule to make target 'arch/x86/kvm/XXX/kvm_main.o', 
needed by 'arch/x86/kvm/kvm.o'.  Stop.
     make[1]: *** [scripts/Makefile.build:550: arch/x86/kvm] Error 2
     make: *** [Makefile:1831: arch/x86] Error 2

The directory `arch/x86/kvm/XXX` is created somehow.

Is that expected? Do you know what is going on? I wasn’t able to 
reproduce this with other variables like `SND_HDA` for example.


Kind regards,

Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Set environment variable `KVM` makes build fail
  2022-02-13  6:03 Set environment variable `KVM` makes build fail Paul Menzel
@ 2022-02-13  8:07 ` Zhouyi Zhou
  2022-02-13  9:45   ` Paul Menzel
  0 siblings, 1 reply; 4+ messages in thread
From: Zhouyi Zhou @ 2022-02-13  8:07 UTC (permalink / raw)
  To: Paul Menzel
  Cc: Paolo Bonzini, kvm, Masahiro Yamada, Michal Marek, linux-kbuild,
	linux-kernel, rcu, Paul E. McKenney

Dear Paul

Thank you for your trust in me.

I think the following patch has a good explanation of what happened ;-)
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/tools/testing/selftests/rcutorture/bin/torture.sh?id=a7d89cfb8e1269cb6d22453adba56b8d0218589f
"The torture-test scripting's long-standing use of KVM as the
environment variable tracking the pathname of the rcutorture directory
now conflicts with allmodconfig builds due to the
virt/kvm/Makefile.kvm file's use of this as a makefile variable"

Thanks
Zhouyi

On Sun, Feb 13, 2022 at 2:03 PM Paul Menzel <pmenzel@molgen.mpg.de> wrote:
>
> Dear Linux folks,
>
>
> Playing with rcutorture
> (`tools/testing/selftests/rcutorture/bin/torture.sh`), a Linux kernel
> build failed, because the script sets and exports the environment
> variable `KVM`. I was able to reproduce that manually (on x86_64):
>
>      $ make defconfig
>      $ scripts/config -m KVM
>      $ scripts/config -m KVM_INTEL
>      $ scripts/config -d KVM_AMD
>      $ scripts/config -d KVM_XEN
>      $ scripts/config -d KVM_MMU_AUDIT
>      $ export KVM=XXX
>      $ make arch/x86/kvm/kvm.o
>      […]
>        LINK    /dev/shm/linux-kvm/tools/objtool/objtool
>      make[2]: *** No rule to make target 'arch/x86/kvm/XXX/kvm_main.o',
> needed by 'arch/x86/kvm/kvm.o'.  Stop.
>      make[1]: *** [scripts/Makefile.build:550: arch/x86/kvm] Error 2
>      make: *** [Makefile:1831: arch/x86] Error 2
>
> The directory `arch/x86/kvm/XXX` is created somehow.
>
> Is that expected? Do you know what is going on? I wasn’t able to
> reproduce this with other variables like `SND_HDA` for example.
>
>
> Kind regards,
>
> Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Set environment variable `KVM` makes build fail
  2022-02-13  8:07 ` Zhouyi Zhou
@ 2022-02-13  9:45   ` Paul Menzel
  2022-02-13 14:43     ` Paul E. McKenney
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Menzel @ 2022-02-13  9:45 UTC (permalink / raw)
  To: Zhouyi Zhou
  Cc: Paolo Bonzini, kvm, Masahiro Yamada, Michal Marek, linux-kbuild,
	linux-kernel, rcu, Paul E. McKenney

Dear Zhouyi,


Am 13.02.22 um 09:07 schrieb Zhouyi Zhou:, and

> Thank you for your trust in me.

Thank you for your help.

> I think the following patch has a good explanation of what happened ;-)
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/tools/testing/selftests/rcutorture/bin/torture.sh?id=a7d89cfb8e1269cb6d22453adba56b8d0218589f
> "The torture-test scripting's long-standing use of KVM as the
> environment variable tracking the pathname of the rcutorture directory
> now conflicts with allmodconfig builds due to the
> virt/kvm/Makefile.kvm file's use of this as a makefile variable"

Indeed. In my script I had added the remote for the rcu git archive, but 
forgot to actually fetch the objects and refs, and missed the error 
message in the output.

Sorry for the noise, though the variable name should probably 
namespaced, as at least for the name `KVM` the chance are higher (still 
very small) that it’s set in the environment.


Kind regards,

Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Set environment variable `KVM` makes build fail
  2022-02-13  9:45   ` Paul Menzel
@ 2022-02-13 14:43     ` Paul E. McKenney
  0 siblings, 0 replies; 4+ messages in thread
From: Paul E. McKenney @ 2022-02-13 14:43 UTC (permalink / raw)
  To: Paul Menzel
  Cc: Zhouyi Zhou, Paolo Bonzini, kvm, Masahiro Yamada, Michal Marek,
	linux-kbuild, linux-kernel, rcu

On Sun, Feb 13, 2022 at 10:45:11AM +0100, Paul Menzel wrote:
> Dear Zhouyi,
> 
> 
> Am 13.02.22 um 09:07 schrieb Zhouyi Zhou:, and
> 
> > Thank you for your trust in me.
> 
> Thank you for your help.
> 
> > I think the following patch has a good explanation of what happened ;-)
> > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/tools/testing/selftests/rcutorture/bin/torture.sh?id=a7d89cfb8e1269cb6d22453adba56b8d0218589f
> > "The torture-test scripting's long-standing use of KVM as the
> > environment variable tracking the pathname of the rcutorture directory
> > now conflicts with allmodconfig builds due to the
> > virt/kvm/Makefile.kvm file's use of this as a makefile variable"
> 
> Indeed. In my script I had added the remote for the rcu git archive, but
> forgot to actually fetch the objects and refs, and missed the error message
> in the output.
> 
> Sorry for the noise, though the variable name should probably namespaced, as
> at least for the name `KVM` the chance are higher (still very small) that
> it’s set in the environment.

In -rcu and -next, it is now named "RCUTORTURE".  But if there are
other rcutorture environment variables in need of namespacing, please
let me know.

							Thanx, Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-13 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-13  6:03 Set environment variable `KVM` makes build fail Paul Menzel
2022-02-13  8:07 ` Zhouyi Zhou
2022-02-13  9:45   ` Paul Menzel
2022-02-13 14:43     ` Paul E. McKenney

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®