diff mbox

Regression in "kbuild: fix if_change and friends to consider argument order"

Message ID 57569ACC.8050503@suse.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Michal Marek June 7, 2016, 9:58 a.m. UTC
On 2016-06-07 11:38, Michal Marek wrote:
> On 2016-06-07 03:38, Zanoni, Paulo R wrote:
>> Hi
>>
>> I recently noticed that alternating between "make" and "make targz-pkg"
>> rebuilds the whole Kernel. This was not happening before. As a Kernel
>> developer, my build/install/test environment heavily relies on the fact
>> that "make targz-pkg" only quickly generates the tarball if everything
>> is already built, so this change is heavily impacting my development
>> environment.
>>
>> I did some bisection and concluded that the first bad commit is:
>>
>> commit 9c8fa9bc08f60ac657751daba9fccf828a36cfed
>> Author: Masahiro Yamada
>> Date:   Sat May 7 15:48:26 2016 +0900
>>     kbuild: fix if_change and friends to consider argument order
>>
>> I also verified that if I just revert this commit on top of the
>> most recent tree it goes back to the usual behavior.
>>
>> I read the commit message and it seems that some unneeded rebuilds are
>> somewhat expected, but I can't understand why such a change in the
>> command line like the one I did triggers everything to be rebuilt.
>> IMHO, it really shouldn't. I also wonder that maybe the regression I'm
>> experiencing was not expected in the original change, so maybe there's
>> a way to keep the original improvement caused by the mentioned patch
>> without the regression I'm experiencing.
>>
>> How to reproduce (exact commands I used at every bisect step):
>>
>> $ make tinyconfig
>> $ time make -j4 V=2 # this should build things
>> $ time make -j4 V=2 # just to make sure nothing will be rebuilt
>> $ time make -j4 V=2 targz-pkg
> 
> I can reproduce it.

Try the attached patch.

Michal

Comments

Masahiro Yamada June 7, 2016, 10:03 a.m. UTC | #1
2016-06-07 18:58 GMT+09:00 Michal Marek <mmarek@suse.cz>:
> On 2016-06-07 11:38, Michal Marek wrote:
>> On 2016-06-07 03:38, Zanoni, Paulo R wrote:
>>> Hi
>>>
>>> I recently noticed that alternating between "make" and "make targz-pkg"
>>> rebuilds the whole Kernel. This was not happening before. As a Kernel
>>> developer, my build/install/test environment heavily relies on the fact
>>> that "make targz-pkg" only quickly generates the tarball if everything
>>> is already built, so this change is heavily impacting my development
>>> environment.
>>>
>>> I did some bisection and concluded that the first bad commit is:
>>>
>>> commit 9c8fa9bc08f60ac657751daba9fccf828a36cfed
>>> Author: Masahiro Yamada
>>> Date:   Sat May 7 15:48:26 2016 +0900
>>>     kbuild: fix if_change and friends to consider argument order
>>>
>>> I also verified that if I just revert this commit on top of the
>>> most recent tree it goes back to the usual behavior.
>>>
>>> I read the commit message and it seems that some unneeded rebuilds are
>>> somewhat expected, but I can't understand why such a change in the
>>> command line like the one I did triggers everything to be rebuilt.
>>> IMHO, it really shouldn't. I also wonder that maybe the regression I'm
>>> experiencing was not expected in the original change, so maybe there's
>>> a way to keep the original improvement caused by the mentioned patch
>>> without the regression I'm experiencing.
>>>
>>> How to reproduce (exact commands I used at every bisect step):
>>>
>>> $ make tinyconfig
>>> $ time make -j4 V=2 # this should build things
>>> $ time make -j4 V=2 # just to make sure nothing will be rebuilt
>>> $ time make -j4 V=2 targz-pkg
>>
>> I can reproduce it.
>
> Try the attached patch.
>
> Michal
>


Right.

I had already sent a similar patch.
https://patchwork.kernel.org/patch/9159863/

My concern is it is effectively
reverting e8f5bdb02ce0.
I hope Rik can comment on that.
Michal Marek June 7, 2016, 10:48 a.m. UTC | #2
On 2016-06-07 12:03, Masahiro Yamada wrote:
> 2016-06-07 18:58 GMT+09:00 Michal Marek <mmarek@suse.cz>:
>> On 2016-06-07 11:38, Michal Marek wrote:
>>> On 2016-06-07 03:38, Zanoni, Paulo R wrote:
>>>> Hi
>>>>
>>>> I recently noticed that alternating between "make" and "make targz-pkg"
>>>> rebuilds the whole Kernel. This was not happening before. As a Kernel
>>>> developer, my build/install/test environment heavily relies on the fact
>>>> that "make targz-pkg" only quickly generates the tarball if everything
>>>> is already built, so this change is heavily impacting my development
>>>> environment.
>>>>
>>>> I did some bisection and concluded that the first bad commit is:
>>>>
>>>> commit 9c8fa9bc08f60ac657751daba9fccf828a36cfed
>>>> Author: Masahiro Yamada
>>>> Date:   Sat May 7 15:48:26 2016 +0900
>>>>     kbuild: fix if_change and friends to consider argument order
>>>>
>>>> I also verified that if I just revert this commit on top of the
>>>> most recent tree it goes back to the usual behavior.
>>>>
>>>> I read the commit message and it seems that some unneeded rebuilds are
>>>> somewhat expected, but I can't understand why such a change in the
>>>> command line like the one I did triggers everything to be rebuilt.
>>>> IMHO, it really shouldn't. I also wonder that maybe the regression I'm
>>>> experiencing was not expected in the original change, so maybe there's
>>>> a way to keep the original improvement caused by the mentioned patch
>>>> without the regression I'm experiencing.
>>>>
>>>> How to reproduce (exact commands I used at every bisect step):
>>>>
>>>> $ make tinyconfig
>>>> $ time make -j4 V=2 # this should build things
>>>> $ time make -j4 V=2 # just to make sure nothing will be rebuilt
>>>> $ time make -j4 V=2 targz-pkg
>>>
>>> I can reproduce it.
>>
>> Try the attached patch.
>>
>> Michal
>>
> 
> 
> Right.
> 
> I had already sent a similar patch.
> https://patchwork.kernel.org/patch/9159863/

I see. I hadn't read all my mail before replying.


> My concern is it is effectively
> reverting e8f5bdb02ce0.
> I hope Rik can comment on that.

My patch just resets NOSTDINC_FLAGS before including the arch Makefile.

Michal

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Masahiro Yamada June 7, 2016, 11:29 a.m. UTC | #3
2016-06-07 19:48 GMT+09:00 Michal Marek <mmarek@suse.cz>:
> On 2016-06-07 12:03, Masahiro Yamada wrote:
>> 2016-06-07 18:58 GMT+09:00 Michal Marek <mmarek@suse.cz>:
>>> On 2016-06-07 11:38, Michal Marek wrote:
>>>> On 2016-06-07 03:38, Zanoni, Paulo R wrote:
>>>>> Hi
>>>>>
>>>>> I recently noticed that alternating between "make" and "make targz-pkg"
>>>>> rebuilds the whole Kernel. This was not happening before. As a Kernel
>>>>> developer, my build/install/test environment heavily relies on the fact
>>>>> that "make targz-pkg" only quickly generates the tarball if everything
>>>>> is already built, so this change is heavily impacting my development
>>>>> environment.
>>>>>
>>>>> I did some bisection and concluded that the first bad commit is:
>>>>>
>>>>> commit 9c8fa9bc08f60ac657751daba9fccf828a36cfed
>>>>> Author: Masahiro Yamada
>>>>> Date:   Sat May 7 15:48:26 2016 +0900
>>>>>     kbuild: fix if_change and friends to consider argument order
>>>>>
>>>>> I also verified that if I just revert this commit on top of the
>>>>> most recent tree it goes back to the usual behavior.
>>>>>
>>>>> I read the commit message and it seems that some unneeded rebuilds are
>>>>> somewhat expected, but I can't understand why such a change in the
>>>>> command line like the one I did triggers everything to be rebuilt.
>>>>> IMHO, it really shouldn't. I also wonder that maybe the regression I'm
>>>>> experiencing was not expected in the original change, so maybe there's
>>>>> a way to keep the original improvement caused by the mentioned patch
>>>>> without the regression I'm experiencing.
>>>>>
>>>>> How to reproduce (exact commands I used at every bisect step):
>>>>>
>>>>> $ make tinyconfig
>>>>> $ time make -j4 V=2 # this should build things
>>>>> $ time make -j4 V=2 # just to make sure nothing will be rebuilt
>>>>> $ time make -j4 V=2 targz-pkg
>>>>
>>>> I can reproduce it.
>>>
>>> Try the attached patch.
>>>
>>> Michal
>>>
>>
>>
>> Right.
>>
>> I had already sent a similar patch.
>> https://patchwork.kernel.org/patch/9159863/
>
> I see. I hadn't read all my mail before replying.
>
>
>> My concern is it is effectively
>> reverting e8f5bdb02ce0.
>> I hope Rik can comment on that.
>
> My patch just resets NOSTDINC_FLAGS before including the arch Makefile.
>

Ah, I missed that, sorry.

Then, yours should be no problem.
diff mbox

Patch

From 86536cfcd776b5d9e238a4690756028799122a86 Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.com>
Date: Tue, 7 Jun 2016 11:57:02 +0200
Subject: [PATCH] kbuild: Initialize NOSTDINC_CFLAGS

The variable is exported, so it needs to be cleared to avoid duplicating
its content when running make from within make (e.g. in the packaging
targets).

Signed-off-by: Michal Marek <mmarek@suse.com>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 0f9cb36d45c2..1a85efa216ac 100644
--- a/Makefile
+++ b/Makefile
@@ -359,6 +359,7 @@  CHECK		= sparse
 
 CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
 		  -Wbitwise -Wno-return-void $(CF)
+NOSTDINC_FLAGS  =
 CFLAGS_MODULE   =
 AFLAGS_MODULE   =
 LDFLAGS_MODULE  =
-- 
2.6.2