Re: Unfortunate infinite make recursion

Previous thread: [RFC PATCH] 2.6.22.6 user-mode linux: before abort, we make it sure all children quit by lepton on Saturday, September 22, 2007 - 4:01 am. (2 messages)

Next thread: 2.6.23-rc7 regression: psmouse section conflict on alpha by Meelis Roos on Saturday, September 22, 2007 - 8:48 am. (1 message)
To: <sam@...>, <zippel@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>
Date: Saturday, September 22, 2007 - 7:24 am

Hi,

You can cause a recursion in kbuild/make with the following:

make O=$PWD kernel/time.o
make mrproper

Of course no one would use O=$PWD (that's just the testcase),
but this happened too often:

/ws/linux/linux-2.6.23$ make O=/ws/linux/linux-2.6.23 kernel/time.o
(Oops - should have been O=/ws/linux/obj-2.6.23!)

The make O=$PWD truncates the Makefile, making it necessary to run `git
checkout Makefile` - should you have git; or reextract the tarball
(should you /still/ have it). Well, can we catch this case somehow?

thanks,
Jan
-

To: Jan Engelhardt <jengelh@...>
Cc: <zippel@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Saturday, September 22, 2007 - 4:52 pm

Does the following patch fix it at your end?
Seems to work for me.

Sam

diff --git a/Makefile b/Makefile
index 6708e41..f787b05 100644
--- a/Makefile
+++ b/Makefile
@@ -115,7 +115,9 @@ saved-output := $(KBUILD_OUTPUT)
KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
$(if $(KBUILD_OUTPUT),, \
$(error output directory "$(saved-output)" does not exist))
-
+# Check the OUTPUT directory is not the same as where we have kernel src
+$(if $(filter-out $(KBUILD_OUTPUT),$(shell /bin/pwd)),, \
+ $(error Output directory (O=...) specify kernel src dir))
PHONY += $(MAKECMDGOALS)

$(filter-out _all,$(MAKECMDGOALS)) _all:

-

To: Sam Ravnborg <sam@...>
Cc: <zippel@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Sunday, September 23, 2007 - 2:17 am

-

To: Jan Engelhardt <jengelh@...>
Cc: <sam@...>, <zippel@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Saturday, September 22, 2007 - 11:42 am

* Sat, 22 Sep 2007 13:24:32 +0200 (CEST)

Read-only source-tree for kbuild user, end of question. By current kbuild
one can garbage source by various means. Read-write for quilt, git and
editor users.
____
-

To: Oleg Verych <olecom@...>
Cc: Jan Engelhardt <jengelh@...>, <zippel@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Saturday, September 22, 2007 - 4:40 pm

Please Oleg.
You know very well that most people will not have their kernel src RO.

Sam
-

To: Sam Ravnborg <sam@...>
Cc: Jan Engelhardt <jengelh@...>, <zippel@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Saturday, September 22, 2007 - 6:23 pm

Sure, if it will be not comfortable.

But if kbuild deals with this transparently, it must be OK. Brokenness
due to binutils, kbuild, root user bugs won't garbage source. Only thing
to ask from experienced users *and* kernel developers, is
`useradd kbuild`, everything else will not bother anybody.

I just express my vision, of course. But see, i can't play with kernel
sources error-free now. If i type some `make` somewhere in obj or src
tree, i need to know, that vanilla source stays so in any circumstances.
Currently it's not.

It is about making things in order on my working place (not looking to be
in order, though :). Not thinking every time, if something fscked sources,
saves my and time of diff/patch. Experimenting/testing/finding fixes with
small amount of in-development sources in obj tree, also very helpful.
____
-

To: Oleg Verych <olecom@...>
Cc: Jan Engelhardt <jengelh@...>, <zippel@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Sunday, September 23, 2007 - 2:03 am

Better would be to fix the bugs where we today clobber the sources.
Care to point out the exact cases you see.

Sam
-

To: Sam Ravnborg <sam@...>
Cc: Jan Engelhardt <jengelh@...>, <zippel@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Sunday, September 23, 2007 - 3:37 am

It is not about particular case, it is about whole environment.

* interactive:
shell (profile setup).--> source editing / patching
`-> building parts / doing tests

where profile is one particular source tree with particular
config/development goals. On multiple terminals (sessions), one
may just type in favorite shell `wana profile-xx` and environment
is set up there. I.e.

+ where ever you are, it's easy to go to current obj or src tree,
+ quilt knows its setup
+ kbuild does also
+ tracking files, sent to editor (e.g. emacsclient / emacsserver)
o easily composing file / change sets to be operated by quilt
o kbuild knows exactly what to check and possibly to rebuild
+ all actions are written to history, that can be imported into any session
o saving sessions
o restore sessions: checking profile consistency / updating
+ less ugly (e.g. just stupid bash command line) user interface
o even ordinary command line can be improved much-much more in
terms of efficiency and comfort
o more nice-looking information of what is happening and how is
happening

* automatic:
running setup of selected profiles:
o patch/update sources
o configure and (cross) build multiple source trees with multiple output
trees each.
o run time testing: emulators, hardware.

Many ideas, collected in kbuild-2.5-history.tar.bz2 back in 2000, are
still interesting and useful.

More i do development, more i realize, that i spend too much time to
do trivial and repeating things. And this time will not go less, if
something like that will be by hand.

I'd really like to see a work flow of best development staff, because
behind patches i can not see anything. And frankly, i doubt there's
anything significant there. The only sharing of tools i can see is
patch scripts (now quilt), diff-tools, linux/scripts. Still just tools.

There's no environment, where peo...

Previous thread: [RFC PATCH] 2.6.22.6 user-mode linux: before abort, we make it sure all children quit by lepton on Saturday, September 22, 2007 - 4:01 am. (2 messages)

Next thread: 2.6.23-rc7 regression: psmouse section conflict on alpha by Meelis Roos on Saturday, September 22, 2007 - 8:48 am. (1 message)