tweag / nickel

Better configuration for less
https://nickel-lang.org/
MIT License
2.23k stars 85 forks source link

Add --version support to NLS and fix feature unification issues #1936

Closed yannham closed 1 month ago

yannham commented 1 month ago

This PR adds --version support for the nls binary, using the same scheme as for the main nickel binary. Its absence made it hard to know which version of NLS users would currently run, which isn't great for chasing bugs.

Doing so, I discovered some underlying feature unification issues that were here but just invisible, namely that the little stunt we pull off for generating versions in different environments (in the git repo, building for crates.io and the nixified version) requires the string feature of clap, but we didn't enable this feature explicitly anywhere. It just happened that it was enabled previously for nickel-lang-cli by chance, thanks to feature unification (through comrak which is used for the doc feature). In fact building nickel-lang-cli without the default features is failing on current master, because the absence of doc doesn't pull comrak in, which doesn't enable the string feature.

This PR fixes the compilation issue by adding the missing string feature to the clap dependency for both the cli and the lsp. We also make nickel-lang-lsp also depend on nickel-lang-core without the default featurs (as most of them are useless for the LSP), and we fix another unrelated compilation error of nickel-lang-cli without default features by making nickel-lang-core always export eval_record_spine, which would only be included when the doc feature was enabled before, but is actually used for other purposes now (namely the CLI customize mode).