Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/pkg-generic.mk: fix rule order for re{install, build, configure}
Date: Sun, 12 Feb 2023 10:42:05 +0100	[thread overview]
Message-ID: <20230212094205.GK2796@scaer> (raw)
In-Reply-To: <20221018034605.800593-1-james.hilliard1@gmail.com>

James, All,

Thanks again for working on such grunt work, it's much appreaciated!

On 2022-10-17 21:46 -0600, James Hilliard spake thusly:
> These command rely on the clean operations being first so that the
> stamp files being deleted will rebuild the targets.
> 
> The execution ordering of the clean and rebuild operations may
> change, for example if --shuffle=reversed is set.
> 
> To ensure the evaluation order is always correct use double colon
> rules to make the evaluation order explicit as per make docs:
> 
> The double-colon rules for a target are executed in the order they
> appear in the makefile.

I am not convinced that we should switch over to using double-colons.

As I reviewed your other related patch about legal-info [0], the make
manual [1] suggests that double-colons are rally intended for cases
where "the method used to update a target differs depending on which
prerequisite files caused the update" and "double-colon rules really
make sense are those where the order of executing the recipes would not
matter".

So, we'd use a mechanism where order should not matter, to solve an
issue with ordering. That'd be weird...

Yes, the manual states that "double-colon rules for a target are
executed in the order they appear in the makefile", but that really
looks like a side-effect of another goal.

Also, we'd need to carefully review all our Makefile to ensure that
there are no other cases wehre ordering of prerequisites matter. We'd
also have to be careful every time we introduce a new rule and remember
to check whether it depends on the ordering prereauisites or not, adn
worse yet, also whether we can afford the rule to be parallel-safe or
not (see the explanation for that in the legal-info review).

Having colons and double-colons is going to be quite a headache... We
already have issues with remembering that we need to use $$ to expand
variables in some places, and the rules there are relatively clean and
explicit, but for the :: case, I'm afraid that's going to be a bit more
complex.

We currently have a single location where we use double-colon:
    support/kconfig/Makefile.br

which is added by our patch against kconfig:
    support/kconfig/patches/10-br-build-system.patch

which dates back to 2010:
    7c524dd0b683 Clean up our patches against kconfig

which got in three in 2007:
    a665ed34960b - pull kconfig from linux-2.6.21.5

So, I'd like that we get another way to fix that, if possible...

Again, thanks a lot for spending efforts in that area, this is really
great!

[0] https://lore.kernel.org/buildroot/20230212091914.GJ2796@scaer/
[1] https://www.gnu.org/software/make/manual/make.html#Double_002dColon

Regards,
Yann E. MORIN.

> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>  package/pkg-generic.mk | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index f24e03a325..6cb461af90 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -1057,17 +1057,20 @@ endif
>  			rm -f $$($(2)_TARGET_INSTALL_IMAGES)
>  			rm -f $$($(2)_TARGET_INSTALL_HOST)
>  
> -$(1)-reinstall:		$(1)-clean-for-reinstall $(1)
> +$(1)-reinstall::		$(1)-clean-for-reinstall
> +$(1)-reinstall::		$(1)
>  
>  $(1)-clean-for-rebuild: $(1)-clean-for-reinstall
>  			rm -f $$($(2)_TARGET_BUILD)
>  
> -$(1)-rebuild:		$(1)-clean-for-rebuild $(1)
> +$(1)-rebuild::		$(1)-clean-for-rebuild
> +$(1)-rebuild::		$(1)
>  
>  $(1)-clean-for-reconfigure: $(1)-clean-for-rebuild
>  			rm -f $$($(2)_TARGET_CONFIGURE)
>  
> -$(1)-reconfigure:	$(1)-clean-for-reconfigure $(1)
> +$(1)-reconfigure::	$(1)-clean-for-reconfigure
> +$(1)-reconfigure::	$(1)
>  
>  # define the PKG variable for all targets, containing the
>  # uppercase package variable prefix
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2023-02-12  9:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18  3:46 [Buildroot] [PATCH 1/1] package/pkg-generic.mk: fix rule order for re{install, build, configure} James Hilliard
2023-01-09 22:07 ` Charles Hardin
2023-02-12  9:42 ` Yann E. MORIN [this message]
2023-02-12 10:02   ` James Hilliard
2023-02-12 10:11     ` Yann E. MORIN
2023-02-12 10:22       ` James Hilliard
2023-02-12 10:57         ` Yann E. MORIN
2023-02-12 11:17           ` James Hilliard
2023-02-14 21:22   ` Arnout Vandecappelle
2023-02-14 21:24     ` Arnout Vandecappelle
2023-07-13 22:33       ` James Hilliard
2023-10-01 16:05 ` Arnout Vandecappelle via buildroot
2023-10-13 14:41   ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230212094205.GK2796@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=james.hilliard1@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox