From f0b03f1df1bcf03d4e0503ebfe458e0c2834df2d Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 1 Aug 2019 22:20:14 +0200 Subject: [PATCH] common/build-style/haskell-stack.sh: use --skip-ghc-check This forces all haskell-stack build-style using templates to use the system ghc and never download any binary distributions even if the version does not match. This is usually fine as long as the stackage used for the template is recent enough. If it's not, it should probably be bumped anyway. This also enables stack to work on all platforms, even those for which stack does not offer any binary ghc downloads, as long as the system ghc is provided, e.g. for ppc64le. --- common/build-style/haskell-stack.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/common/build-style/haskell-stack.sh b/common/build-style/haskell-stack.sh index 0443d07fc4..9eced02e18 100644 --- a/common/build-style/haskell-stack.sh +++ b/common/build-style/haskell-stack.sh @@ -5,6 +5,11 @@ # stackage="lts-X.Y" # or include a stack.yaml in $FILESDIR # do_build() { + # use --skip-ghc-check to really force stack to use the ghc in the system + # --system-ghc still downloads if stackage ghc version does not match ours + # this fails on all platforms other than x86_64 glibc when we bump ghc + local _stack_args="--system-ghc --skip-ghc-check" + if [ -f "${FILESDIR}/stack.yaml" ]; then msg_normal "Using stack config in stack.yaml.\n" cp "${FILESDIR}/stack.yaml" . @@ -16,15 +21,17 @@ do_build() { fi msg_normal "Using stackage resolver ${stackage}.\n" STACK_ROOT=$wrksrc/.stack \ - stack init --system-ghc --force --resolver ${stackage} + stack init ${_stack_args} --force --resolver ${stackage} fi - STACK_ROOT=$wrksrc/.stack stack --system-ghc ${makejobs} build \ + STACK_ROOT=$wrksrc/.stack stack ${_stack_args} ${makejobs} build \ ${make_build_args} } do_install() { + local _stack_args="--system-ghc --skip-ghc-check" + vmkdir usr/bin - STACK_ROOT=$wrksrc/.stack stack --system-ghc install \ + STACK_ROOT=$wrksrc/.stack stack ${_stack_args} install \ ${make_build_args} --local-bin-path=${DESTDIR}/usr/bin }