All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/fail2ban: fix python3 2to3 dependency
@ 2020-02-17 12:52 Baruch Siach
  2020-02-18 17:43 ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Baruch Siach @ 2020-02-17 12:52 UTC (permalink / raw
  To: buildroot

The 2to3 utility is needed in the patch phase. Use the correct
dependency for that.

Fixes:
http://autobuild.buildroot.net/results/dd8e225e2a49cfa6735bed11459007003a37c137/
http://autobuild.buildroot.net/results/e688c3652bd474ac682984e2e5947701942f0f57/

Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Cc: Pascal de Bruijn <p.debruijn@unilogic.nl>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 package/fail2ban/fail2ban.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/fail2ban/fail2ban.mk b/package/fail2ban/fail2ban.mk
index 6f023b48a181..0f8e5ab6e694 100644
--- a/package/fail2ban/fail2ban.mk
+++ b/package/fail2ban/fail2ban.mk
@@ -14,7 +14,7 @@ ifeq ($(BR2_PACKAGE_PYTHON3),y)
 define FAIL2BAN_PYTHON_2TO3
 	$(HOST_DIR)/bin/2to3 --write --nobackups --no-diffs $(@D)/bin/* $(@D)/fail2ban
 endef
-FAIL2BAN_DEPENDENCIES += host-python3
+FAIL2BAN_PATCH_DEPENDENCIES += host-python3
 FAIL2BAN_POST_PATCH_HOOKS += FAIL2BAN_PYTHON_2TO3
 endif
 
-- 
2.25.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] package/fail2ban: fix python3 2to3 dependency
  2020-02-17 12:52 [Buildroot] [PATCH] package/fail2ban: fix python3 2to3 dependency Baruch Siach
@ 2020-02-18 17:43 ` Thomas Petazzoni
  2020-02-21  5:15   ` Baruch Siach
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2020-02-18 17:43 UTC (permalink / raw
  To: buildroot

On Mon, 17 Feb 2020 14:52:11 +0200
Baruch Siach <baruch@tkos.co.il> wrote:

> The 2to3 utility is needed in the patch phase. Use the correct
> dependency for that.
> 
> Fixes:
> http://autobuild.buildroot.net/results/dd8e225e2a49cfa6735bed11459007003a37c137/
> http://autobuild.buildroot.net/results/e688c3652bd474ac682984e2e5947701942f0f57/
> 
> Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com>
> Cc: Pascal de Bruijn <p.debruijn@unilogic.nl>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  package/fail2ban/fail2ban.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/fail2ban/fail2ban.mk b/package/fail2ban/fail2ban.mk
> index 6f023b48a181..0f8e5ab6e694 100644
> --- a/package/fail2ban/fail2ban.mk
> +++ b/package/fail2ban/fail2ban.mk
> @@ -14,7 +14,7 @@ ifeq ($(BR2_PACKAGE_PYTHON3),y)
>  define FAIL2BAN_PYTHON_2TO3
>  	$(HOST_DIR)/bin/2to3 --write --nobackups --no-diffs $(@D)/bin/* $(@D)/fail2ban
>  endef
> -FAIL2BAN_DEPENDENCIES += host-python3
> +FAIL2BAN_PATCH_DEPENDENCIES += host-python3
>  FAIL2BAN_POST_PATCH_HOOKS += FAIL2BAN_PYTHON_2TO3

I don't think this solves the problem. Indeed, patch dependencies are
special. When you do:

FAIL2BAN_PATCH_DEPENDENCIES += host-python3

You're in fact adding a dependency of fail2ban-patch on
host-python3-patch, and not on host-python3.

See in pkg-generic.mk:

$$($(2)_TARGET_PATCH):  | $$(patsubst %,%-patch,$$($(2)_FINAL_PATCH_DEPENDENCIES))

See the nice patsubst here ? :-)

And this intentional, and really needed for some Linux extensions
(Xenomai ? RTAI ? don't remember which one of the two).

So for this fail2ban thing, I guess the easier is to move the 2to3
execution to a PRE_CONFIGURE_HOOKS, with a good comment above.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] package/fail2ban: fix python3 2to3 dependency
  2020-02-18 17:43 ` Thomas Petazzoni
@ 2020-02-21  5:15   ` Baruch Siach
  2020-02-21 11:46     ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Baruch Siach @ 2020-02-21  5:15 UTC (permalink / raw
  To: buildroot

Hi Thomas,

On Tue, Feb 18 2020, Thomas Petazzoni wrote:
> On Mon, 17 Feb 2020 14:52:11 +0200
> Baruch Siach <baruch@tkos.co.il> wrote:
>
>> The 2to3 utility is needed in the patch phase. Use the correct
>> dependency for that.
>>
>> Fixes:
>> http://autobuild.buildroot.net/results/dd8e225e2a49cfa6735bed11459007003a37c137/
>> http://autobuild.buildroot.net/results/e688c3652bd474ac682984e2e5947701942f0f57/
>>
>> Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com>
>> Cc: Pascal de Bruijn <p.debruijn@unilogic.nl>
>> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
>> ---
>>  package/fail2ban/fail2ban.mk | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/package/fail2ban/fail2ban.mk b/package/fail2ban/fail2ban.mk
>> index 6f023b48a181..0f8e5ab6e694 100644
>> --- a/package/fail2ban/fail2ban.mk
>> +++ b/package/fail2ban/fail2ban.mk
>> @@ -14,7 +14,7 @@ ifeq ($(BR2_PACKAGE_PYTHON3),y)
>>  define FAIL2BAN_PYTHON_2TO3
>>  	$(HOST_DIR)/bin/2to3 --write --nobackups --no-diffs $(@D)/bin/* $(@D)/fail2ban
>>  endef
>> -FAIL2BAN_DEPENDENCIES += host-python3
>> +FAIL2BAN_PATCH_DEPENDENCIES += host-python3
>>  FAIL2BAN_POST_PATCH_HOOKS += FAIL2BAN_PYTHON_2TO3
>
> I don't think this solves the problem. Indeed, patch dependencies are
> special. When you do:
>
> FAIL2BAN_PATCH_DEPENDENCIES += host-python3
>
> You're in fact adding a dependency of fail2ban-patch on
> host-python3-patch, and not on host-python3.
>
> See in pkg-generic.mk:
>
> $$($(2)_TARGET_PATCH):  | $$(patsubst %,%-patch,$$($(2)_FINAL_PATCH_DEPENDENCIES))
>
> See the nice patsubst here ? :-)
>
> And this intentional, and really needed for some Linux extensions
> (Xenomai ? RTAI ? don't remember which one of the two).
>
> So for this fail2ban thing, I guess the easier is to move the 2to3
> execution to a PRE_CONFIGURE_HOOKS, with a good comment above.

How would that fix the issue? Is host-python3 guaranteed to build before
fail2ban PRE_CONFIGURE_HOOKS run unlike POST_PATCH_HOOKS?

baruch

--
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] package/fail2ban: fix python3 2to3 dependency
  2020-02-21  5:15   ` Baruch Siach
@ 2020-02-21 11:46     ` Thomas Petazzoni
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2020-02-21 11:46 UTC (permalink / raw
  To: buildroot

Hello Baruch,

On Fri, 21 Feb 2020 07:15:39 +0200
Baruch Siach <baruch@tkos.co.il> wrote:

> > So for this fail2ban thing, I guess the easier is to move the 2to3
> > execution to a PRE_CONFIGURE_HOOKS, with a good comment above.  
> 
> How would that fix the issue? Is host-python3 guaranteed to build before
> fail2ban PRE_CONFIGURE_HOOKS run unlike POST_PATCH_HOOKS?

Absolutely. The dependencies listed in <pkg>_DEPENDENCIES are
guaranteed to be built and installed before the configure step of <pkg>
starts.

See:

$$($(2)_TARGET_CONFIGURE):	| $$($(2)_FINAL_DEPENDENCIES)

in package/pkg-generic.mk.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-21 11:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-17 12:52 [Buildroot] [PATCH] package/fail2ban: fix python3 2to3 dependency Baruch Siach
2020-02-18 17:43 ` Thomas Petazzoni
2020-02-21  5:15   ` Baruch Siach
2020-02-21 11:46     ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.