You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Luarocks cannot remove lfs.dll because it is used by luarocks itself and Windows does not allow to remove
the file while it is open.
This issue also raises the questions if it's a good idea that Luarocks uses lfs if luafilesystem is installed. This has also the implication of increased complexity because there are two implementations within Luarocks for handling files: one builtin and another one using lfs. This also could hide errors if the fallback implementation is not tested because lfs is arround, see for example Luarocks: use cmd mkdir msys2/MINGW-packages#12002
Steps to reproduce:
assure that lfs is not installed:
$ luarocks show luafilesystem
Error: cannot find package luafilesystem
Use 'list' to find installed rocks.
$ lua -e 'print(require"lfs")'
C:\msys64\mingw64\bin\lua.exe: (command line):1: module 'lfs' not found:
install lfs:
$ luarocks install luafilesystem
...
check that lfs is installed:
$ luarocks show luafilesystem
LuaFileSystem 1.8.0-1 - File System Library for the Lua Programming Language
...
$ lua -e 'print(require"lfs")'
table: 000001ade2579ef0 C:\msys64\mingw64\bin\..\lib\lua\5.4\lfs.dll
remove lfs:
$ luarocks remove luafilesystem
Checking stability of dependencies in the absence of
luafilesystem 1.8.0-1...
Removing luafilesystem 1.8.0-1...
Removal successful.
now luarocks assumes that lfs is uninstalled, however it is still there:
$ luarocks show luafilesystem
Error: cannot find package luafilesystem
Use 'list' to find installed rocks.
$ lua -e 'print(require"lfs")'
table: 0000025ce0519eb0 C:\msys64\mingw64\bin\..\lib\lua\5.4\lfs.dll
re-installing lfs:
$ luarocks install luafilesystem
Installing https://luarocks.org/luafilesystem-1.8.0-1.src.rock
luafilesystem 1.8.0-1 depends on lua >= 5.1 (5.4-1 provided by VM)
gcc -O2 -fPIC -c -o src/lfs.o -IC:/msys64/mingw64/include src/lfs.c
gcc -shared -o lfs.dll src/lfs.o C:/msys64/mingw64/bin/lua54.dll -lm
luafilesystem 1.8.0-1 is now installed in C:/msys64/mingw64 (license: MIT/X11)
Warning: C:/msys64/mingw64/lib/lua/5.4/lfs.dll is not tracked by this installation of LuaRocks. Moving it to C:/msys64/mingw64/lib/lua/5.4/lfs.dll~
The text was updated successfully, but these errors were encountered:
Prevent LuaRocks itself from using installed modules and blocking their files from removal.
This is not an issue on luarocks.exe because its own copy of lfs is statically linked.
We need to eventually switch to using that always, but for now this is a workable
solution.
Fixes#1428.
Platform:
LuaRocks version:
Configuration file:
Description:
Luarocks cannot remove
lfs.dll
because it is used by luarocks itself and Windows does not allow to removethe file while it is open.
This issue also raises the questions if it's a good idea that Luarocks uses
lfs
if luafilesystem is installed. This has also the implication of increased complexity because there are two implementations within Luarocks for handling files: one builtin and another one usinglfs
. This also could hide errors if the fallback implementation is not tested becauselfs
is arround, see for example Luarocks: use cmd mkdir msys2/MINGW-packages#12002Steps to reproduce:
lfs
is not installed:lfs
:lfs
is installed:lfs
:lfs
is uninstalled, however it is still there:lfs
:The text was updated successfully, but these errors were encountered: