-
-
Notifications
You must be signed in to change notification settings - Fork 416
Description
Your environment
Output of haskell-language-server --probe-tools or haskell-language-server-wrapper --probe-tools:
haskell-language-server version: 1.0.0.0 (GHC: 8.10.4) (PATH: ~/.cabal/store/ghc-8.10.4/haskell-language-server-1.0.0.0-e-haskell-language-server-1ccb8054dd41eefabc36fc46bada60160310e94370c7d465c71fa14b80cc4b92/bin/haskell-language-server)
Tool versions found on the $PATH
cabal: 3.5.0.0
stack: 2.1.3
ghc: 8.10.4Which lsp-client do you use: vim
Describe your project (alternative: link to the project): Small Cabal project using PCRE (direct cause of relocation issue)
Contents of hie.yaml:
cradle:
cabal:
component: "exe:czds-sync"Steps to reproduce
Just run HLS in project directory.
It first reports an error that appears to be non-fatal:
Internal error, getIdeGlobalExtras, no entry for IdeConfigurationVar
CallStack (from HasCallStack):
errorIO, called at src/Development/IDE/Core/Shake.hs:286:20 in
ghcide-1.0.0.0-73fbb4e8db1411321cea492eaa813d0d38f3b2388b5ffc2e3ec444c88d8af480:Development.IDE.Core.Shake
but ultimately fails with:
haskell-language-server: internal error: ~/.cabal/store/ghc-8.10.4/regex-pcre-builtin-0.95.1.3.8.43-1fe18e9c318087ece8506e808805c038df19c84d965df956d80847e334423e33/lib/libHSregex-pcre-builtin-0.95.1.3.8.43-1fe18e9c318087ece8506e808805c038df19c84d965df956d80847e334423e33.a: unhandled ELF relocation(RelA) type 19
(GHC version 8.10.4 for x86_64_portbld_freebsd)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
Abort trap
This is because on FreeBSD the ".a" file contains objects with symbols that require R_X86_64_TLSGD(19) relocation type, which is not handled by GHC's RTS linker.
Expected behaviour
Load the regex-pcre-builtin without relocation errors. Note that in the same directory as the problem ".a" file is also a ".so" shared object for the same library, and it would not run into the same relocation issue (contains to symbols requiring unsupported relocation types):
$ ls ~/.cabal/store/ghc-8.10.4/regex-pcre-builtin-0.95.1.3.8.43-1fe18e9c318087ece8506e808805c038df19c84d965df956d80847e334423e33/lib/
Paths_regex_pcre_builtin.dyn_hi
Paths_regex_pcre_builtin.hi
Text
libHSregex-pcre-builtin-0.95.1.3.8.43-1fe18e9c318087ece8506e808805c038df19c84d965df956d80847e334423e33-ghc8.10.4.so
libHSregex-pcre-builtin-0.95.1.3.8.43-1fe18e9c318087ece8506e808805c038df19c84d965df956d80847e334423e33.a
It is not obvious why HLS is loading the ".a" and not the ".so" (perhaps there's a good reason).
Include debug information
Execute in the root of your project the command haskell-language-server --debug . and paste the logs here:
Debug output:
$ haskell-language-server --debug
haskell-language-server version: 1.0.0.0 (GHC: 8.10.4) (PATH: ~/.cabal/store/ghc-8.10.4/haskell-language-server-1.0.0.0-e-haskell-language-server-1ccb8054dd41eefabc36fc46bada60160310e94370c7d465c71fa14b80cc4b92/bin/haskell-language-server)
ghcide setup tester in ~/dev/czds.
Report bugs at https://github.com/haskell/haskell-language-server/issues
Step 1/4: Finding files to test in ~/dev/czds
Found 6 files
Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle
(~/dev/czds/hie.yaml)
Step 3/4: Initializing the IDE
Step 4/4: Type checking the files
2021-03-03 01:15:29.139896678 [ThreadId 4] DEBUG hls: Set files of interest to: [(NormalizedFilePath "~/dev/czds/Opts.hs",OnDisk),(NormalizedFilePath "~/dev/czds/Constants.hs",OnDisk),(NormalizedFilePath "~/dev/czds/Task.hs",OnDisk),(NormalizedFilePath "~/dev/czds/BoundedLines.hs",OnDisk),(NormalizedFilePath "~/dev/czds/Types.hs",OnDisk),(NormalizedFilePath "~/dev/czds/Main.hs",OnDisk)]
2021-03-03 01:15:29.145060197 [ThreadId 29] INFO hls: File:
Hidden: no
Range: 1:1-2:1
Source: compiler
Severity: DsError
Message:
Internal error, getIdeGlobalExtras, no entry for IdeConfigurationVar
CallStack (from HasCallStack):
errorIO, called at src/Development/IDE/Core/Shake.hs:286:20 in
ghcide-1.0.0.0-73fbb4e8db1411321cea492eaa813d0d38f3b2388b5ffc2e3ec444c88d8af480:Development.IDE.Core.Shake
2021-03-03 01:15:29.148014343 [ThreadId 38] INFO hls: Consulting the cradle for "BoundedLines.hs"
Output from setting up the cradle Cradle {cradleRootDir = "~/dev/czds", cradleOptsProg = CradleAction: Cabal}
> Build profile: -w ghc-8.10.4 -O1
> In order, the following will be built (use -v for more details):
> - czds-sync-0.1.0.0 (exe:czds-sync) (first run)
> Preprocessing executable 'czds-sync' for czds-sync-0.1.0.0..
2021-03-03 01:15:29.617016053 [ThreadId 38] DEBUG hls: Session loading result: Right (ComponentOptions {componentOptions = ["-fbuilding-cabal-package","-O0","-outputdir","~/.cache/hie-bios/dist-czds-27173cfba5350883890f5f3355c1bc3f/build/x86_64-freebsd/ghc-8.10.4/czds-sync-0.1.0.0/x/czds-sync/build/czds-sync/czds-sync-tmp","-odir","~/.cache/hie-bios/dist-czds-27173cfba5350883890f5f3355c1bc3f/build/x86_64-freebsd/ghc-8.10.4/czds-sync-0.1.0.0/x/czds-sync/build/czds-sync/czds-sync-tmp","-hidir","~/.cache/hie-bios/dist-czds-27173cfba5350883890f5f3355c1bc3f/build/x86_64-freebsd/ghc-8.10.4/czds-sync-0.1.0.0/x/czds-sync/build/czds-sync/czds-sync-tmp","-stubdir","~/.cache/hie-bios/dist-czds-27173cfba5350883890f5f3355c1bc3f/build/x86_64-freebsd/ghc-8.10.4/czds-sync-0.1.0.0/x/czds-sync/build/czds-sync/czds-sync-tmp","-i","-i~/.cache/hie-bios/dist-czds-27173cfba5350883890f5f3355c1bc3f/build/x86_64-freebsd/ghc-8.10.4/czds-sync-0.1.0.0/x/czds-sync/build/czds-sync/czds-sync-tmp","-i.","-i~/.cache/hie-bios/dist-czds-27173cfba5350883890f5f3355c1bc3f/build/x86_64-freebsd/ghc-8.10.4/czds-sync-0.1.0.0/x/czds-sync/build/czds-sync/autogen","-i~/.cache/hie-bios/dist-czds-27173cfba5350883890f5f3355c1bc3f/build/x86_64-freebsd/ghc-8.10.4/czds-sync-0.1.0.0/x/czds-sync/build/global-autogen","-I~/.cache/hie-bios/dist-czds-27173cfba5350883890f5f3355c1bc3f/build/x86_64-freebsd/ghc-8.10.4/czds-sync-0.1.0.0/x/czds-sync/build/czds-sync/autogen","-I~/.cache/hie-bios/dist-czds-27173cfba5350883890f5f3355c1bc3f/build/x86_64-freebsd/ghc-8.10.4/czds-sync-0.1.0.0/x/czds-sync/build/global-autogen","-I~/.cache/hie-bios/dist-czds-27173cfba5350883890f5f3355c1bc3f/build/x86_64-freebsd/ghc-8.10.4/czds-sync-0.1.0.0/x/czds-sync/build/czds-sync/czds-sync-tmp","-optP-include","-optP~/.cache/hie-bios/dist-czds-27173cfba5350883890f5f3355c1bc3f/build/x86_64-freebsd/ghc-8.10.4/czds-sync-0.1.0.0/x/czds-sync/build/czds-sync/autogen/cabal_macros.h","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","~/.cabal/store/ghc-8.10.4/package.db","-package-db","~/.cache/hie-bios/dist-czds-27173cfba5350883890f5f3355c1bc3f/packagedb/ghc-8.10.4","-package-db","~/.cache/hie-bios/dist-czds-27173cfba5350883890f5f3355c1bc3f/build/x86_64-freebsd/ghc-8.10.4/czds-sync-0.1.0.0/x/czds-sync/package.conf.inplace","-package-id","aeson-1.5.6.0-ef4f9ad3f46269641858b5ec7da59175fc341eb2ee41e1485be7aadfdbfe159a","-package-id","base-4.14.1.0","-package-id","base-prelude-1.4-c276993236c1e798b91f6606d99f871c1f1ae79c9a56658692027299e49cc585","-package-id","bytestring-0.10.12.0","-package-id","case-insensitive-1.2.1.0-d68492cf1caf0f325f9ade62c30169414fbcc7118b0c3aee2cbd71d36e99f439","-package-id","conduit-1.3.4-8929b6a22c72b39621a16c1e404ed4bd9a72c79797917e68e7d936eccd9cbc67","-package-id","conduit-extra-1.3.5-0ab776c59ecd0187503f6a97ae0b7208159ed5c231ce1e42c0113650528c1290","-package-id","containers-0.6.4.1","-package-id","csv-conduit-0.7.2.0-56d3682d5d2ccd8dadfebd5a9cd854265a0c080bf3ef058d535041b17ef41988","-package-id","directory-1.3.6.0","-package-id","extra-1.7.9-c63a693dbc22faf462aeac146df0965540d4159524ee5397895070e34f72eacd","-package-id","http-conduit-2.3.8-5bf0ea5f4749e3f155d457305705041256efd6e766f1c19c4959c3341aa8080c","-package-id","http-types-0.12.3-7b3153d7a46d7a239d075681a6eaedfe779c52c70dece45d8ec3b618e934f640","-package-id","json-stream-0.4.2.4-8c6511eaf455341299847b32a1b402a7fcb3d69b48071db70e6816c9391cd894","-package-id","lifted-base-0.2.3.12-3ede491ba70f060390fef12d9a3c677ce18f77474b7bbf0854dcd01e704ee254","-package-id","monad-control-1.0.2.3-b95690c78ed643c4b9b972965febccf70eebb6285b366b8ae7a33c5cca33533e","-package-id","mtl-2.2.2","-package-id","optparse-applicative-0.16.1.0-eee378057b7539bcf75579d76e9f4ff170b047a9ccc498b6fe1ba5d2dfa9075a","-package-id","regex-with-pcre-1.1.0.0-22ab0614220f1411d0bcbffb991c1f6f1f4c82ef4a17acf931570f9f5796635d","-package-id","stm-2.5.0.0","-package-id","text-1.2.4.1","-package-id","time-1.9.3","-XHaskell2010","./Main.hs","BoundedLines","Constants","Opts","Task","Types","-Wall","-rtsopts","-hide-all-packages"], componentRoot = "~/dev/czds", componentDependencies = ["~/dev/czds/czds-sync.cabal","cabal.project","cabal.project.local"]},"~/.local/ghc-8.10/lib/ghc-8.10.4/lib")
2021-03-03 01:15:29.726404265 [ThreadId 38] INFO hls: Using interface files cache dir: ~/.cache/ghcide/main-63d8b9d8a1fa2307977aaeb5d467863a59cd7825
2021-03-03 01:15:29.726705585 [ThreadId 38] INFO hls: Making new HscEnv[main]
2021-03-03 01:15:29.746164968 [ThreadId 38] DEBUG hls: New Component Cache HscEnvEq: (([],Just HscEnvEq 56),fromList [("~/dev/czds/czds-sync.cabal",Just 2020-10-07 04:58:03.412536 UTC),("~/dev/czds/hie.yaml",Just 2021-02-28 08:41:17.20017 UTC),("cabal.project",Just 2021-02-28 08:44:40.456988 UTC),("cabal.project.local",Nothing)])
2021-03-03 01:15:29.746764239 [ThreadId 38] DEBUG hls: Known files updated: fromList [(TargetFile NormalizedFilePath "~/dev/czds/Opts.hs",["~/dev/czds/Opts.hs"]),(TargetFile NormalizedFilePath "~/dev/czds/Main.hs",["~/dev/czds/Main.hs"]),(TargetFile NormalizedFilePath "~/dev/czds/Types.hs",["~/dev/czds/Types.hs"]),(TargetFile NormalizedFilePath "~/dev/czds/Task.hs",["~/dev/czds/Task.hs"]),(TargetFile NormalizedFilePath "~/dev/czds/Constants.hs",["~/dev/czds/Constants.hs"]),(TargetFile NormalizedFilePath "~/dev/czds/BoundedLines.hs",["~dev/czds/BoundedLines.hs"])]
2021-03-03 01:15:29.747217289 [ThreadId 18] DEBUG hls: Finishing build session(exception: AsyncCancelled)
2021-03-03 01:15:29.747289666 [ThreadId 38] DEBUG hls: Restarting build session (aborting the previous one took 0.00s)
haskell-language-server: internal error: ~/.cabal/store/ghc-8.10.4/regex-pcre-builtin-0.95.1.3.8.43-1fe18e9c318087ece8506e808805c038df19c84d965df956d80847e334423e33/lib/libHSregex-pcre-builtin-0.95.1.3.8.43-1fe18e9c318087ece8506e808805c038df19c84d965df956d80847e334423e33.a: unhandled ELF relocation(RelA) type 19
(GHC version 8.10.4 for x86_64_portbld_freebsd)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
Abort trap