From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6D525445320 for ; Thu, 9 Jul 2020 19:45:24 +0300 (MSK) From: imeevma@tarantool.org Date: Thu, 9 Jul 2020 19:45:23 +0300 Message-Id: <3cdf11659eb18f79faecb65f4cbe25022a8d205e.1594312926.git.imeevma@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v2 1/1] luarock: change a way to create manifest List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: lvasiliev@tarantool.org, yaroslav.dynnikov@tarantool.org, tarantool-patches@dev.tarantool.org Whenever a rock is installed it's being added to the repository manifest. And if a manifest doesn't exist yet, luarocks creates one by scanning the directory. It causes a problem when *.all.rock with dependencies is installed into an empty directory. Luarocks unpacks the all.rock before installing dependencies, and it's modules are captured during manifest creation. After the installation finishes, luarocks adds the all.rock to the manifest once again (now intentionally), detects collision of module names and renames them uniquely, like "cartridge_1_2_0_1". As a result, "require()" function doesn't work. This patch changes the way of manifest creation: instead of scanning repo luarocks creates an empty one. Closes tarantool/tarantool#4704 --- https://github.com/tarantool/tarantool/issues/4704 https://github.com/tarantool/luarocks/tree/imeevma/gh-4704-fix-rock-name @ChangeLog: * Don't ruin rock name when freshly installing *.all.rock with dependencies. src/luarocks/manif.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua index 34ae02d..79a4278 100644 --- a/src/luarocks/manif.lua +++ b/src/luarocks/manif.lua @@ -444,11 +444,10 @@ function manif.add_to_manifest(name, version, repo, deps_mode) local manifest, err = manif_core.load_local_manifest(rocks_dir) if not manifest then - util.printerr("No existing manifest. Attempting to rebuild...") - -- Manifest built by `manif.make_manifest` should already - -- include information about given name and version, - -- no need to update it. - return manif.make_manifest(rocks_dir, deps_mode) + util.printerr("No existing manifest. Creating an empty one...") + -- Create an empty manifest. + manifest, err = { repository = {}, modules = {}, commands = {} }, nil + manif_core.cache_manifest(rocks_dir, nil, manifest) end local results = {[name] = {[version] = {{arch = "installed", repo = rocks_dir}}}} -- 2.25.1