diff mbox series

[1/3] Makefile: really generate glibc locales in parallel

Message ID 9796_1665746309_63494585_9796_388_2_2b0b6b796ff36967c963ba90f138a03d467ee5cf.1665746266.git.yann.morin@orange.com
State Accepted
Headers show
Series [1/3] Makefile: really generate glibc locales in parallel | expand

Commit Message

Yann E. MORIN Oct. 14, 2022, 11:18 a.m. UTC
To generate the glibc locale data, we call into a recursive Makefile,
so as to generate locales in parallel. This is done as part of a
target-fialize hook.

However, that hook is registered after all packages have been parsed,
and as such, it maye be registered after hooks defined in packages.

Furthermore, the expansion of target-finalize hooks is done in a recipe,
so it is not easy to understand whether this generates a "simple" rule
or not.

As a consequence, despite the use of $(MAKE), make may not notice that
the command is a recursive call, and will decide to close the jobserver
file-descriptors, yieldiong warnings like:
    make[2]: warning: jobserver unavailable: using -j1.  Add '+' to
    parent make rule.

This causes the lcoale data to not be generated in parallel, which is
initially all the fuss about using a sub-makefile...

So, do as suggested, and prepend the hook with a '+', so that it
isexplicit to make that it should not close its jobserver fds.

Fixes: 6fbdf5159607 (Makefile: Parallelize glibc locale generation)

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Gleb Mazovetskiy <glex.spb@gmail.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Yann E. MORIN Oct. 21, 2022, 7:07 p.m. UTC | #1
Yann, All,

On 2022-10-14 13:18 +0200, yann.morin@orange.com spake thusly:
> To generate the glibc locale data, we call into a recursive Makefile,
> so as to generate locales in parallel. This is done as part of a
> target-fialize hook.

*finalize

> However, that hook is registered after all packages have been parsed,
> and as such, it maye be registered after hooks defined in packages.
> 
> Furthermore, the expansion of target-finalize hooks is done in a recipe,
> so it is not easy to understand whether this generates a "simple" rule
> or not.
> 
> As a consequence, despite the use of $(MAKE), make may not notice that
> the command is a recursive call, and will decide to close the jobserver
> file-descriptors, yieldiong warnings like:

*yielding

>     make[2]: warning: jobserver unavailable: using -j1.  Add '+' to
>     parent make rule.
> 
> This causes the lcoale data to not be generated in parallel, which is

*locale (damn, I forgot to fix that one when applying)

> initially all the fuss about using a sub-makefile...
> 
> So, do as suggested, and prepend the hook with a '+', so that it
> isexplicit to make that it should not close its jobserver fds.

*is explicit

> Fixes: 6fbdf5159607 (Makefile: Parallelize glibc locale generation)
> 
> Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
> Cc: Gleb Mazovetskiy <glex.spb@gmail.com>

Applied to master with the typoes fixed, thanks.

Regards,
Yann E. MORIN.

> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index ec7c034ac1..ededfa491d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -653,7 +653,7 @@ ifneq ($(GLIBC_GENERATE_LOCALES),)
>  PACKAGES += host-localedef
>  
>  define GENERATE_GLIBC_LOCALES
> -	$(MAKE) -f support/misc/gen-glibc-locales.mk \
> +	+$(MAKE) -f support/misc/gen-glibc-locales.mk \
>  		ENDIAN=$(call LOWERCASE,$(BR2_ENDIAN)) \
>  		LOCALES="$(GLIBC_GENERATE_LOCALES)" \
>  		Q=$(Q)
> -- 
> 2.25.1
> 
> 
> _________________________________________________________________________________________________________________________
> 
> Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
> pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
> a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
> Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
> 
> This message and its attachments may contain confidential or privileged information that may be protected by law;
> they should not be distributed, used or copied without authorisation.
> If you have received this email in error, please notify the sender and delete this message and its attachments.
> As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
> Thank you.
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
Yann E. MORIN Oct. 21, 2022, 7:46 p.m. UTC | #2
Yann, All,

Your git send-email setup is incorrect: the From field is missing the
realname part (which is weird, as it was not missing in the previous
gpsd patches)...

Regards,
Yann E. MORIN.

On 2022-10-14 13:18 +0200, yann.morin@orange.com spake thusly:
> To generate the glibc locale data, we call into a recursive Makefile,
> so as to generate locales in parallel. This is done as part of a
> target-fialize hook.
> 
> However, that hook is registered after all packages have been parsed,
> and as such, it maye be registered after hooks defined in packages.
> 
> Furthermore, the expansion of target-finalize hooks is done in a recipe,
> so it is not easy to understand whether this generates a "simple" rule
> or not.
> 
> As a consequence, despite the use of $(MAKE), make may not notice that
> the command is a recursive call, and will decide to close the jobserver
> file-descriptors, yieldiong warnings like:
>     make[2]: warning: jobserver unavailable: using -j1.  Add '+' to
>     parent make rule.
> 
> This causes the lcoale data to not be generated in parallel, which is
> initially all the fuss about using a sub-makefile...
> 
> So, do as suggested, and prepend the hook with a '+', so that it
> isexplicit to make that it should not close its jobserver fds.
> 
> Fixes: 6fbdf5159607 (Makefile: Parallelize glibc locale generation)
> 
> Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
> Cc: Gleb Mazovetskiy <glex.spb@gmail.com>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index ec7c034ac1..ededfa491d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -653,7 +653,7 @@ ifneq ($(GLIBC_GENERATE_LOCALES),)
>  PACKAGES += host-localedef
>  
>  define GENERATE_GLIBC_LOCALES
> -	$(MAKE) -f support/misc/gen-glibc-locales.mk \
> +	+$(MAKE) -f support/misc/gen-glibc-locales.mk \
>  		ENDIAN=$(call LOWERCASE,$(BR2_ENDIAN)) \
>  		LOCALES="$(GLIBC_GENERATE_LOCALES)" \
>  		Q=$(Q)
> -- 
> 2.25.1
> 
> 
> _________________________________________________________________________________________________________________________
> 
> Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
> pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
> a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
> Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
> 
> This message and its attachments may contain confidential or privileged information that may be protected by law;
> they should not be distributed, used or copied without authorisation.
> If you have received this email in error, please notify the sender and delete this message and its attachments.
> As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
> Thank you.
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
Peter Korsgaard Nov. 3, 2022, 1:49 p.m. UTC | #3
>>>>>   <yann.morin@orange.com> writes:

 > To generate the glibc locale data, we call into a recursive Makefile,
 > so as to generate locales in parallel. This is done as part of a
 > target-fialize hook.

 > However, that hook is registered after all packages have been parsed,
 > and as such, it maye be registered after hooks defined in packages.

 > Furthermore, the expansion of target-finalize hooks is done in a recipe,
 > so it is not easy to understand whether this generates a "simple" rule
 > or not.

 > As a consequence, despite the use of $(MAKE), make may not notice that
 > the command is a recursive call, and will decide to close the jobserver
 > file-descriptors, yieldiong warnings like:
 >     make[2]: warning: jobserver unavailable: using -j1.  Add '+' to
 >     parent make rule.

 > This causes the lcoale data to not be generated in parallel, which is
 > initially all the fuss about using a sub-makefile...

 > So, do as suggested, and prepend the hook with a '+', so that it
 > isexplicit to make that it should not close its jobserver fds.

 > Fixes: 6fbdf5159607 (Makefile: Parallelize glibc locale generation)

 > Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
 > Cc: Gleb Mazovetskiy <glex.spb@gmail.com>

Committed to 2022.08.x and 2022.02.x, thanks.
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index ec7c034ac1..ededfa491d 100644
--- a/Makefile
+++ b/Makefile
@@ -653,7 +653,7 @@  ifneq ($(GLIBC_GENERATE_LOCALES),)
 PACKAGES += host-localedef
 
 define GENERATE_GLIBC_LOCALES
-	$(MAKE) -f support/misc/gen-glibc-locales.mk \
+	+$(MAKE) -f support/misc/gen-glibc-locales.mk \
 		ENDIAN=$(call LOWERCASE,$(BR2_ENDIAN)) \
 		LOCALES="$(GLIBC_GENERATE_LOCALES)" \
 		Q=$(Q)