Skip to content

Commit b85ba4b

Browse files
committed
wrapper.in: Allow runtime ghc-pkgs to be a subset of compile-time ghc-pkgs
This still makes sure that ghc has been compiled with the same core libraries as hls while it allows runtime environments where other packages have been added to the ghc-pkg database. This commit also adds that file to the sdist, so that distro packagers can use it.
1 parent b289e48 commit b85ba4b

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

GNUmakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ bindist-ghc:
106106
$(SED) \
107107
-e "s/@@EXE_NAME@@/haskell-language-server-$(GHC_VERSION)/" \
108108
-e "s/@@GHC_VERSION@@/$(GHC_VERSION)/" \
109+
-e "s/@@PKG_LIST@@/$(shell ghc-pkg-$(GHC_VERSION) --global list --simple-output)/" \
109110
-e "s/@@ABI_HASHES@@/$(shell for dep in `ghc-pkg-$(GHC_VERSION) --global list --simple-output` ; do printf "%s:" "$$dep" && ghc-pkg-$(GHC_VERSION) field $$dep abi --simple-output ; done | tr '\n' ' ' | xargs)/" \
110111
bindist/wrapper.in > "$(BINDIST_OUT_DIR)/haskell-language-server-$(GHC_VERSION).in"
111112
$(CHMOD_X) "$(BINDIST_OUT_DIR)/haskell-language-server-$(GHC_VERSION).in"

bindist/wrapper.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
exedir="@@EXE_DIR@@"
44
executablename="@@EXE_NAME@@"
55
GHC_VERSION="@@GHC_VERSION@@"
6+
PKG_LIST="@@PKG_LIST@@"
67
ABI_HASHES="@@ABI_HASHES@@"
78

89
debug_msg() {
@@ -73,7 +74,7 @@ check_ghc() {
7374
return 1
7475
fi
7576
PKGCONF="${check_ghc_libdir}/package.conf.d"
76-
MY_ABI_HASHES="$(for dep in $("${GHC_PKG}" --global --global-package-db "$PKGCONF" list --simple-output) ; do printf "%s:" "${dep}" && "${GHC_PKG}" --global --global-package-db "$PKGCONF" field "${dep}" abi --simple-output ; done | tr '\n' ' ' | xargs)"
77+
MY_ABI_HASHES="$(for dep in ${PKG_LIST} ; do printf "%s:" "${dep}" && "${GHC_PKG}" --global --global-package-db "$PKGCONF" field "${dep}" abi --simple-output ; done | tr '\n' ' ' | xargs)"
7778
if [ "${ABI_HASHES}" != "${MY_ABI_HASHES}" ] ; then
7879
err_abi "${MY_ABI_HASHES}"
7980
return 3

haskell-language-server.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ extra-source-files:
2222
test/testdata/**/*.cabal
2323
test/testdata/**/*.yaml
2424
test/testdata/**/*.hs
25+
bindist/wrapper.in
2526

2627
flag pedantic
2728
description: Enable -Werror

0 commit comments

Comments
 (0)