Patchwork [v3,6/6] Makefile: export PATH

login
register
mail settings
Submitter Samuel Martin
Date Jan. 30, 2014, 8:38 p.m.
Message ID <1391114333-28001-7-git-send-email-s.martin49@gmail.com>
Download mbox | patch
Permalink /patch/315452/
State Superseded
Headers show

Comments

Samuel Martin - Jan. 30, 2014, 8:38 p.m.
This can be useful for:
- package using custom build system that are not aware that the host
  tree is in $(O)/host/;
- post-{build,image} scripts, in case some host-tools were specifically
  built to be used by these scripts.

Note that, this patch only exports the PATH variables; cleaning up
all the explicit PATH declarations leading some commands could be done
in a followup patch.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>

---
changes v2 -> v3:
- rebase
- extend commit log

changes v1 -> v2:
- rebase
- extend commit message
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Thomas Petazzoni - Jan. 31, 2014, 8:33 a.m.
Dear Samuel Martin,

On Thu, 30 Jan 2014 21:38:53 +0100, Samuel Martin wrote:
> This can be useful for:
> - package using custom build system that are not aware that the host
>   tree is in $(O)/host/;
> - post-{build,image} scripts, in case some host-tools were specifically
>   built to be used by these scripts.
> 
> Note that, this patch only exports the PATH variables; cleaning up
> all the explicit PATH declarations leading some commands could be done
> in a followup patch.

So with this patch, passing PATH in all the package infrastructures
(cmake, autotools, python) becomes unnecessary?

I must say I am not entirely sure we want to globally export PATH.
Packages using custom build system should use TARGET_MAKE_ENV and
HOST_MAKE_ENV, post-build and post-image script have HOST_DIR defined
in their environment I believe.

But this is not a strong opinion, I'd just like to see
arguments/opinions from others on this specific change (the other
changes in the series, I'm happy with them on the principle, they are
just a few remaining details to sort out).

Thomas
Arnout Vandecappelle - Feb. 4, 2014, 9:05 a.m.
On 31/01/14 09:33, Thomas Petazzoni wrote:
> Dear Samuel Martin,
> 
> On Thu, 30 Jan 2014 21:38:53 +0100, Samuel Martin wrote:
>> This can be useful for:
>> - package using custom build system that are not aware that the host
>>   tree is in $(O)/host/;
>> - post-{build,image} scripts, in case some host-tools were specifically
>>   built to be used by these scripts.
>>
>> Note that, this patch only exports the PATH variables; cleaning up
>> all the explicit PATH declarations leading some commands could be done
>> in a followup patch.
> 
> So with this patch, passing PATH in all the package infrastructures
> (cmake, autotools, python) becomes unnecessary?
> 
> I must say I am not entirely sure we want to globally export PATH.
> Packages using custom build system should use TARGET_MAKE_ENV and
> HOST_MAKE_ENV, post-build and post-image script have HOST_DIR defined
> in their environment I believe.
> 
> But this is not a strong opinion, I'd just like to see
> arguments/opinions from others on this specific change (the other
> changes in the series, I'm happy with them on the principle, they are
> just a few remaining details to sort out).

 I'm really fine with exporting it globally. It avoids mistakes, because
we will always use the things that we build ourselves - we can't be in a
situation any more that some steps use the system tool and other steps
use the host tool (well, we still can because of missing dependencies,
but the risk is smaller). It also removes the need for things like
setting $(TAR) explicitly (not that we should immediately remove that
one, but we don't have to add it in the future whenever we add another
host-or-system utility).


 Regards,
 Arnout

Patch

diff --git a/Makefile b/Makefile
index 5e8cfd8..fa33bc0 100644
--- a/Makefile
+++ b/Makefile
@@ -333,6 +333,7 @@  export STAGING_DIR
 export HOST_DIR
 export BINARIES_DIR
 export BASE_DIR
+export PATH:=$(BR2_PATH)
 
 ################################################################################
 #