Skip to contentSkip to conversation

package/pkg-generic.mk: fix typo in make target .stamp_built

PATCH Applied Bernd Kuhls 4 participants 9 messages Aug 18, 2023 – Aug 7, 2024 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/pkg-generic.mk: fix typo in make target .stamp_built

This fix can be backported because the offending line was added in 2009.

---
 package/pkg-generic.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-generic.mk +1 -1
index 5d1c1da128..9d40754939 100644
@@ -286,7 +286,7 @@ $(BUILD_DIR)/%/.stamp_configured:
 	$(Q)touch $@
 
 # Build
-$(BUILD_DIR)/%/.stamp_built::
+$(BUILD_DIR)/%/.stamp_built:
 	@$(call step_start,build)
 	@$(call MESSAGE,"Building")
 	$(foreach hook,$($(PKG)_PRE_BUILD_HOOKS),$(call $(hook))$(sep))
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 12 lines · On Fri, 18 Aug 2023 17:16:08 +0200 Bernd Kuhls <[email protected]> wrote:

This fix can be backported because the offending line was added in 2009.

---
 package/pkg-generic.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-generic.mk +0 -0
index 5d1c1da128..9d40754939 100644

package/pkg-generic.mk $(BUILD_DIR)/%/.stamp_configured: · line 289

Quoted 5 lines
package/pkg-generic.mk +1 -1
@@ -286,7 +286,7 @@ $(BUILD_DIR)/%/.stamp_configured:
 	$(Q)touch $@
 
 # Build
-$(BUILD_DIR)/%/.stamp_built::
+$(BUILD_DIR)/%/.stamp_built:

Note that double colon rules have a specific meaning in make:

https://www.gnu.org/software/make/manual/html_node/Double_002dColon.html

I've read a few times the page, but I'm not sure I fully grasp what it says, so I don't know if the double colon was intended (and needed at the time) or was a typo.

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

On 2023-08-18 22:03 +0200, Thomas Petazzoni via buildroot spake thusly:

Quoted 4 lines
Quoted 1 line · On Fri, 18 Aug 2023 17:16:08 +0200 Bernd Kuhls <[email protected]> wrote:

This fix can be backported because the offending line was added in 2009.

What is actualy broken?

As you noticed, the does has been there for moer than 14 years now, so if something obvious was broken, we'd have notriced by now.

So, if this is broken, it is not obvious, and we need to udnerstand how it is broken and why the fix is correct.

Regards,
Yann E. MORIN.

Quoted 33 lines
Quoted 10 lines
---
 package/pkg-generic.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-generic.mk +0 -0
index 5d1c1da128..9d40754939 100644

package/pkg-generic.mk $(BUILD_DIR)/%/.stamp_configured: · line 289

Quoted 5 lines
package/pkg-generic.mk +1 -1
@@ -286,7 +286,7 @@ $(BUILD_DIR)/%/.stamp_configured:
 	$(Q)touch $@
 
 # Build
-$(BUILD_DIR)/%/.stamp_built::
+$(BUILD_DIR)/%/.stamp_built:

Note that double colon rules have a specific meaning in make:

https://www.gnu.org/software/make/manual/html_node/Double_002dColon.html

I've read a few times the page, but I'm not sure I fully grasp what it says, so I don't know if the double colon was intended (and needed at the time) or was a typo.

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw
Quoted 6 lines · On Fri, 18 Aug 2023 22:24:34 +0200 "Yann E. MORIN" <[email protected]>…

On 2023-08-18 22:03 +0200, Thomas Petazzoni via buildroot spake thusly:

Quoted 4 lines
Quoted 1 line · On Fri, 18 Aug 2023 17:16:08 +0200 Bernd Kuhls <[email protected]> wrote:

This fix can be backported because the offending line was added in 2009.

Quoted 7 lines

What is actualy broken?

As you noticed, the does has been there for moer than 14 years now, so if something obvious was broken, we'd have notriced by now.

So, if this is broken, it is not obvious, and we need to udnerstand how it is broken and why the fix is correct.

I don't think Bernd claimed anywhere that something is broken. He claims there is a typo. I've also seen this double colon several times, and it isn't consistent across the other similar make targets, and I always wondered if it was needed or not. If it is not needed, we should remove it to make this rule consistent with others. If it's needed, it should be explained in a comment above it because it's not obvious what's going on.

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Thomas, All,

On 2023-08-18 22:44 +0200, Thomas Petazzoni via buildroot spake thusly:

Quoted 6 lines
Quoted 4 lines · On Fri, 18 Aug 2023 22:24:34 +0200 "Yann E. MORIN" <[email protected]>…

On 2023-08-18 22:03 +0200, Thomas Petazzoni via buildroot spake thusly:

Quoted 3 lines

On Fri, 18 Aug 2023 17:16:08 +0200
Bernd Kuhls <[email protected]> wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line

This fix can be backported because the offending line was added in 2009.

What is actualy broken?
As you noticed, the does has been there for moer than 14 years now, so if something obvious was broken, we'd have notriced by now. So, if this is broken, it is not obvious, and we need to udnerstand how it is broken and why the fix is correct.

I don't think Bernd claimed anywhere that something is broken.

Right. But if that had just been a typo, then that would have been invalid Makefile syntax, which it obviously is not, as this code does not trigger an error from make.

So it is not a typo (so, see below).

Quoted 7 lines

He
claims there is a typo. I've also seen this double colon several times, and it isn't consistent across the other similar make targets, and I always wondered if it was needed or not. If it is not needed, we should remove it to make this rule consistent with others. If it's needed, it should be explained in a comment above it because it's not obvious what's going on.

Exactly.

You expressed the same reasoning I was trying to convey, but which I failed to express properly.

But I agree that either wway, needed or not, the explanations are going to be... difficult to come up with, too.

As an aside, we use that :: construct in one other place:

    support/kconfig/Makefile.br:42:$(obj)/%:: $(src)/%_shipped 

which is something we inherited from the 2.6.21.5 kernel in a665ed34960bf1423cba303276161bf44a9851f4... No need to fix that one.

Regards,
Yann E. MORIN.

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

A message that is not in the archive (sent off-list or not yet received): 20230818220314.3178c964__25218.2109326654$1692389025$gmane$org@windsurf

#6 lore raw

Hi Thomas,

Am Fri, 18 Aug 2023 22:03:14 +0200 schrieb Thomas Petazzoni via buildroot:

Quoted 1 line

Note that double colon rules have a specific meaning in make:

ah, I did not know that.

Quoted 2 lines

so I don't know if the double colon was intended (and needed at the time) or was a typo.

Digging further into what first appeared to me as a typo I found your commit adding the double colon to package/Makefile.package.in:
https://git.buildroot.net/buildroot/commit/package?
id=e11fe847b2f545446fc3300dd2ba88fd5da05756

At that time there was another file, package/Makefile.autotools.in, which also included a "$(BUILD_DIR)/%/.stamp_built:" single-colon target:
https://git.buildroot.net/buildroot/tree/package/Makefile.autotools.in?
id=e11fe847b2f545446fc3300dd2ba88fd5da05756#n264

Today only one file, package/pkg-generic.mk, contains a .stamp_built target.

Maybe, I am only guessing, the double colon was necessary back then, due to two Makefiles containing the same target, and lost their justification when the single-colon target "$(BUILD_DIR)/%/.stamp_built:" was removed with commit https://git.buildroot.net/buildroot/commit/?
id=d8b55b99095e5eed46d2b95bdaab2e69ccbd7170

Regards, Bernd

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#7 lore raw
Quoted 10 lines · On Fri, 18 Aug 2023 22:47:15 +0200 Bernd Kuhls <[email protected]> wrote:

Digging further into what first appeared to me as a typo I found your commit adding the double colon to package/Makefile.package.in:
https://git.buildroot.net/buildroot/commit/package?
id=e11fe847b2f545446fc3300dd2ba88fd5da05756

At that time there was another file, package/Makefile.autotools.in, which also included a "$(BUILD_DIR)/%/.stamp_built:" single-colon target:
https://git.buildroot.net/buildroot/tree/package/Makefile.autotools.in?
id=e11fe847b2f545446fc3300dd2ba88fd5da05756#n264

Quoted 8 lines

Today only one file, package/pkg-generic.mk, contains a .stamp_built target.

Maybe, I am only guessing, the double colon was necessary back then, due to two Makefiles containing the same target, and lost their justification when the single-colon target "$(BUILD_DIR)/%/.stamp_built:" was removed with commit https://git.buildroot.net/buildroot/commit/?
id=d8b55b99095e5eed46d2b95bdaab2e69ccbd7170

Thanks for the additional research. However, I don't think your explanation that the double colon was necessary back then because there was a $(BUILD_DIR)/%/.stamp_built rule in package/Makefile.package.in and another one in package/Makefile.autotools.in really makes sense:
this was also the case for all the other $(BUILD_DIR)/%/.stamp_<something> rules, and only the .stamp_built one had this double colon added.

I can really only think about this really being a typo.

Here is a highly convincing explanation: up to a few days ago before you sent this patch, I had no idea what this "double colon" was doing exactly. And I really doubt that back in 2009 when I contributed this change I had a much better idea about it. So I don't see how it could have been intentional from me, and therefore I believe it indeed is a typo. I looked up the history of this patch, and it was posted only once to the mailing list by me, I then did a pull request to Peter, who merged the whole thing. So there was no particular discussion about this double colon.

So, unless Yann disagrees, I think I'm going to apply Bernd's patch with a slightly more detailed explanation.

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#8 lore raw
In reply to Bernd Kuhls
Quoted 3 lines · Bernd Kuhls

This fix can be backported because the offending line was added in 2009.

Applied to master with a slightly more extended commit message, thanks.

Regards,
Arnout

Quoted 9 lines
---
  package/pkg-generic.mk | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-generic.mk +0 -0
index 5d1c1da128..9d40754939 100644

package/pkg-generic.mk $(BUILD_DIR)/%/.stamp_configured: · line 292

Quoted 8 lines
package/pkg-generic.mk +1 -1
@@ -286,7 +286,7 @@ $(BUILD_DIR)/%/.stamp_configured:
  	$(Q)touch $@
 
  # Build
-$(BUILD_DIR)/%/.stamp_built::
+$(BUILD_DIR)/%/.stamp_built:
  	@$(call step_start,build)
  	@$(call MESSAGE,"Building")
  	$(foreach hook,$($(PKG)_PRE_BUILD_HOOKS),$(call $(hook))$(sep))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#9 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle via buildroot <[email protected]> writes:

Quoted 2 lines · Bernd Kuhls

This fix can be backported because the offending line was added in 2009.

Applied to master with a slightly more extended commit message, thanks.

Committed to 2024.02.x and 2024.05.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot