Do not rebuild full kernel tree again and again...
PATCH 1/1 Do not rebuild full kernel tree again and again...
Hello,
I've returned back to the computer after month and half, and I've found that
I cannot reasonably build kernel - just repeating 'make' twice without doing any change forced full rebuild of everything, which as far as I can tell is not intended behavior. As I did not notice this being reported on the LKML, and 2.6.16-rc6 still suffers from this problem, here comes report + patch.
Problem seems to be that new make includes FORCE prerequisite in $? - apparently
new make treats $? not as 'prerequisities newer than target', but as 'prerequisities newer than target or missing'. Due to this $(if) in make rules always succeeded as it always received at least 'FORCE', and 'FORCE' is not an empty string. So let's filter out 'FORCE' from $? - unless somebody can confirm that make 3.81 is broken and unusable for kernel...
Thanks,
Petr Vandrovec
ppc:~# make -v GNU Make 3.81rc1 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This program built for i486-pc-linux-gnu
ppc:~# dpkg -l make Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-===============-=====================-============================================ ii make 3.80+3.81.rc1-1 The GNU version of the "make" utility. ppc:~#
scripts/Kbuild.include +3 -3
@@ -79,7 +79,7 @@ # >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file # note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars # -if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ +if_changed = $(if $(strip $(filter-out FORCE,$?) $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ @set -e; \ $(echo-cmd) \ $(cmd_$(1)); \
@@ -87,7 +87,7 @@ # execute the command and also postprocess generated .d dependencies # file -if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ +if_changed_dep = $(if $(strip $(filter-out FORCE,$? $(filter-out $(wildcard $^),$^))\ $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ @set -e; \ $(echo-cmd) \
@@ -99,6 +99,6 @@ # Usage: $(call if_changed_rule,foo) # will check if $(cmd_foo) changed, or any of the prequisites changed, # and if so will execute $(rule_foo) -if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\ +if_changed_rule = $(if $(strip $(filter-out FORCE,$?) $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\ @set -e; \ $(rule_$(1)))
Quoted 7 lines · Petr Vandrovec
Hello,
I've returned back to the computer after month and half, and I've found that
I cannot reasonably build kernel - just repeating 'make' twice without doing any change forced full rebuild of everything, which as far as I can tell is not intended behavior. As I did not notice this being reported on the LKML, and 2.6.16-rc6 still suffers from this problem, here comes report + patch.
Quoted 6 lines
Problem seems to be that new make includes FORCE prerequisite in $? - apparently
new make treats $? not as 'prerequisities newer than target', but as 'prerequisities newer than target or missing'. Due to this $(if) in make rules always succeeded as it always received at least 'FORCE', and 'FORCE' is not an empty string. So let's filter out 'FORCE' from $? - unless somebody can confirm that make 3.81 is broken and unusable for kernel...
This issue has been discussed with Paul D. Smith which also provided a patch similar to yours.
The patch is in the kbuild queue for 2.6.17.
But we also agreed to postpose this change in make until next stable release. So if you update your make to latest CVS version you will no longer see this misbehaviour.
And when 2.6.17 opens up kbuild will be 'fixed' in mainline kernel.
Sam
Quoted 8 lines · Sam Ravnborg
This issue has been discussed with Paul D. Smith which also provided a patch similar to yours.
The patch is in the kbuild queue for 2.6.17.
But we also agreed to postpose this change in make until next stable release. So if you update your make to latest CVS version you will no longer see this misbehaviour.
And when 2.6.17 opens up kbuild will be 'fixed' in mainline kernel.
So what's going to be done about 2.6.16?
I'm seeing this behaviour too in -rc6 and it is a bad regression for a developer. I assume there will be some workaround?
Signature · 2 lines
SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com
Quoted 11 lines · Nick Piggin
Quoted 8 lines · Sam Ravnborg
This issue has been discussed with Paul D. Smith which also provided a patch similar to yours.
The patch is in the kbuild queue for 2.6.17.
But we also agreed to postpose this change in make until next stable release. So if you update your make to latest CVS version you will no longer see this misbehaviour.
And when 2.6.17 opens up kbuild will be 'fixed' in mainline kernel.
Quoted 4 lines
So what's going to be done about 2.6.16?
I'm seeing this behaviour too in -rc6 and it is a bad regression for a developer. I assume there will be some workaround?
I assume debian soon will update make to current version from CVS that has this behaviour removed.
Sam
Quoted 14 lines · Sam Ravnborg
Quoted 12 lines · Nick Piggin
Quoted 8 lines · Sam Ravnborg
This issue has been discussed with Paul D. Smith which also provided a patch similar to yours.
The patch is in the kbuild queue for 2.6.17.
But we also agreed to postpose this change in make until next stable release. So if you update your make to latest CVS version you will no longer see this misbehaviour.
And when 2.6.17 opens up kbuild will be 'fixed' in mainline kernel.
Quoted 8 lines
Quoted 4 lines
So what's going to be done about 2.6.16?
I'm seeing this behaviour too in -rc6 and it is a bad regression for a developer. I assume there will be some workaround?
I assume debian soon will update make to current version from CVS that has this behaviour removed.
So long as it just requires a tools update then that's fine for me. Thanks.
Signature · 2 lines
SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com
Quoted 8 lines · Nick Piggin
Quoted 6 lines
I'm seeing this behaviour too in -rc6 and it is a bad regression
Quoted 1 line
for a developer. I assume there will be some workaround?
I assume debian soon will update make to current version from CVS that has this behaviour removed.
So long as it just requires a tools update then that's fine for me.
I should note here that it was agreed with Paul that upcoming make relase will not have this change, but next release will have it. So 2.6.17 kbuild will take care of being forward compatible in this matter.
Sam
Quoted 9 lines · Sam Ravnborg
Quoted 8 lines · Nick Piggin
Quoted 7 lines
I'm seeing this behaviour too in -rc6 and it is a bad regression
Quoted 1 line
for a developer. I assume there will be some workaround?
I assume debian soon will update make to current version from CVS that has this behaviour removed.
Quoted 7 lines
Quoted 1 line
So long as it just requires a tools update then that's fine for me.
I should note here that it was agreed with Paul that upcoming make relase will not have this change, but next release will have it. So 2.6.17 kbuild will take care of being forward compatible in this matter.
Wouldn't it be better to have an option to tell make to assume the old behavior? I only skimmed the original thread but it didn't seem terribly complex thing to do. A LOT of people will be doing things on pre-2.6.17 kernel for quite some time and they will be cursing a lot if they have to rebuild everything everytime.
Thanks.
Signature · 1 line
tejun
On Fri, Mar 17, 2006 at 03:31:06AM +0900, Tejun Heo wrote:
Wouldn't it be better to have an option to tell make to assume the old
Quoted 4 lines
behavior? I only skimmed the original thread but it didn't seem terribly complex thing to do. A LOT of people will be doing things on pre-2.6.17 kernel for quite some time and they will be cursing a lot if they have to rebuild everything everytime.
If Paul planned for a new make relase this year - then yes. But I assume it will take another year (almost) before next make realse after the current 3.81. And then it should not matter much.
Sam
Quoted 10 lines · Sam Ravnborg
On Fri, Mar 17, 2006 at 03:31:06AM +0900, Tejun Heo wrote:
Wouldn't it be better to have an option to tell make to assume the oldQuoted 1 line
behavior? I only skimmed the original thread but it didn't seem terribly complex thing to do. A LOT of people will be doing things on pre-2.6.17 kernel for quite some time and they will be cursing a lot if they have to rebuild everything everytime.
If Paul planned for a new make relase this year - then yes. But I assume it will take another year (almost) before next make realse after the current 3.81. And then it should not matter much.
Fair enough for me. :-)
Signature · 1 line
tejun