Openembedded Core Discussions
 help / color / mirror / Atom feed
* [dizzy][PATCH] toolchain-shar-template.sh: Ensure it's ran in clean environment
@ 2015-11-19 10:35 George Nita
  2015-11-24 22:35 ` Paul Eggleton
  0 siblings, 1 reply; 3+ messages in thread
From: George Nita @ 2015-11-19 10:35 UTC (permalink / raw)
  To: openembedded-core

Fixes [YOCTO #8698] -- https://bugzilla.yoctoproject.org/show_bug.cgi?id=8698

If prior to running the toolchain installation script a toolchain
environment script is sourced then the toolchain installation will
fail. This because the environment is now set for the sourced toolchain
and doesn't suit the installation. In particular PATH points to the
toolchain executables.

The fix makes the script recursively call itself a second time with a
clean environment.

Tested by sourcing a previous successfully installed environment, erasing the
previous installation directory and then reinstalling in the same directory.

Signed-off-by: George Nita <george.nita@enea.com>
---
 meta/files/toolchain-shar-template.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/files/toolchain-shar-template.sh b/meta/files/toolchain-shar-template.sh
index 4a7fbd5..b8c5685 100644
--- a/meta/files/toolchain-shar-template.sh
+++ b/meta/files/toolchain-shar-template.sh
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+[ -z "$ENVCLEANED" ] && exec /usr/bin/env -i  ENVCLEANED=1 "$0" "$@"
+
 INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
 SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
 
-- 
1.9.1



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

* Re: [dizzy][PATCH] toolchain-shar-template.sh: Ensure it's ran in clean environment
  2015-11-19 10:35 [dizzy][PATCH] toolchain-shar-template.sh: Ensure it's ran in clean environment George Nita
@ 2015-11-24 22:35 ` Paul Eggleton
  2015-11-25 14:23   ` George Nita
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggleton @ 2015-11-24 22:35 UTC (permalink / raw)
  To: George Nita; +Cc: openembedded-core

Hi George,

On Thursday 19 November 2015 11:35:47 George Nita wrote:
> Fixes [YOCTO #8698] --
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=8698
> 
> If prior to running the toolchain installation script a toolchain
> environment script is sourced then the toolchain installation will
> fail. This because the environment is now set for the sourced toolchain
> and doesn't suit the installation. In particular PATH points to the
> toolchain executables.
> 
> The fix makes the script recursively call itself a second time with a
> clean environment.
> 
> Tested by sourcing a previous successfully installed environment, erasing
> the previous installation directory and then reinstalling in the same
> directory.
> 
> Signed-off-by: George Nita <george.nita@enea.com>
> ---
>  meta/files/toolchain-shar-template.sh | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/meta/files/toolchain-shar-template.sh
> b/meta/files/toolchain-shar-template.sh index 4a7fbd5..b8c5685 100644
> --- a/meta/files/toolchain-shar-template.sh
> +++ b/meta/files/toolchain-shar-template.sh
> @@ -1,5 +1,7 @@
>  #!/bin/bash
> 
> +[ -z "$ENVCLEANED" ] && exec /usr/bin/env -i  ENVCLEANED=1 "$0" "$@"
> +
>  INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
>  SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e
> "s/x86[-_]64/x86_64/")

Interesting, I wasn't aware you could do this with env, thanks.

You've sent this patch on top of dizzy, however when we make fixes like this 
the fix needs to go into master first and then backported to all release 
branches between that and the one you're targeting, assuming they are 
applicable; otherwise we can be in the situation where the fix is effectively 
lost when upgrading. In this instance I'll take care of this for you and send 
out a new fix (along with some others for the SDK), but if you could remember 
that when sending future patches that would be great.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: [dizzy][PATCH] toolchain-shar-template.sh: Ensure it's ran in clean environment
  2015-11-24 22:35 ` Paul Eggleton
@ 2015-11-25 14:23   ` George Nita
  0 siblings, 0 replies; 3+ messages in thread
From: George Nita @ 2015-11-25 14:23 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: openembedded-core

On 11/25/2015 12:35 AM, Paul Eggleton wrote:
> Hi George,
>
> On Thursday 19 November 2015 11:35:47 George Nita wrote:
>> Fixes [YOCTO #8698] --
>> https://bugzilla.yoctoproject.org/show_bug.cgi?id=8698
>>
>> If prior to running the toolchain installation script a toolchain
>> environment script is sourced then the toolchain installation will
>> fail. This because the environment is now set for the sourced toolchain
>> and doesn't suit the installation. In particular PATH points to the
>> toolchain executables.
>>
>> The fix makes the script recursively call itself a second time with a
>> clean environment.
>>
>> Tested by sourcing a previous successfully installed environment, erasing
>> the previous installation directory and then reinstalling in the same
>> directory.
>>
>> Signed-off-by: George Nita <george.nita@enea.com>
>> ---
>>   meta/files/toolchain-shar-template.sh | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/meta/files/toolchain-shar-template.sh
>> b/meta/files/toolchain-shar-template.sh index 4a7fbd5..b8c5685 100644
>> --- a/meta/files/toolchain-shar-template.sh
>> +++ b/meta/files/toolchain-shar-template.sh
>> @@ -1,5 +1,7 @@
>>   #!/bin/bash
>>
>> +[ -z "$ENVCLEANED" ] && exec /usr/bin/env -i  ENVCLEANED=1 "$0" "$@"
>> +
>>   INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
>>   SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e
>> "s/x86[-_]64/x86_64/")
>
> Interesting, I wasn't aware you could do this with env, thanks.
>
> You've sent this patch on top of dizzy, however when we make fixes like this
> the fix needs to go into master first and then backported to all release
> branches between that and the one you're targeting, assuming they are
> applicable; otherwise we can be in the situation where the fix is effectively
> lost when upgrading. In this instance I'll take care of this for you and send
> out a new fix (along with some others for the SDK), but if you could remember
> that when sending future patches that would be great.
>
> Cheers,
> Paul
>
Thanks Paul. Was induced in error by the script changed name in master 
(toolchain-shar-extract.sh). If still applicable I can send a patch for 
master too.

-- 
Best regards,
George Nita
Software developer
Enea Linux

Email george.nita@enea.com
Phone +4 074.575.4737

Enea Linux
www.enea.com


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

end of thread, other threads:[~2015-11-25 14:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-19 10:35 [dizzy][PATCH] toolchain-shar-template.sh: Ensure it's ran in clean environment George Nita
2015-11-24 22:35 ` Paul Eggleton
2015-11-25 14:23   ` George Nita

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