LuaLS / LuaLS/lua-language-server

`luamake test` doesn't find packages

未关闭
#2,855 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Lua
星标
4.4k
派生
442
PR 合并指标
30 天内没有已合并 PR

描述

How are you using the lua-language-server?

Command Line

Which OS are you using?

MacOS

What is the issue affecting?

Other

Expected Behaviour

luamake test runs the same tests with the same results as luamake rebuild

Actual Behaviour

luamake rebuild works.

luamake test can't find packages:

module 'log' not found:
        no field package.preload['log']
        no file 'log.lua'
        no file 'log/init.lua'
        no file './test/log.lua'
        no file './test/log/init.lua'
        no file 'log.so'
        no file 'build/bin/log.so'
stack traceback:
        /Users/sparr/src/lua-language-server/test.lua:20: in main chunk

Updating package.path to point to the log module leads to another failed package load, then multiple additions to package.path to find more modules, eventually leading to needing to compile lpeglabel.so manually, then a dead end when I couldn't figure out how to resolve this one (note the new paths being searched from all the additions I made to package.path to get this far)

module 'luamake' not found:
        no field package.preload['luamake']
        no file 'luamake.lua'
        no file 'luamake/init.lua'
        no file './test/luamake.lua'
        no file './test/luamake/init.lua'
        no file './script/luamake.lua'
        no file './script/luamake/init.lua'
        no file './test/plugins/ffi/luamake.lua'
        no file './make/luamake.lua'
        no file 'luamake.so'
        no file 'build/bin/luamake.so'
stack traceback:
        ...rs/clarence/src/lua-language-server/make/code_format.lua:1: in main chunk
        ...e/src/lua-language-server/script/provider/formatting.lua:1: in main chunk
        ...e/src/lua-language-server/script/provider/capability.lua:8: in main chunk
        ...nce/src/lua-language-server/script/provider/provider.lua:2: in main chunk
        /Users/clarence/src/lua-language-server/script/lclient.lua:11: in main chunk
        /Users/clarence/src/lua-language-server/test.lua:82: in local 'main'
        /Users/clarence/src/lua-language-server/test.lua:119: in main chunk
Reproduction steps
  1. Run 3rd/luamake/luamake rebuild
  2. Run 3rd/luamake/luamake test
Additional Notes

No response

Log File

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

先运行报告中的命令 3rd/luamake/luamake rebuild3rd/luamake/luamake test,并比较它们的包路径。阅读 test.lua,然后通过 make/code_format.lua 和其中引用的 script 文件跟踪失败的导入。完成的标准是 luamake test 能找到它的包,并以与 luamake rebuild 相同的结果运行相同的测试。

由索引模型根据 Issue 内容生成。

评估

技术栈
lua
领域
build-system, cli, testing
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。