bitbake-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fetch2/npm: evaluate PATH before patching HOME
@ 2023-05-16 16:07 Dr. Arno Baumfalk
  2023-05-23 21:04 ` [bitbake-devel] " Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Dr. Arno Baumfalk @ 2023-05-16 16:07 UTC (permalink / raw)
  To: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 3177 bytes --]

 From acafbccb32510bca036894287afbe83765bc2d30 Mon Sep 17 00:00:00 2001
From: Arno Baumfalk <a.baumfalk@astro-kom.de>
Date: Tue, 16 May 2023 17:18:26 +0200
Subject: [PATCH] fetch2/npm: evaluate PATH before patching HOME

When the user configures the TMPDIR variable in a way that it contains 
$HOME (in local.conf), the DataSmart (d) object's PATH variable will 
also contain $HOME.

As the NpmEnvironment patches HOME with a temporary directory, further 
evaluation of PATH will become invalid an the build breaks with an error 
(npm not found).

As countermeasure PATH is evaluated *before* patching HOME.

Signed-off-by: Arno Baumfalk <a.baumfalk@astro-kom.de>
---
  bitbake/lib/bb/fetch2/npm.py | 1 +
  1 file changed, 1 insertion(+)

diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
index 8a179a339a..e6d0598f5d 100644
--- a/bitbake/lib/bb/fetch2/npm.py
+++ b/bitbake/lib/bb/fetch2/npm.py
@@ -103,6 +103,7 @@ class NpmEnvironment(object):
          """Run npm command in a controlled environment"""
          with tempfile.TemporaryDirectory() as tmpdir:
              d = bb.data.createCopy(self.d)
+            d.setVar("PATH", d.getVar("PATH"))  # PATH might contain 
$HOME - evaluate it before patching
              d.setVar("HOME", tmpdir)

              if not workdir:
-- 
2.26.2
-- 

Mit freundlichen Grüßen

*ASTRO Strobel **
*Kommunikationssysteme GmbH

Dr. Arno Baumfalk
Entwicklung

	


Telefon: 	+49 (0) 2204 405 228
Fax: 	+49 (0) 2204 405 220
eMail 	a.baumfalk@astro-kom.de <3D"mailto:a.ba=>
Internet: 	www.astro-kom.de <3D"http://www.=>


Folgen Sie uns<https://www.facebook.com/astrostrobel/>

ASTRO Strobel Kommunikationssysteme GmbH
Olefant 1-3 · 51427 Bergisch Gladbach
Geschäftsführer: Herbert Strobel
Registergericht Köln HRB 46271
Steuer-Nr. 204/5710/0569 · USt.ID-Nr. DE 121980384

Die Informationen in dieser eMail zusammen mit allen Anlagen sind streng 
vertraulich. Sie sind ausschließlich für den Gebrauch des rechtmäßigen 
Empfängers bestimmt. Jegliche Weitergabe ohne unsere ausdrückliche 
Genehmigung ist verboten und kann strafrechtlich verfolgt werden. 
Sollten Sie nicht der vorgesehene Empfänger dieser E-Mail sein, 
informieren Sie uns bitte unter 02204/405-0 oder leiten Sie die Mail an 
uns zurück _a.baumfalk@astro-kom.de_. Löschen Sie bitte die E-Mail von 
Ihrem System. Die ASTRO Strobel Kommunikationssysteme GmbH trägt weder 
die Verantwortung für die richtige und vollständige Übertragung dieser 
E-Mail noch für die Verzögerungen in der Übertragung.

The information and attachments in this e-mail are strictly 
confidential. They are for the exclusive use of the legitimate 
recipient. Any transfer without our express approval is prohibited and 
can be prosecuted. If you are not the destined recipient of this e-mail, 
please inform us by phone number +49 2204 405 0 or send the e-mail back 
to a.baumfalk@astro-kom.de. Please delete this e-mail from your system. 
The ASTRO Strobel Kommunikationssysteme GmbH is neither responsible for 
the complete transmission of this e-mail nor for transmission delays.

[-- Attachment #2.1: Type: text/html, Size: 70327 bytes --]

[-- Attachment #2.2: image001.jpg --]
[-- Type: image/jpeg, Size: 11906 bytes --]

[-- Attachment #2.3: image003.jpg --]
[-- Type: image/jpeg, Size: 863 bytes --]

[-- Attachment #2.4: image005.jpg --]
[-- Type: image/jpeg, Size: 889 bytes --]

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

* Re: [bitbake-devel] [PATCH] fetch2/npm: evaluate PATH before patching HOME
  2023-05-16 16:07 [PATCH] fetch2/npm: evaluate PATH before patching HOME Dr. Arno Baumfalk
@ 2023-05-23 21:04 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2023-05-23 21:04 UTC (permalink / raw)
  To: Arno Baumfalk; +Cc: bitbake-devel

Hello,

On 16/05/2023 18:07:08+0200, Arno Baumfalk wrote:
> From acafbccb32510bca036894287afbe83765bc2d30 Mon Sep 17 00:00:00 2001
> From: Arno Baumfalk <a.baumfalk@astro-kom.de>
> Date: Tue, 16 May 2023 17:18:26 +0200
> Subject: [PATCH] fetch2/npm: evaluate PATH before patching HOME
> 
> When the user configures the TMPDIR variable in a way that it contains $HOME
> (in local.conf), the DataSmart (d) object's PATH variable will also contain
> $HOME.
> 
> As the NpmEnvironment patches HOME with a temporary directory, further
> evaluation of PATH will become invalid an the build breaks with an error
> (npm not found).
> 
> As countermeasure PATH is evaluated *before* patching HOME.
> 
> Signed-off-by: Arno Baumfalk <a.baumfalk@astro-kom.de>
> ---
> �bitbake/lib/bb/fetch2/npm.py | 1 +
> �1 file changed, 1 insertion(+)
> 
> diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
> index 8a179a339a..e6d0598f5d 100644
> --- a/bitbake/lib/bb/fetch2/npm.py
> +++ b/bitbake/lib/bb/fetch2/npm.py
> @@ -103,6 +103,7 @@ class NpmEnvironment(object):
> �������� """Run npm command in a controlled environment"""
> �������� with tempfile.TemporaryDirectory() as tmpdir:
> ������������ d = bb.data.createCopy(self.d)
> +����������� d.setVar("PATH", d.getVar("PATH"))� # PATH might contain $HOME
> - evaluate it before patching

It seems your mailer is mangling your patch and it does not apply.

> ������������ d.setVar("HOME", tmpdir)
> 
> ������������ if not workdir:
> -- 
> 2.26.2
> -- 
> 
> Mit freundlichen Gr��en
> 
> *ASTRO Strobel **
> *Kommunikationssysteme GmbH
> 
> Dr. Arno Baumfalk
> Entwicklung
> 
> 	
> 
> 
> Telefon: 	+49�(0) 2204 405 228
> Fax: 	+49�(0) 2204 405 220
> eMail 	a.baumfalk@astro-kom.de <3D"mailto:a.ba=>
> Internet: 	www.astro-kom.de <3D"http://www.=>
> 
> 
> Folgen Sie uns<https://www.facebook.com/astrostrobel/>
> 
> ASTRO Strobel Kommunikationssysteme GmbH
> Olefant 1-3 � 51427 Bergisch Gladbach
> Gesch�ftsf�hrer: Herbert Strobel
> Registergericht K�ln HRB 46271
> Steuer-Nr. 204/5710/0569 � USt.ID-Nr. DE 121980384
> 
> Die Informationen in dieser eMail zusammen mit allen Anlagen sind streng
> vertraulich. Sie sind ausschlie�lich f�r den Gebrauch des rechtm��igen
> Empf�ngers bestimmt. Jegliche Weitergabe ohne unsere ausdr�ckliche
> Genehmigung ist verboten und kann strafrechtlich verfolgt werden. Sollten
> Sie nicht der vorgesehene Empf�nger dieser E-Mail sein, informieren Sie�uns
> bitte unter 02204/405-0 oder leiten Sie die Mail an uns zur�ck
> _a.baumfalk@astro-kom.de_. L�schen Sie bitte die E-Mail von Ihrem System.
> Die ASTRO Strobel Kommunikationssysteme GmbH tr�gt weder die Verantwortung
> f�r die richtige und vollst�ndige �bertragung dieser E-Mail noch f�r die
> Verz�gerungen in der �bertragung.
> 
> The information and attachments in this e-mail are strictly confidential.
> They are for the exclusive use of the legitimate recipient. Any transfer
> without our express approval is prohibited and can be prosecuted. If you are
> not the destined recipient of this e-mail, please inform us by phone number
> +49 2204 405 0 or send the e-mail back to a.baumfalk@astro-kom.de. Please
> delete this e-mail from your system. The ASTRO Strobel Kommunikationssysteme
> GmbH is neither responsible for the complete transmission of this e-mail nor
> for transmission delays.

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#14790): https://lists.openembedded.org/g/bitbake-devel/message/14790
> Mute This Topic: https://lists.openembedded.org/mt/98929768/3617179
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


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

end of thread, other threads:[~2023-05-23 21:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-16 16:07 [PATCH] fetch2/npm: evaluate PATH before patching HOME Dr. Arno Baumfalk
2023-05-23 21:04 ` [bitbake-devel] " Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).