actboy168 / lua-debug

Lua Debug Adapter for Visual Studio Code
MIT License
431 stars 93 forks source link

ignoring `path` and `cpath`? #202

Open Frityet opened 1 year ago

Frityet commented 1 year ago

The debug seems to be ignoring what I set for path/cpath

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lua",
            "request": "launch",
            "name": "Debug",
            "program": "${workspaceFolder}/lua_modules/lib/luarocks/rocks-5.1/thor/dev-1/bin/thor.lua",
            "path": "${workspaceFolder}/lua_modules/share/lua/5.1/?.lua;${workspaceFolder}/lua_modules/share/lua/5.1/?/init.lua",
            "cpath": "${workspaceFolder}/lua_modules/lib/lua/5.1/?.so",
            "luaVersion": "jit",
            "stopOnEntry": false,
            "luaexe": "${workspaceFolder}/lua",
            "preLaunchTask": "Build"
        }
    ]
}
❯  cd /Users/frityet/Documents/Thor ; /Users/frityet/Documents/Thor/lua -e dofile\"/Users/frityet/.vscode/extensions/actboy168.lua-debug-1.60.1-darwin-x64/script/launch.lua\"\;DBG\"96815-ansi\" /Users/frityet/Documents/Thor/lua_modules/lib/luarocks/rocks-5.1/thor/dev-1/bin/thor.lua
/usr/local/opt/luajit/bin/luajit-2.1.0-beta3: error loading module 'ssl.core' from file '/usr/local/share/lua/':
        dlopen(/usr/local/share/lua/, 0x0006): tried: '/usr/local/share/lua/' (not a file), '/usr/local/Cellar/luarocks/3.9.1/share/lua' (not a file)
stack traceback:
        [C]: at 0x01071d4af2
        [C]: in function 'require'
        ...frityet/Documents/Thor/lua_modules/share/lua/5.1/ssl.lua:8: in main chunk
        [C]: in function 'require'
        ...t/Documents/Thor/lua_modules/share/lua/5.1/ssl/https.lua:10: in main chunk
        [C]: in function 'require'
        ...a_modules/lib/luarocks/rocks-5.1/thor/dev-1/bin/thor.lua:1: in main chunk
        [C]: at 0x010718436c
actboy168 commented 1 year ago

Fails in dlopen, which is not something cpath or path can change.

Frityet commented 1 year ago

Fails in dlopen, which is not something cpath or path can change.

why is it failing? running manually works fine

Frityet commented 1 year ago

its tryna dlopen a directory, this is lua-debug doing this, right?

Frityet commented 1 year ago

Printing out the cpath gives me this. the extension is adding these errors

/Users/frityet/Documents/Thor/lua_modules/lib/lua/5.1/?.so;/usr/local/share/lua/;/usr/local/lib/lua/;%{workspaceFolder}/?.so
Frityet commented 1 year ago

the first one is correct, the next ones are not

Frityet commented 1 year ago

Got it to work, but in the worst way.

package.cpath = "/Users/frityet/Documents/Thor/lua_modules/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/?.so"

this is bad, but it works, I would like a real fix