Package: luarocks Version: 2.4.2+dfsg-1.1 Severity: important The luarocks package on this version sets up a number of "site_config.lua" files that configures behaviour. Those files set the relevant library paths to the "x86_64" ones even on other platforms, such as arm64, armhf (armv7).
Relevant lines from the configurations on the current arm64 machine that's being used:: > $ cat /usr/share/lua/*/luarocks/site_config.lua |grep x86 > site_config.LUAROCKS_EXTERNAL_DEPS_SUBDIRS={ bin="bin", lib={ "lib", > [[lib/x86_64-linux-gnu]] }, include="include" } > site_config.LUAROCKS_RUNTIME_EXTERNAL_DEPS_SUBDIRS={ bin="bin", lib={ "lib", > [[lib/x86_64-linux-gnu]] }, include="include" } > site_config.LUAROCKS_EXTERNAL_DEPS_SUBDIRS={ bin="bin", lib={ "lib", > [[lib/x86_64-linux-gnu]] }, include="include" } > site_config.LUAROCKS_RUNTIME_EXTERNAL_DEPS_SUBDIRS={ bin="bin", lib={ "lib", > [[lib/x86_64-linux-gnu]] }, include="include" } > site_config.LUAROCKS_EXTERNAL_DEPS_SUBDIRS={ bin="bin", lib={ "lib", > [[lib/x86_64-linux-gnu]] }, include="include" } > site_config.LUAROCKS_RUNTIME_EXTERNAL_DEPS_SUBDIRS={ bin="bin", lib={ "lib", > [[lib/x86_64-linux-gnu]] }, include="include" } > $ ls -1 /usr/share/lua/*/luarocks/site_config.lua > /usr/share/lua/5.1/luarocks/site_config.lua > /usr/share/lua/5.2/luarocks/site_config.lua > /usr/share/lua/5.3/luarocks/site_config.lua This prevents luarocks to install packages that require actual compilation in the system. This can for example be tested with the `idn2` package, e.g. in an arm64 environment: > $ sudo apt install libidn2-0-dev > ... > $ luarocks install idn2 > Installing https://luarocks.org/idn2-0.1-0.src.rock > > Error: Could not find library file for IDN2 > No file libidn2.a in /usr/lib > No file libidn2.a in /usr/lib/x86_64-linux-gnu > No file libidn2.so in /usr/lib > No file libidn2.so in /usr/lib/x86_64-linux-gnu > No file matching libidn2.so.* in /usr/lib > No file matching libidn2.so.* in /usr/lib/x86_64-linux-gnu > You may have to install IDN2 in your system and/or pass IDN2_DIR or > IDN2_LIBDIR to the luarocks command. > Example: luarocks install idn2 IDN2_DIR=/usr/local ^^^ As visible, luarocks is trying to use the x86_64 libraries. Fixing up things in place with the following command enables proper compilation, not surprisingly: > $ sudo sed -i 's/lib\/x86_64-linux-gnu/lib\/'`gcc -dumpmachine`'/' > /usr/share/lua/*/luarocks/site_config.lua where "gcc -dumpmachine" inserts the correct gcc triplet for the given architecture, after which the install succeeds: > $ luarocks install idn2 > Installing https://luarocks.org/idn2-0.1-0.src.rock > gcc -O2 -fPIC -I/usr/include/lua5.1 -c idn2/idn2.c -o idn2/idn2.o > -I/usr/include > gcc -shared -o idn2.so -L/usr/local/lib idn2/idn2.o > -L/usr/lib/aarch64-linux-gnu -Wl,-rpath,/usr/lib/aarch64-linux-gnu: -lidn2 > idn2 0.1-0 is now installed in /usr/local (license: MIT) This issue affects Debian versions where luarocks 2.x is used (ie. bullseye/stable and buster/oldstable as well, which is still quite widely used). The testing version of the package on luarocks 3.x is no longer affected. -- System Information: Debian Release: 11.4 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable') Architecture: arm64 (aarch64) Kernel: Linux 5.10.124-linuxkit (SMP w/6 CPU threads) Kernel taint flags: TAINT_OOT_MODULE, TAINT_RANDSTRUCT Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /bin/dash Init: unable to detect Versions of packages luarocks depends on: ii liblua5.1-0-dev [liblua5.1-dev] 5.1.5-8.1+b3 ii lua-any 27 ii lua5.1 5.1.5-8.1+b3 ii unzip 6.0-26+deb11u1 ii wget 1.21-1+deb11u1 ii zip 3.0-12 Versions of packages luarocks recommends: ii lua-sec 1.0-1 luarocks suggests no packages. -- no debconf information