From 1b0222d573c58d2555446cb9fe824d50c4fcc364 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Wed, 5 Aug 2020 11:43:45 +0100 Subject: [PATCH] Build binaries with agpl flag Unforutnately, this also invovles vendoring Brittany with a fork that allows it to build on ghc-8.10.1. This is only vendored on the cabal.project file though, not the stack.yamls --- .github/workflows/build.yml | 6 ++---- cabal.project | 7 +++++++ exe/Main.hs | 2 -- haskell-language-server.cabal | 9 ++++----- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a66482c139..c0c24b8f12 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,10 +53,8 @@ jobs: echo '::set-env name=LINUX_CABAL_ARGS::--enable-executable-static --ghc-options=-split-sections' - name: Build Server - # Try building it twice in case of flakey builds on Windows run: | - cabal build exe:hls -O2 $LINUX_CABAL_ARGS || \ - cabal build exe:hls -O2 $LINUX_CABAL_ARGS -j1 + cabal build exe:hls -O2 -fagpl $LINUX_CABAL_ARGS - name: Compress Server Binary id: compress_server_binary @@ -95,7 +93,7 @@ jobs: - name: Build Wrapper if: matrix.ghc == '8.10.1' - run: cabal build exe:hls-wrapper -O2 $LINUX_CABAL_ARGS + run: cabal build exe:hls-wrapper -O2 -fagpl $LINUX_CABAL_ARGS - name: Compress Wrapper Binary if: matrix.ghc == '8.10.1' diff --git a/cabal.project b/cabal.project index c063a3fc3e..a9ba655e4e 100644 --- a/cabal.project +++ b/cabal.project @@ -2,6 +2,13 @@ packages: ./ ghcide +source-repository-package + type: git + location: https://github.com/infinity0/brittany.git + tag: 0807fc9b30eb9758dffdb87d2a9a9fa6a17a62b1 + +allow-newer: data-tree-print:base + tests: true package * diff --git a/exe/Main.hs b/exe/Main.hs index 5359e33101..54a05f5ef5 100644 --- a/exe/Main.hs +++ b/exe/Main.hs @@ -108,9 +108,7 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins , StylishHaskell.descriptor "stylish-haskell" , Retrie.descriptor "retrie" #if AGPL -#if !MIN_VERSION_ghc(8,10,1) , Brittany.descriptor "brittany" -#endif #endif , Eval.descriptor "eval" ] diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 3543db1c7e..4317520b3c 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -101,11 +101,10 @@ library else build-depends: unix if flag(agpl) - if impl(ghc < 8.10) - build-depends: - brittany - exposed-modules: - Ide.Plugin.Brittany + build-depends: + brittany + exposed-modules: + Ide.Plugin.Brittany ghc-options: -Wall