Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Improvements of install script and macos-installhs-cabal new azure job #1665

Merged
merged 17 commits into from
Feb 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .azure/linux-cabal.bashrc
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
if [ -z "$PROJECT_FILE" ]; then
export PROJECT_FILE="cabal.project"
if [ -f "cabal.project-$GHC_VERSION" ]; then
export PROJECT_FILE="cabal.project-$GHC_VERSION"
fi
fi
export PATH=$HOME/.cabal/bin:/opt/cabal/$CABAL_VERSION/bin:/opt/ghc/$GHC_VERSION/bin:$HOME/.local/bin:$PATH
27 changes: 12 additions & 15 deletions .azure/linux-cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ jobs:
vmImage: ubuntu-16.04
strategy:
matrix:
# Fail with compilation error building haddock-api
# ghc-8.8.2:
# GHC_VERSION: "8.8.2"
ghc-8.8.1:
GHC_VERSION: "8.8.1"
ghc-8.8.2:
GHC_VERSION: "8.8.2"
ghc-8.6.5:
GHC_VERSION: "8.6.5"
ghc-8.4.4:
Expand Down Expand Up @@ -43,24 +40,24 @@ jobs:
displayName: Install ghc
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-update
cabal v2-update --project-file $PROJECT_FILE
echo "overwrite-policy: always" >> $HOME/.cabal/config
displayName: Update cabal
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-build --disable-tests --disable-benchmarks --only-dependencies
cabal v2-build --disable-tests --disable-benchmarks --only-dependencies --project-file $PROJECT_FILE
displayName: Build dependencies
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-build --disable-tests --disable-benchmarks
cabal v2-build --disable-tests --disable-benchmarks --project-file $PROJECT_FILE
displayName: Build `hie`
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-install # `hie` binary required locally for tests
cabal v2-install --project-file $PROJECT_FILE # `hie` binary required locally for tests
displayName: Install `hie`
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-build --enable-tests --enable-benchmarks --only-dependencies
cabal v2-build --enable-tests --enable-benchmarks --only-dependencies --project-file $PROJECT_FILE
displayName: Build Test-dependencies
- bash: |
sudo apt update
Expand All @@ -73,20 +70,20 @@ jobs:
displayName: "Install Runtime Test-Dependencies: liquidhaskell"
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-build hoogle
cabal v2-exec hoogle generate
cabal v2-build hoogle --project-file $PROJECT_FILE
cabal v2-exec hoogle generate --project-file $PROJECT_FILE
displayName: "Install Runtime Test-Dependencies: hoogle database"
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-test :unit-test
cabal v2-test :unit-test --project-file $PROJECT_FILE
displayName: "Run Test: unit-test"
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-test :dispatcher-test :plugin-dispatcher-test :wrapper-test
cabal v2-test :dispatcher-test :plugin-dispatcher-test :wrapper-test --project-file $PROJECT_FILE
displayName: "Run Test: dispatcher-test, plugin-dispatcher-test and wrapper-test"
- bash: |
source .azure/linux-cabal.bashrc
cabal v2-test :func-test
cabal v2-test :func-test --project-file $PROJECT_FILE
displayName: "Run Test: func-test"
- bash: |
mkdir -p .azure-cache
Expand Down
8 changes: 8 additions & 0 deletions .azure/macos-cabal.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if [ -z "$PROJECT_FILE" ]; then
export PROJECT_FILE="cabal.project"
if [ -f "cabal.project-$GHC_VERSION" ]; then
export PROJECT_FILE="cabal.project-$GHC_VERSION"
fi
fi
export CABAL_ROOT=$HOME/.cabal
export PATH=$CABAL_ROOT/bin:$PATH
42 changes: 42 additions & 0 deletions .azure/macos-installhs-cabal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
jobs:
- job: MacOs_installhs_Cabal
timeoutInMinutes: 0
pool:
vmImage: macOS-10.14
variables:
PROJECT_FILE: "./install/shake.project"
steps:
- task: Cache@2
inputs:
key: '"cabal-installhs" | "$(Agent.OS)" | $(Build.SourcesDirectory)/cabal.project | $(Build.SourcesDirectory)/haskell-ide-engine.cabal | $(Build.SourcesDirectory)/hie-plugin-api/hie-plugin-api.cabal'
path: .azure-cache
cacheHitVar: CACHE_RESTORED
displayName: "Download cache"
- bash: |
source .azure/macos-cabal.bashrc
mkdir -p $CABAL_ROOT
tar -vxzf .azure-cache/cabal-root.tar.gz -C /
mkdir -p dist-newstyle
tar -vxzf .azure-cache/cabal-dist.tar.gz
displayName: "Unpack cache"
condition: eq(variables.CACHE_RESTORED, 'true')
- bash: |
brew install cabal-install
which cabal
which ghc
cabal update
displayName: Install cabal and ghc
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-run ./install.hs --project-file $PROJECT_FILE -- help
displayName: Run help of `install.hs`
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-run ./install.hs --project-file $PROJECT_FILE -- latest
displayName: Run latest target of `install.hs`
- bash: |
source .azure/macos-cabal.bashrc
mkdir -p .azure-cache
tar -vczf .azure-cache/cabal-root.tar.gz $CABAL_ROOT
tar -vczf .azure-cache/cabal-dist.tar.gz dist-newstyle
displayName: "Pack cache"
10 changes: 5 additions & 5 deletions .azure/macos-installhs-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ jobs:
tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin;
displayName: Install stack
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
stack setup --stack-yaml $(YAML_FILE)
displayName: Install GHC
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
stack --stack-yaml $(YAML_FILE) --install-ghc build --only-dependencies
displayName: Build dependencies
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
stack build --stack-yaml $(YAML_FILE)
displayName: Build `hie-install`
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
stack install.hs help
displayName: Run help of `install.hs`
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
stack install.hs latest
displayName: Run latest target of `install.hs`
- bash: |
Expand Down
File renamed without changes.
22 changes: 11 additions & 11 deletions .azure/macos-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ jobs:
tar vxz --strip-components=1 --include '*/stack' -C ~/.local/bin;
displayName: Install stack
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
stack setup --stack-yaml $(YAML_FILE)
displayName: Install GHC
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
stack --stack-yaml $(YAML_FILE) --install-ghc build --only-dependencies
displayName: Build dependencies
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
stack build --stack-yaml $(YAML_FILE)
displayName: Build `hie`
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
stack install --stack-yaml $(YAML_FILE) # `hie` binary required locally for tests
mkdir .azure-deploy
stack install --stack-yaml $(YAML_FILE) --local-bin-path .azure-deploy
Expand All @@ -76,7 +76,7 @@ jobs:
tar -vczf $(Build.ArtifactStagingDirectory)/$ARTIFACT_NAME.tar.xz *
displayName: Install `hie`
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
stack build --stack-yaml $(YAML_FILE) --test --bench --only-dependencies
displayName: Build Test-dependencies
- bash: |
Expand All @@ -86,26 +86,26 @@ jobs:
brew install z3
displayName: "Install Runtime Test-Dependencies: z3"
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
stack install --resolver=lts-13.20 liquid-fixpoint-0.8.0.2 liquidhaskell-0.8.6.2
displayName: "Install Runtime Test-Dependencies: liquidhaskell"
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
stack build hoogle --stack-yaml=$(YAML_FILE)
# This step frequently fails with http 403
stack exec hoogle generate --stack-yaml=$(YAML_FILE) || stack exec hoogle generate --stack-yaml=$(YAML_FILE)
displayName: "Install Runtime Test-Dependencies: hoogle database"
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
brew install cabal-install
displayName: "Install Runtime Unit Test-Dependencies: cabal"
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
stack test :unit-test --stack-yaml $(YAML_FILE)
displayName: "Run Test: unit-test"
# TODO: Enable dispatcher-test for ghc-8.4.*
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
if [ $GHC_MAJOR_VERSION != "8.4" ]; then
TEST_TARGETS=:dispatcher-test :plugin-dispatcher-test :wrapper-test
Expand All @@ -117,7 +117,7 @@ jobs:
condition: False
# TODO: Enable func-test for ghc-8.4.*
- bash: |
source .azure/macos.bashrc
source .azure/macos-stack.bashrc
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
if [ $GHC_MAJOR_VERSION != "8.4" ]; then
stack test :func-test --stack-yaml $(YAML_FILE)
Expand Down
6 changes: 6 additions & 0 deletions .azure/windows-cabal.bashrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
if [ -z "$PROJECT_FILE" ]; then
export PROJECT_FILE="cabal.project"
if [ -f "cabal.project-$GHC_VERSION" ]; then
export PROJECT_FILE="cabal.project-$GHC_VERSION"
fi
fi
if [ -z "$CABAL_DIR" ]; then
CABAL_DIR="$APPDATA\\cabal"
fi
Expand Down
25 changes: 13 additions & 12 deletions .azure/windows-cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ jobs:
vmImage: windows-2019
strategy:
matrix:
# It still is not in chocolatey
# ghc versions 8.8.1 and 8.8.2 are not usable in windows
# due to https://gitlab.haskell.org/ghc/ghc/issues/17575
# ghc-8.8.2:
# GHC_VERSION: "8.8.2"
ghc-8.6.5:
Expand Down Expand Up @@ -51,28 +52,28 @@ jobs:
displayName: Install cabal
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-update
cabal v2-update --project-file $PROJECT_FILE
echo "store-dir: $CABAL_STORE_DIR" >> $CABAL_ROOT/config
echo "overwrite-policy: always" >> $CABAL_ROOT/config
displayName: Update cabal
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-build all --disable-tests --disable-benchmarks --only-dependencies
cabal v2-build all --disable-tests --disable-benchmarks --only-dependencies --project-file $PROJECT_FILE
displayName: Build dependencies
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-build all --disable-tests --disable-benchmarks
cabal v2-build all --disable-tests --disable-benchmarks --project-file $PROJECT_FILE
displayName: Build `hie`
- bash: |
source .azure/windows-cabal.bashrc
# `hie` binary required locally for tests
# we have to use a separate store for install and builds
# to workaround https://github.com/haskell/cabal/issues/6483
cabal --store-dir ${CABAL_STORE_DIR}i v2-install
cabal --store-dir ${CABAL_STORE_DIR}i v2-install --project-file $PROJECT_FILE
displayName: Install `hie`
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-build all --enable-tests --enable-benchmarks --only-dependencies
cabal v2-build all --enable-tests --enable-benchmarks --only-dependencies --project-file $PROJECT_FILE
displayName: Build Test-dependencies
- bash: |
mkdir -p /usr/local
Expand All @@ -88,31 +89,31 @@ jobs:
displayName: "Install Runtime Test-Dependencies: liquidhaskell"
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-build hoogle
cabal v2-exec hoogle generate
cabal v2-build hoogle --project-file $PROJECT_FILE
cabal v2-exec hoogle generate --project-file $PROJECT_FILE
displayName: "Install Runtime Test-Dependencies: hoogle database"
- bash: |
curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip
unzip -o /usr/bin/stack.zip -d /usr/bin/
mkdir -p "$STACK_ROOT"
# If we don't install the ghc used in test projects in advance, tests fail
# If we don't install the ghc used in test projects in advance, tests fail
stack setup --stack-yaml stack-${GHC_VERSION}.yaml
displayName: "Install Runtime Unit Test-Dependencies: stack"
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-test :unit-test
cabal v2-test :unit-test --project-file $PROJECT_FILE
displayName: "Run Test: unit-test"
- bash: |
source .azure/windows-cabal.bashrc
# Needed for wrapper-test
stack setup --stack-yaml stack-8.8.1.yaml
stack setup --stack-yaml stack-8.6.5.yaml
# TODO Enable :dispatcher-test suite
cabal v2-test :plugin-dispatcher-test :wrapper-test # :dispatcher-test
cabal v2-test :plugin-dispatcher-test :wrapper-test # :dispatcher-test --project-file $PROJECT_FILE
displayName: "Run Test: dispatcher-test, plugin-dispatcher-test and wrapper-test"
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-test :func-test
cabal v2-test :func-test --project-file $PROJECT_FILE
displayName: "Run Test: func-test"
- bash: |
source .azure/windows-cabal.bashrc
Expand Down
2 changes: 1 addition & 1 deletion .azure/windows-installhs-cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-run ./install.hs --project-file $PROJECT_FILE latest
displayName: Run build-latest target of `install.hs`
displayName: Run latest target of `install.hs`
- bash: |
source .azure/windows-cabal.bashrc
mkdir -p .azure-cache
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ jobs:
- template: ./.azure/linux-installhs-stack.yml
- template: ./.azure/windows-installhs-stack.yml
- template: ./.azure/windows-installhs-cabal.yml
- template: ./.azure/macos-installhs-cabal.yml
- template: ./.azure/macos-installhs-stack.yml
32 changes: 32 additions & 0 deletions cabal.project-8.8.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
packages:
./
./hie-plugin-api/

-- ./submodules/HaRe

-- To avoid build error with ghc-8.8.2
-- See https://github.com/haskell/haddock/issues/1123
source-repository-package
type: git
location: https://github.com/haskell/haddock.git
subdir: haddock-api
tag: be8b02c4e3cffe7d45b3dad0a0f071d35a274d65

source-repository-package
type: git
location: https://github.com/jneira/cabal-helper.git
tag: ffb1f57a5ffc6b7ac3c46a9974c4420a6d2bb9b2

tests: true

package haskell-ide-engine
test-show-details: direct

-- Match the flag settings we use in stac builds
constraints:
haskell-ide-engine +pedantic
hie-plugin-api +pedantic

write-ghc-environment-files: never

index-state: 2020-02-05T07:49:28Z
2 changes: 1 addition & 1 deletion install/hie-install.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: hie-install
version: 0.8.0.0
version: 0.8.1.0
synopsis: Install the haskell-ide-engine
license: BSD3
author: Many, TBD when we release
Expand Down
Loading