All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/Makefile.in: export O= to post-build/image scripts for out-of-tree builds
@ 2017-07-14 13:04 Peter Korsgaard
  2017-07-14 21:53 ` Yann E. MORIN
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Peter Korsgaard @ 2017-07-14 13:04 UTC (permalink / raw)
  To: buildroot

Sometimes it can be interesting to call back into buildroot from a
post-build/image script (E.G. make printvars or similar). For this to work
correctly with out-of-tree builds we need to pass O= to make, but this is
currently not available in the environment of post-build/image scripts.

In concept, O could be derrived from BUILD_DIR (E.G. by stripping /build),
but directly exporting O is cleaner.

O= cannot be exported globally as it interferes with various build systems,
so instead add it to EXTRA_ENV.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 package/Makefile.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index b95e5e3fa8..a2b0d90f32 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -309,7 +309,8 @@ HOST_CONFIGURE_OPTS = \
 EXTRA_ENV = \
 	PATH=$(BR_PATH) \
 	BR2_DL_DIR=$(BR2_DL_DIR) \
-	BUILD_DIR=$(BUILD_DIR)
+	BUILD_DIR=$(BUILD_DIR) \
+	O=$(CANONICAL_O)
 
 ################################################################################
 # settings we need to pass to configure
-- 
2.11.0

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

* [Buildroot] [PATCH] package/Makefile.in: export O= to post-build/image scripts for out-of-tree builds
  2017-07-14 13:04 [Buildroot] [PATCH] package/Makefile.in: export O= to post-build/image scripts for out-of-tree builds Peter Korsgaard
@ 2017-07-14 21:53 ` Yann E. MORIN
  2017-07-15  8:11 ` Thomas Petazzoni
  2017-07-17 20:52 ` Arnout Vandecappelle
  2 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2017-07-14 21:53 UTC (permalink / raw)
  To: buildroot

Peter, All,

On 2017-07-14 15:04 +0200, Peter Korsgaard spake thusly:
> Sometimes it can be interesting to call back into buildroot from a
> post-build/image script (E.G. make printvars or similar). For this to work
> correctly with out-of-tree builds we need to pass O= to make, but this is
> currently not available in the environment of post-build/image scripts.
> 
> In concept, O could be derrived from BUILD_DIR (E.G. by stripping /build),
> but directly exporting O is cleaner.
> 
> O= cannot be exported globally as it interferes with various build systems,
> so instead add it to EXTRA_ENV.
> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

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

Regards,
Yann E. MORIN.

> ---
>  package/Makefile.in | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index b95e5e3fa8..a2b0d90f32 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -309,7 +309,8 @@ HOST_CONFIGURE_OPTS = \
>  EXTRA_ENV = \
>  	PATH=$(BR_PATH) \
>  	BR2_DL_DIR=$(BR2_DL_DIR) \
> -	BUILD_DIR=$(BUILD_DIR)
> +	BUILD_DIR=$(BUILD_DIR) \
> +	O=$(CANONICAL_O)
>  
>  ################################################################################
>  # settings we need to pass to configure
> -- 
> 2.11.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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] 8+ messages in thread

* [Buildroot] [PATCH] package/Makefile.in: export O= to post-build/image scripts for out-of-tree builds
  2017-07-14 13:04 [Buildroot] [PATCH] package/Makefile.in: export O= to post-build/image scripts for out-of-tree builds Peter Korsgaard
  2017-07-14 21:53 ` Yann E. MORIN
@ 2017-07-15  8:11 ` Thomas Petazzoni
  2017-07-17 20:52 ` Arnout Vandecappelle
  2 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2017-07-15  8:11 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 14 Jul 2017 15:04:17 +0200, Peter Korsgaard wrote:
> Sometimes it can be interesting to call back into buildroot from a
> post-build/image script (E.G. make printvars or similar). For this to work
> correctly with out-of-tree builds we need to pass O= to make, but this is
> currently not available in the environment of post-build/image scripts.
> 
> In concept, O could be derrived from BUILD_DIR (E.G. by stripping /build),
> but directly exporting O is cleaner.
> 
> O= cannot be exported globally as it interferes with various build systems,
> so instead add it to EXTRA_ENV.
> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> ---
>  package/Makefile.in | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] package/Makefile.in: export O= to post-build/image scripts for out-of-tree builds
  2017-07-14 13:04 [Buildroot] [PATCH] package/Makefile.in: export O= to post-build/image scripts for out-of-tree builds Peter Korsgaard
  2017-07-14 21:53 ` Yann E. MORIN
  2017-07-15  8:11 ` Thomas Petazzoni
@ 2017-07-17 20:52 ` Arnout Vandecappelle
  2017-07-17 21:32   ` Peter Korsgaard
  2 siblings, 1 reply; 8+ messages in thread
From: Arnout Vandecappelle @ 2017-07-17 20:52 UTC (permalink / raw)
  To: buildroot



On 14-07-17 15:04, Peter Korsgaard wrote:
> Sometimes it can be interesting to call back into buildroot from a
> post-build/image script (E.G. make printvars or similar). For this to work
> correctly with out-of-tree builds we need to pass O= to make, but this is
> currently not available in the environment of post-build/image scripts.
> 
> In concept, O could be derrived from BUILD_DIR (E.G. by stripping /build),
> but directly exporting O is cleaner.
> 
> O= cannot be exported globally as it interferes with various build systems,
> so instead add it to EXTRA_ENV.

 I'm too late with this comment, but why is BASE_DIR not sufficient? It is
already exported, and it is set to:

BASE_DIR := $(CANONICAL_O)

 O has the problem that it's too risky to lead to conflicts IMO.

 IOW I vote for a revert of this patch.

 Regards,
 Arnout


> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> ---
>  package/Makefile.in | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index b95e5e3fa8..a2b0d90f32 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -309,7 +309,8 @@ HOST_CONFIGURE_OPTS = \
>  EXTRA_ENV = \
>  	PATH=$(BR_PATH) \
>  	BR2_DL_DIR=$(BR2_DL_DIR) \
> -	BUILD_DIR=$(BUILD_DIR)
> +	BUILD_DIR=$(BUILD_DIR) \
> +	O=$(CANONICAL_O)
>  
>  ################################################################################
>  # settings we need to pass to configure
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH] package/Makefile.in: export O= to post-build/image scripts for out-of-tree builds
  2017-07-17 20:52 ` Arnout Vandecappelle
@ 2017-07-17 21:32   ` Peter Korsgaard
  2017-07-17 21:34     ` Arnout Vandecappelle
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2017-07-17 21:32 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

 > On 14-07-17 15:04, Peter Korsgaard wrote:
 >> Sometimes it can be interesting to call back into buildroot from a
 >> post-build/image script (E.G. make printvars or similar). For this to work
 >> correctly with out-of-tree builds we need to pass O= to make, but this is
 >> currently not available in the environment of post-build/image scripts.
 >> 
 >> In concept, O could be derrived from BUILD_DIR (E.G. by stripping /build),
 >> but directly exporting O is cleaner.
 >> 
 >> O= cannot be exported globally as it interferes with various build systems,
 >> so instead add it to EXTRA_ENV.

 >  I'm too late with this comment, but why is BASE_DIR not sufficient? It is
 > already exported, and it is set to:

 > BASE_DIR := $(CANONICAL_O)

Yes, that can also work - Even though it is less obvious that you should
run make O=${BASE_DIR} inside the post build/image scripts, instead of
make O=$O

 >  O has the problem that it's too risky to lead to conflicts IMO.

Even for post build/image scripts? What use cases do you have in mind
where there could be conflicts?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH] package/Makefile.in: export O= to post-build/image scripts for out-of-tree builds
  2017-07-17 21:32   ` Peter Korsgaard
@ 2017-07-17 21:34     ` Arnout Vandecappelle
  2017-07-18 12:47       ` Peter Korsgaard
  0 siblings, 1 reply; 8+ messages in thread
From: Arnout Vandecappelle @ 2017-07-17 21:34 UTC (permalink / raw)
  To: buildroot



On 17-07-17 23:32, Peter Korsgaard wrote:
>>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
> 
>  > On 14-07-17 15:04, Peter Korsgaard wrote:
>  >> Sometimes it can be interesting to call back into buildroot from a
>  >> post-build/image script (E.G. make printvars or similar). For this to work
>  >> correctly with out-of-tree builds we need to pass O= to make, but this is
>  >> currently not available in the environment of post-build/image scripts.
>  >> 
>  >> In concept, O could be derrived from BUILD_DIR (E.G. by stripping /build),
>  >> but directly exporting O is cleaner.
>  >> 
>  >> O= cannot be exported globally as it interferes with various build systems,
>  >> so instead add it to EXTRA_ENV.
> 
>  >  I'm too late with this comment, but why is BASE_DIR not sufficient? It is
>  > already exported, and it is set to:
> 
>  > BASE_DIR := $(CANONICAL_O)
> 
> Yes, that can also work - Even though it is less obvious that you should
> run make O=${BASE_DIR} inside the post build/image scripts, instead of
> make O=$O

 OK, but having both exported seems a bit silly...


>  >  O has the problem that it's too risky to lead to conflicts IMO.
> 
> Even for post build/image scripts? What use cases do you have in mind
> where there could be conflicts?

 True, in EXTRA_ENV the risk is minimal - especially since Kbuild and
derivatives (like Buildroot) ignore an O passed through the environment.

 Regards,
 Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH] package/Makefile.in: export O= to post-build/image scripts for out-of-tree builds
  2017-07-17 21:34     ` Arnout Vandecappelle
@ 2017-07-18 12:47       ` Peter Korsgaard
  2017-07-18 13:18         ` Arnout Vandecappelle
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2017-07-18 12:47 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

Hi,

 >> Yes, that can also work - Even though it is less obvious that you should
 >> run make O=${BASE_DIR} inside the post build/image scripts, instead of
 >> make O=$O

 >  OK, but having both exported seems a bit silly...

Correct. I would argue that O is somewhat nicer than BASE_DIR, as the
user is already using O= (and if they don't use O=, then they also don't
need to pass it in post-build/post-image scripts), but we have exported
and documented BASE_DIR for some time now, so we cannot really get rid
of it.

 >> >  O has the problem that it's too risky to lead to conflicts IMO.
 >> 
 >> Even for post build/image scripts? What use cases do you have in mind
 >> where there could be conflicts?

 >  True, in EXTRA_ENV the risk is minimal - especially since Kbuild and
 > derivatives (like Buildroot) ignore an O passed through the environment.

Indeed.

I don't feel strongly pro/con, what do others say?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH] package/Makefile.in: export O= to post-build/image scripts for out-of-tree builds
  2017-07-18 12:47       ` Peter Korsgaard
@ 2017-07-18 13:18         ` Arnout Vandecappelle
  0 siblings, 0 replies; 8+ messages in thread
From: Arnout Vandecappelle @ 2017-07-18 13:18 UTC (permalink / raw)
  To: buildroot



On 18-07-17 14:47, Peter Korsgaard wrote:
>>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
> 
> Hi,
> 
>  >> Yes, that can also work - Even though it is less obvious that you should
>  >> run make O=${BASE_DIR} inside the post build/image scripts, instead of
>  >> make O=$O
> 
>  >  OK, but having both exported seems a bit silly...
> 
> Correct. I would argue that O is somewhat nicer than BASE_DIR, as the
> user is already using O= (and if they don't use O=, then they also don't
> need to pass it in post-build/post-image scripts), but we have exported
> and documented BASE_DIR for some time now, so we cannot really get rid
> of it.
> 
>  >> >  O has the problem that it's too risky to lead to conflicts IMO.
>  >> 
>  >> Even for post build/image scripts? What use cases do you have in mind
>  >> where there could be conflicts?
> 
>  >  True, in EXTRA_ENV the risk is minimal - especially since Kbuild and
>  > derivatives (like Buildroot) ignore an O passed through the environment.
> 
> Indeed.
> 
> I don't feel strongly pro/con, what do others say?

 Since it's already committed, leave it in. It's no biggy.

 Regards,
 Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

end of thread, other threads:[~2017-07-18 13:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-14 13:04 [Buildroot] [PATCH] package/Makefile.in: export O= to post-build/image scripts for out-of-tree builds Peter Korsgaard
2017-07-14 21:53 ` Yann E. MORIN
2017-07-15  8:11 ` Thomas Petazzoni
2017-07-17 20:52 ` Arnout Vandecappelle
2017-07-17 21:32   ` Peter Korsgaard
2017-07-17 21:34     ` Arnout Vandecappelle
2017-07-18 12:47       ` Peter Korsgaard
2017-07-18 13:18         ` Arnout Vandecappelle

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.