From 70538358dffb00fe1caf3fc3b493c317704fb03e Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 1 Sep 2025 08:24:15 +0000 Subject: [PATCH] Properly handle @group/package deps in nodejs-symlink-deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Node packages can have dependencies of the for "@group/package" instead of just "package". Calling symlink() (and thus os.symlink()) in such a case fails when there is no "@group" directory yet. ``` + /usr/lib/rpm/nodejs-symlink-deps /usr/lib/node_modules ERROR: the path for dependency "@babel/runtime" already exists This could mean that bundled modules are being installed. Bundled libraries are forbidden in Fedora. For more information, see: It is generally reccomended to remove the entire "node_modules" directory in %prep when it exists. For more information, see: If you have obtained permission from the Fedora Packaging Committee to bundle libraries, please use `%nodejs_fixdep -r` in %prep to remove the dependency on the bundled module. This will prevent an unnecessary dependency on the system version of the module and eliminate this error. error: Bad exit status from /var/tmp/rpm-tmp.nn3mkP (%install) ``` The reported error is misleading - the path does not exist yet, but it also can't be created. os.symlink throws OSError in both cases. The patch prevents the issue by calling os.makedirs on the group-part of the dependency if there is one. Signed-off-by: Jan Staněk Resolves: RHEL-121583 --- nodejs-symlink-deps | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nodejs-symlink-deps b/nodejs-symlink-deps index b5e44b3..ba525eb 100755 --- a/nodejs-symlink-deps +++ b/nodejs-symlink-deps @@ -30,6 +30,8 @@ import shutil import sys def symlink(source, dest): + if os.path.sep in dest: + os.makedirs(os.path.dirname(dest), exist_ok=True) try: os.symlink(source, dest) except OSError: