LuaLS / LuaLS/lua-language-server-rust
The generated executable depends on files in the source tree
Nessuno ha ancora preso questa issue.
- Lingua principale
- Lua
- Stelle
- 19
- Fork
- 6
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da crates/luals/src/main.rs, in particolare dal punto di ingresso main(), e da script/version.lua; esamina gli altri percorsi di caricamento dei file di runtime come suggerito. Compila l’eseguibile, quindi testalo con le directory di build e dei sorgenti non disponibili. Il lavoro è completato quando l’eseguibile viene eseguito senza file dell’albero dei sorgenti e comunica la propria versione senza analizzare il changelog a runtime.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- lua, rust
- Ambito
- build-system, devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100