I previously asked this question about Wireshark setup for running Lua's CLRPackage and it was answered here. The problem is, after version 1.10.9, it appears that some startup search paths or something related have changed. Could someone provide the changes that occurred after 1.10.9 that affect where libraries and other scripts are searched? I receive the following error if I run the setup with any version after 1.10.9: The line in init.lua is:
Update I looks like this is from a previous init.lua file that was being copied, after updating to the latest version, the error is now: Update 2 To answer some of the questions:
It was placed in the
I actually dont see this file anywhere, but there is a
This is the code: Update 3 Update for additional questions
I looked inside of the CLRPackage.lua and I dont see any place it appends to the cpath. The test program that is included does however append the
I didnt compile any of the files provided, I just copied them from the zip file provided. I've tried to compile them using VS2010 but I havent had any luck.
Here is the complete list: asked 02 Feb '15, 06:29 SwDevMan81 edited 02 Feb '15, 11:52 showing 5 of 10 show 5 more comments |
One Answer:
I doubt that Luainterface will work with Wireshark anymore, because it looks like it was compiled for Lua 5.0 and 5.1 compatibility, but not 5.2. But you can find out... to get past the current issue of not finding the "
Hopefully that should make Wireshark's Lua find the answered 02 Feb '15, 19:35 Hadriel I think you are right. I also added (03 Feb '15, 05:32) SwDevMan81 @Hadriel - I'm trying to build against Lua 5.2, but I'm having some porting issues. Is there any chance you could help with conversion. I tried NLua and it doesnt appear to support the stock Lua 5.2 source (I think theyve made modifications, which wont help when using the Lua thats built in Wireshark). The questions are here (05 Feb '15, 11:13) SwDevMan81 Unfortunately I don't use Windows nor have a Windows system. (12 Feb '15, 10:44) Hadriel @Hadriel - No problem, I've actually got it to work now. I took the LuaInterface code and updated it for Lua 5.2 and compiled with VS 2010 targeting .NET 4.0 and Lua52.dll. I actually went back and built the LuaInterface for Lua 5.1 with VS 2010 targeting .NET 2.0 and Lua5.1.dll. I dont have a good place to host these but I could put them somewhere if you have a recommendation. Then I'll provide an answer to how to install like the previous question detailed. Thanks for the support on this, the answer you provided led me in the right direction. (12 Feb '15, 11:18) SwDevMan81 @SwDevMan81 Hi could you elaborate on how you did it exactely so that we could try to build LuaInterface code and update it for Lua 5.2 as well? Thank you (06 Mar '15, 05:40) smuellener |
Just to be clear: it was working fine in 1.10.9 but failed in 1.10.10?
@Hadriel - So I went through all the revisions to determine when it actually broke. It looks like it stopped working at 1.11.3, which looks like a change from Lua 5.1 to 5.2.
A lot changed for Wireshark's Lua in version 1.11.3. I'm not sure this is related to the change to Lua 5.2, though, because the error message above appears to show wireshark can't find the "luanet" Lua module in the path. The various directory paths that it's trying are missing the subdirectory that file is in, presumably.
So some questions: How did you load the "CLRPackage.lua" file? Did you put it in Wireshark's personal plugins directory, or load it using "
dofile()
", or load it from the command line using the "-X lua_script:...
" command? And where exactly is the "luanet.lua" file? And what is line 15 of CLRPackage.lua?@Hadriel - I update the question to address your questions. Let me know if you need more. All the locations and files that I copied match the answer provided here
OK, so the problem is that "
luanet.dll
" is a binary module, which means its directory (the "clibs" one) needs to be in Lua's "package.cpath
" global variable, and it's not. There was a change in 1.11.3 to handle the various changes to environments, Lua 5.2., and module paths... but it only changed/fixed the Lua "package.path
" variable, not "package.cpath
" (this change).So I can fix that, but I'm not sure it will be enough, because it won't add "
clibs
" because that's not a default directory, of either Lua or Wireshark. I don't know how this worked even before 1.11.3, unless CLRPackage.lua amended the cpath.So some more questions: How did you get CLRPackage installed? Did you need to compile Wireshark from source code to use CLRPackage? Or did you need to install LuaRocks or some other package?
What are your Wireshark personal and global plugins directories named? Open Wireshark, go to Help->About Wireshark, and click on the Folders tab. It will list a personal and global plugins directories.
@Hadriel - Updated with more information, thanks for the help on this.
Well those plugin directories look normal, so I can't figure out why "
CLRPackage.lua
" was loaded at all to begin with, since it's not in one of those plugin directories. Are there any Lua files in those plugin directories? (even an "init.lua
")@Hadriel - If I navigate to the
Personal Plugins
andGlobal Plugins
, there are no lua scripts in those folders.Do you remember where you got the CLRPackage zip file? I googled but got various hits, none of which look like the definitive source.
@Hadriel - I downloaded it from here. Inside the zip file, its
LuaInterface > LuaInterface > lua > CLRPackage.lua