Skip to content

Commit eb555fa

Browse files
ImeevMAkyukhin
authored andcommitted
luarock: change a way to create manifest
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
1 parent 05312b5 commit eb555fa

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/luarocks/manif.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,10 @@ function manif.add_to_manifest(name, version, repo, deps_mode)
444444

445445
local manifest, err = manif_core.load_local_manifest(rocks_dir)
446446
if not manifest then
447-
util.printerr("No existing manifest. Attempting to rebuild...")
448-
-- Manifest built by `manif.make_manifest` should already
449-
-- include information about given name and version,
450-
-- no need to update it.
451-
return manif.make_manifest(rocks_dir, deps_mode)
447+
util.printerr("No existing manifest. Creating an empty one...")
448+
-- Create an empty manifest.
449+
manifest, err = { repository = {}, modules = {}, commands = {} }, nil
450+
manif_core.cache_manifest(rocks_dir, nil, manifest)
452451
end
453452

454453
local results = {[name] = {[version] = {{arch = "installed", repo = rocks_dir}}}}

0 commit comments

Comments
 (0)