haskell / haskell/haskell-language-server

findExecutable in Wrapper.hs execute prebuilt's hls rather than 'cabal build''s output

Open
#4,711 1 comment 0 reactions 0 assignees View on GitHub
type: support
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
3d 21h
Merged PRs (30d)
13

Description

## Is your enhancement request related to a problem? Please describe.
1. According https://haskell-language-server.readthedocs.io/en/stable/contributing/contributing.html#building-with-nix. Using nix-shell to execute wrapper.
2. Executing `cabal run haskell-language-server-wrapper lsp`
3. Code run to https://github.com/haskell/haskell-language-server/blob/be30f3eb5bba59c50c084a324d432bfc2df24837/exe/Wrapper.hs#L157
4. The `mexe` found by `findExecutable` turns out as following. Rather than exe from `dist-newstyle` which contains `cabal build`'s output.
```
mexes =
[ Just "/nix/store/x4njcm292dm8wgqjhxyp4jxcx77sz3x2-haskell-language-server-2.10.0.0/bin/haskell-language-server-9.8.4"
, Just "/nix/store/x4njcm292dm8wgqjhxyp4jxcx77sz3x2-haskell-language-server-2.10.0.0/bin/haskell-language-server"
]
```
5. The exes on nix store is added in here. Rather than `cabal build`'s output
https://github.com/haskell/haskell-language-server/blob/be30f3eb5bba59c50c084a324d432bfc2df24837/flake.nix#L71

## Describe the solution you'd like
1. Maybe upgrade the documentation https://haskell-language-server.readthedocs.io/en/stable/contributing/contributing.html#building-with-nix. Using nix to compile and startup Wrapper?
2. Maybe change `findExecutable` way to find the `cabal build`'s exe?
3. Maybe precompile tools chains than import? https://github.com/haskell/haskell-language-server/blob/be30f3eb5bba59c50c084a324d432bfc2df24837/flake.nix#L71

## Describe alternatives you've considered
Or I need help, Maybe my execution method has issue.

## Additional context
None.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with exe/Wrapper.hs around the referenced findExecutable call, then inspect flake.nix around line 71 and the Nix building documentation. Reproduce the cabal run command in nix-shell and determine whether the intended outcome is documentation, executable-selection behavior, or toolchain precompilation. Done means one chosen approach is specified and its behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.