Add --version support to NLS and fix feature unification issues #1936
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds
--version
support for thenls
binary, using the same scheme as for the mainnickel
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 fornickel-lang-cli
by chance, thanks to feature unification (throughcomrak
which is used for thedoc
feature). In fact buildingnickel-lang-cli
without the default features is failing on current master, because the absence ofdoc
doesn't pullcomrak
in, which doesn't enable thestring
feature.This PR fixes the compilation issue by adding the missing
string
feature to theclap
dependency for both the cli and the lsp. We also makenickel-lang-lsp
also depend onnickel-lang-core
without the default featurs (as most of them are useless for the LSP), and we fix another unrelated compilation error ofnickel-lang-cli
without default features by makingnickel-lang-core
always exporteval_record_spine
, which would only be included when thedoc
feature was enabled before, but is actually used for other purposes now (namely the CLI customize mode).