Skip to contentSkip to conversation

[1.52][PATCH 0/4] Review request

DISCUSSION Anuj Mittal 1 participant 5 messages Dec 31, 2021

lore
Share & tools
lore
#0 lore raw

Please review and merge these changes for 1.52. No issues seen while testing on autobuilder.

Thanks,

Anuj

The following changes since commit 6bfb02f845001bf4f05d9b68695bb616b1642b2a:

lib/pyinotify.py: Remove deprecated module asyncore (2021-12-14 22:59:46 +0000)

are available in the Git repository at:

git://push.openembedded.org/bitbake-contrib stable/1.52-next

Anton Mikanovich (1):
process: Do not mix stderr with stdout

Richard Purdie (1):
tests/fetch: Drop gnu urls from wget connectivity test

Stefan Herbrechtsmeier (2):
fetch: npm: Quote destdir in run chmod command
fetch: npm: Use temporary file for empty user config

 lib/bb/fetch2/npm.py  | 16 ++++++----------
 lib/bb/process.py     |  2 +-
 lib/bb/tests/fetch.py |  3 ---
 3 files changed, 7 insertions(+), 14 deletions(-)
Signature · 1 line
2.33.1
#1 lore raw

[1.52][PATCH 1/4] process: Do not mix stderr with stdout

From: Anton Mikanovich <[email protected]>

We should not redirect stderr to stdout if we need to get separated stdout and stderr contents from Popen.communicate() later.

(cherry picked from commit 1ecc1d9424877df89fcda2f23c306998998a65ff)
---
 lib/bb/process.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/process.py +1 -1
index d5a1775f..af5d804a 100644
@@ -60,7 +60,7 @@ class Popen(subprocess.Popen):
         "close_fds": True,
         "preexec_fn": subprocess_setup,
         "stdout": subprocess.PIPE,
-        "stderr": subprocess.STDOUT,
+        "stderr": subprocess.PIPE,
         "stdin": subprocess.PIPE,
         "shell": False,
     }
Signature · 1 line
2.33.1
#2 lore raw

[1.52][PATCH 2/4] fetch: npm: Quote destdir in run chmod command

In reply to Anuj Mittal

From: Stefan Herbrechtsmeier <[email protected]>

Quote destdir in run chmod command to support special characters in package name and to avoid syntax error for packages like '@(._.)/execute'.

(cherry picked from commit a701dfce3f0e74b4d7c687eeda83fe9c8e7240b1)
---
 lib/bb/fetch2/npm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/fetch2/npm.py +1 -1
index e497c38d..d9daec20 100644
@@ -72,7 +72,7 @@ def npm_unpack(tarball, destdir, d):
     cmd += " --delay-directory-restore"
     cmd += " --strip-components=1"
     runfetchcmd(cmd, d, workdir=destdir)
-    runfetchcmd("chmod -R +X %s" % (destdir), d, quiet=True, workdir=destdir)
+    runfetchcmd("chmod -R +X '%s'" % (destdir), d, quiet=True, workdir=destdir)
 
 class NpmEnvironment(object):
     """
Signature · 1 line
2.33.1
#3 lore raw

[1.52][PATCH 3/4] fetch: npm: Use temporary file for empty user config

In reply to Anuj Mittal

From: Stefan Herbrechtsmeier <[email protected]>

Always use a temporary file for the user config 'NPM_CONFIG_USERCONFIG' because npm otherwise failed if configs and npmrc aren't set:

double-loading config "/dev/null" as "global", previously loaded as "user"

(cherry picked from commit 9f272ad7f76c1559e745e9af686d0a529f917659)
---
 lib/bb/fetch2/npm.py | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
lib/bb/fetch2/npm.py +5 -9
index d9daec20..b3a3a444 100644
@@ -79,16 +79,12 @@ class NpmEnvironment(object):
     Using a npm config file seems more reliable than using cli arguments.
     This class allows to create a controlled environment for npm commands.
     """
-    def __init__(self, d, configs=None, npmrc=None):
+    def __init__(self, d, configs=[], npmrc=None):
         self.d = d
 
-        if configs:
-            self.user_config = tempfile.NamedTemporaryFile(mode="w", buffering=1)
-            self.user_config_name = self.user_config.name
-            for key, value in configs:
-                self.user_config.write("%s=%s\n" % (key, value))
-        else:
-            self.user_config_name = "/dev/null"
+        self.user_config = tempfile.NamedTemporaryFile(mode="w", buffering=1)
+        for key, value in configs:
+            self.user_config.write("%s=%s\n" % (key, value))
 
         if npmrc:
             self.global_config_name = npmrc
@@ -109,7 +105,7 @@ class NpmEnvironment(object):
                 workdir = tmpdir
 
             def _run(cmd):
-                cmd = "NPM_CONFIG_USERCONFIG=%s " % (self.user_config_name) + cmd
+                cmd = "NPM_CONFIG_USERCONFIG=%s " % (self.user_config.name) + cmd
                 cmd = "NPM_CONFIG_GLOBALCONFIG=%s " % (self.global_config_name) + cmd
                 return runfetchcmd(cmd, d, workdir=workdir)
 
Signature · 1 line
2.33.1
#4 lore raw

[1.52][PATCH 4/4] tests/fetch: Drop gnu urls from wget connectivity test

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

These urls are no longer adding much to the test coverage but the intermittent network issues connecting to them are painful. Drop the urls.

(cherry picked from commit bdf5739c5d831dc97a7d81568f94a0953c71017f)
---
 lib/bb/tests/fetch.py | 3 ---
 1 file changed, 3 deletions(-)
lib/bb/tests/fetch.py +0 -3
index a85ebdf4..34f3a4f6 100644
@@ -1378,9 +1378,6 @@ class FetchCheckStatusTest(FetcherTest):
                       "https://downloads.yoctoproject.org/releases/opkg/opkg-0.1.7.tar.gz",
                       "https://downloads.yoctoproject.org/releases/opkg/opkg-0.3.0.tar.gz",
                       "ftp://sourceware.org/pub/libffi/libffi-1.20.tar.gz",
-                      "http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz",
-                      "https://ftp.gnu.org/gnu/chess/gnuchess-5.08.tar.gz",
-                      "https://ftp.gnu.org/gnu/gmp/gmp-4.0.tar.gz",
                       # GitHub releases are hosted on Amazon S3, which doesn't support HEAD
                       "https://github.com/kergoth/tslib/releases/download/1.1/tslib-1.1.tar.xz"
                       ]
Signature · 1 line
2.33.1