LuaLS / LuaLS/lua-language-server-rust
The generated executable depends on files in the source tree
還沒有人認領這個 Issue。
- 主要語言
- Lua
- 星號
- 19
- 分支
- 6
- PR 合併指標
- 30 天內沒有已合併 PR
描述
It is unexpected that the compiled executable requires the build dir to remain present. This additionally makes it problematic to include this software in any operating system distribution.
Currently the main() function sources main.lua at run-time using load() with a filename, and consequentially all of its required files are also read from the source tree at run-time. Furthermore version.lua parses the changelog at run-time to determine the version number. There might be more similar constructs. I have not looked further.
In order to make the built executable self-sustained, one might wish to use constructs which injects the actual Lua source files into the Rust source using e.g. include_str!(). The AsChunk trait has the required implementations for a &str to be given to load().
As for version strings, the best solution would probably to be solve issue #9, which would make the version string available at build-time in Rust context using the env!() macro with CARGO_PKG_VERSION. If that for some reason is not desired or possible, parsing the changelog at build time using a build.rs script would be an alternative.
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 crates/luals/src/main.rs 開始,特別是 main() 進入點和 script/version.lua;依照建議檢查其他執行期檔案載入路徑。建置可執行檔,然後在建置目錄和原始碼目錄無法使用的情況下測試它。當可執行檔不需要原始碼樹中的檔案即可執行,並且不在執行期解析 changelog 就能回報其版本時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- lua, rust
- 領域
- build-system, devtools
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100