From patchwork Fri May 13 13:48:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QsO2c3rDtnJtw6lueWkgWm9sdMOhbg==?= X-Patchwork-Id: 14212 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org From: "Zoltan Boszormenyi" Subject: [PATCH 1/2] npm.bbclass: Fix file permissions before opening it for writing Date: Fri, 13 May 2022 15:48:28 +0200 Message-Id: <20220513134829.1895574-2-zboszor@pr.hu> In-Reply-To: <20220513134829.1895574-1-zboszor@pr.hu> References: <20220513134829.1895574-1-zboszor@pr.hu> MIME-Version: 1.0 List-id: To: openembedded-core@lists.openembedded.org Cc: Jean-Marie LEMETAYER , =?utf-8?b?Wm9sdMOhbiBCw7ZzesO2cm3DqW55aQ==?= From: Zoltán Böszörményi Some node module archives in npmjs.org contain wrong permissions. I found a case with package.json in the archive being r-xr-xr-x for which open(..., "w") fails. Set the manifest file permissions to 0666 just in case. Signed-off-by: Zoltán Böszörményi --- meta/classes/npm.bbclass | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index ba50fcac20..7f52ec6061 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass @@ -202,6 +202,7 @@ python npm_do_configure() { if has_shrinkwrap_file: _update_manifest("devDependencies") + os.chmod(cached_manifest_file, 0o666) with open(cached_manifest_file, "w") as f: json.dump(cached_manifest, f, indent=2) From patchwork Fri May 13 13:48:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QsO2c3rDtnJtw6lueWkgWm9sdMOhbg==?= X-Patchwork-Id: 14213 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org From: "Zoltan Boszormenyi" Subject: [PATCH 2/2] staging.bbclass: Ignore installing multiple symlinks of the same name Date: Fri, 13 May 2022 15:48:29 +0200 Message-Id: <20220513134829.1895574-3-zboszor@pr.hu> In-Reply-To: <20220513134829.1895574-1-zboszor@pr.hu> References: <20220513134829.1895574-1-zboszor@pr.hu> MIME-Version: 1.0 List-id: To: openembedded-core@lists.openembedded.org Cc: Jean-Marie LEMETAYER , =?utf-8?b?Wm9sdMOhbiBCw7ZzesO2cm3DqW55aQ==?= From: Zoltán Böszörményi Recipes using "inherit npm" install the same /usr/lib/node symlink that points to node_modules. When a recipe DEPENDS on multiple npm based recipe, do_prepare_recipe_sysroot() fails. Ignore this symlink in a way that the set of ignored symlinks can be extended later if needed. Signed-off-by: Zoltán Böszörményi --- meta/classes/staging.bbclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass index 9fc8f4f283..f7b6056219 100644 --- a/meta/classes/staging.bbclass +++ b/meta/classes/staging.bbclass @@ -528,6 +528,7 @@ python extend_recipe_sysroot() { with open(manifest, "r") as f: manifests[dep] = manifest + ignored_dests = [ ''.join([d.getVar('nonarch_libdir'), '/node' ]) ] for l in f: l = l.strip() if l.endswith("/fixmepath"): @@ -545,7 +546,10 @@ python extend_recipe_sysroot() { hashname = targetdir + dest if not hashname.endswith("/"): if hashname in fileset: - bb.fatal("The file %s is installed by both %s and %s, aborting" % (dest, c, fileset[hashname])) + if os.path.islink(hashname) and dest in ignored_dests: + bb.note("The symlink '%s' %s wants to install is already installed by %s, ignoring" % (dest, c, fileset[hashname])) + else: + bb.fatal("The file %s is installed by both %s and %s, aborting" % (dest, c, fileset[hashname])) else: fileset[hashname] = c