Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/pkg-waf: properly escape HOST_DIR when defining <pkg>_WAF
@ 2018-09-23 13:38 Thomas Petazzoni
  2018-09-23 13:45 ` Yann E. MORIN
  2018-09-25 20:24 ` Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2018-09-23 13:38 UTC (permalink / raw)
  To: buildroot

When <pkg>_NEEDS_EXTERNAL_WAF is set to YES, <pkg>_WAF is set to
$(HOST_DIR)/bin/waf within the inner-waf-package macro. This reference
to $(HOST_DIR) should use $$(HOST_DIR) so that it is properly expanded
at the time of use, and not at the time of the macro expansion.

In the current Buildroot, this doesn't cause any visible problem
because $(HOST_DIR) points to the same directory for all
packages. However, with per-package host/target directories, this is
no longer the case. It causes a build issue because it tries to use
"waf" from the global host directory, which doesn't exist during the
build.

This commit fixes the following build issue with per package
host/target directories:

/home/test/autobuild/run/instance-2/output/per-package/mpv/host/bin/python2: can't open file '/home/test/autobuild/run/instance-2/output/host/bin/waf': [Errno 2] No such file or directory
make: *** [/home/test/autobuild/run/instance-2/output/build/mpv-0.27.2/.stamp_configured] Error 2

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/pkg-waf.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/pkg-waf.mk b/package/pkg-waf.mk
index e5b606f063..3288dd63a0 100644
--- a/package/pkg-waf.mk
+++ b/package/pkg-waf.mk
@@ -44,7 +44,7 @@ $(2)_NEEDS_EXTERNAL_WAF ?= NO
 # If the package does not have its own waf, use our own.
 ifeq ($$($(2)_NEEDS_EXTERNAL_WAF),YES)
 $(2)_DEPENDENCIES += host-waf
-$(2)_WAF = $(HOST_DIR)/bin/waf
+$(2)_WAF = $$(HOST_DIR)/bin/waf
 else
 $(2)_WAF = ./waf
 endif
-- 
2.14.4

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

* [Buildroot] [PATCH] package/pkg-waf: properly escape HOST_DIR when defining <pkg>_WAF
  2018-09-23 13:38 [Buildroot] [PATCH] package/pkg-waf: properly escape HOST_DIR when defining <pkg>_WAF Thomas Petazzoni
@ 2018-09-23 13:45 ` Yann E. MORIN
  2018-09-25 20:24 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2018-09-23 13:45 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2018-09-23 15:38 +0200, Thomas Petazzoni spake thusly:
> When <pkg>_NEEDS_EXTERNAL_WAF is set to YES, <pkg>_WAF is set to
> $(HOST_DIR)/bin/waf within the inner-waf-package macro. This reference
> to $(HOST_DIR) should use $$(HOST_DIR) so that it is properly expanded
> at the time of use, and not at the time of the macro expansion.
> 
> In the current Buildroot, this doesn't cause any visible problem
> because $(HOST_DIR) points to the same directory for all
> packages. However, with per-package host/target directories, this is
> no longer the case. It causes a build issue because it tries to use
> "waf" from the global host directory, which doesn't exist during the
> build.
> 
> This commit fixes the following build issue with per package
> host/target directories:
> 
> /home/test/autobuild/run/instance-2/output/per-package/mpv/host/bin/python2: can't open file '/home/test/autobuild/run/instance-2/output/host/bin/waf': [Errno 2] No such file or directory
> make: *** [/home/test/autobuild/run/instance-2/output/build/mpv-0.27.2/.stamp_configured] Error 2
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  package/pkg-waf.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/pkg-waf.mk b/package/pkg-waf.mk
> index e5b606f063..3288dd63a0 100644
> --- a/package/pkg-waf.mk
> +++ b/package/pkg-waf.mk
> @@ -44,7 +44,7 @@ $(2)_NEEDS_EXTERNAL_WAF ?= NO
>  # If the package does not have its own waf, use our own.
>  ifeq ($$($(2)_NEEDS_EXTERNAL_WAF),YES)
>  $(2)_DEPENDENCIES += host-waf
> -$(2)_WAF = $(HOST_DIR)/bin/waf
> +$(2)_WAF = $$(HOST_DIR)/bin/waf
>  else
>  $(2)_WAF = ./waf
>  endif
> -- 
> 2.14.4
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH] package/pkg-waf: properly escape HOST_DIR when defining <pkg>_WAF
  2018-09-23 13:38 [Buildroot] [PATCH] package/pkg-waf: properly escape HOST_DIR when defining <pkg>_WAF Thomas Petazzoni
  2018-09-23 13:45 ` Yann E. MORIN
@ 2018-09-25 20:24 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2018-09-25 20:24 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 23 Sep 2018 15:38:17 +0200, Thomas Petazzoni wrote:
> When <pkg>_NEEDS_EXTERNAL_WAF is set to YES, <pkg>_WAF is set to
> $(HOST_DIR)/bin/waf within the inner-waf-package macro. This reference
> to $(HOST_DIR) should use $$(HOST_DIR) so that it is properly expanded
> at the time of use, and not at the time of the macro expansion.
> 
> In the current Buildroot, this doesn't cause any visible problem
> because $(HOST_DIR) points to the same directory for all
> packages. However, with per-package host/target directories, this is
> no longer the case. It causes a build issue because it tries to use
> "waf" from the global host directory, which doesn't exist during the
> build.
> 
> This commit fixes the following build issue with per package
> host/target directories:
> 
> /home/test/autobuild/run/instance-2/output/per-package/mpv/host/bin/python2: can't open file '/home/test/autobuild/run/instance-2/output/host/bin/waf': [Errno 2] No such file or directory
> make: *** [/home/test/autobuild/run/instance-2/output/build/mpv-0.27.2/.stamp_configured] Error 2
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  package/pkg-waf.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to master, thanks.

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

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

end of thread, other threads:[~2018-09-25 20:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-23 13:38 [Buildroot] [PATCH] package/pkg-waf: properly escape HOST_DIR when defining <pkg>_WAF Thomas Petazzoni
2018-09-23 13:45 ` Yann E. MORIN
2018-09-25 20:24 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox