和Python的pip对比lua的luarocks,luarocks并没有想象中那么简单好用!!这根本不是一个等级。

2021-02-06 18:50:25
收藏数:0
阅读数:317
评论数:0

接触lua有半年了,最让我印象深刻的是这个语言比较好学,但是要安装某些库就和它有点格格不入了,并不是安装上了luarocks包管理器就会得心应手,而是各种入坑,和python的pip对比,lua的包管理器给人伤害明显。 举个栗子说说安装luasql或luasocket库,你以为的luarocks install luasql-sqlite3或mysql只是梦想的开始,当你点击回车后直接就是噩梦的结束,这个落差,无法言喻,伤害太深,当你尝试各种搜索,并不能搜到你想要的答案。所以这门语言感觉是真的被人遗忘了。为什么这么简单好用好学的语言会落后至如此地步,我为这感到可惜!!! 图片 Microsoft Windows [版本 10.0.18363.1316] (c) 2019 Microsoft Corporation。保留所有权利。

C:\Users\Robot>luarocks install luasql-sqlite3 Installing https://luarocks.org/luasql-sqlite3-2.6.0-1.rockspec Cloning into 'luasql'... remote: Enumerating objects: 149, done. remote: Counting objects: 100% (149/149), done. remote: Compressing objects: 100% (99/99), done. remote: Total 149 (delta 72), reused 72 (delta 36), pack-reused 0 eceiving objects: 86% (129/149), 60 Receiving objects: 100% (149/149), 104.13 KiB | 8.00 KiB/s, done. Resolving deltas: 100% (72/72), done. Note: switching to '22d4a911f35cf851af9db71124e3998d96fb3fa1'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example:

git switch -c

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

luasql-sqlite3 2.6.0-1 depends on lua >= 5.1 (5.4-1 provided by VM) C:\local\MinGW-17.1\MinGW\bin\gcc.exe -O2 -c -o src/luasql.o -IC:\local\lua-5.4.2\dist\include src/luasql.c -Ic:/mingw/include C:\local\MinGW-17.1\MinGW\bin\gcc.exe -O2 -c -o src/ls_sqlite3.o -IC:\local\lua-5.4.2\dist\include src/ls_sqlite3.c -Ic:/mingw/include C:\local\MinGW-17.1\MinGW\bin\gcc.exe -shared -o luasql/sqlite3.dll src/luasql.o src/ls_sqlite3.o -Lc:/mingw -lsqlite3 C:\local\lua-5.4.2\dist\bin/lua54.dll -lm c:/local/mingw-17.1/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsqlite3 collect2.exe: error: ld returned 1 exit status

Error: Build error: Failed compiling module luasql/sqlite3.dll

C:\Users\Robot>luarocks install luasql-mysql Installing https://luarocks.org/luasql-mysql-2.6.0-1.rockspec Cloning into 'luasql'... remote: Enumerating objects: 149, done. remote: Counting objects: 100% (149/149), done. remote: Compressing objects: 100% (99/99), done. remote: Total 149 (delta 72), reused 72 (delta 36), pack-reused 0 eceiving objects: 85% (127/ Receiving objects: 100% (149/149), 104.13 KiB | 7.00 KiB/s, done. Resolving deltas: 100% (72/72), done. Note: switching to '22d4a911f35cf851af9db71124e3998d96fb3fa1'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example:

git switch -c

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Error: Could not find header file for MYSQL No file mysql.h in c:/external/include No file mysql.h in c:/mingw/include No file mysql.h in c:/windows/system32/include You may have to install MYSQL in your system and/or pass MYSQL_DIR or MYSQL_INCDIR to the luarocks command. Example: luarocks install luasql-mysql MYSQL_DIR=/usr/local

C:\Users\Robot>where lua C:\local\lua-5.4.2\dist\bin\lua.exe

C:\Users\Robot>where luarocks C:\local\LuaRocks-3.5.0\luarocks.bat

C:\Users\Robot>luarocks install luasocket Installing https://luarocks.org/luasocket-3.0rc1-2.src.rock c:/local/mingw-17.1/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\temp\gcc\build-mingw-w64\mingw-w64-crt/../../src/mingw-w64-crt/crt/pseudo-reloc.c:150: undefined reference to `__acrt_iob_func' collect2.exe: error: ld returned 1 exit status

Error: Build error: Failed compiling module socket/core.dll