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

Commit f34aaca

Browse files
committed
Merge upstream
2 parents e50676c + 9e9432a commit f34aaca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1636
-514
lines changed

.azure/linux-cabal.bashrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export PATH=$HOME/.cabal/bin:/opt/cabal/$CABAL_VERSION/bin:/opt/ghc/$GHC_VERSION/bin:$HOME/.local/bin:$PATH

.azure/linux-cabal.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
jobs:
2+
- job: Linux_Cabal
3+
timeoutInMinutes: 0
4+
pool:
5+
vmImage: ubuntu-16.04
6+
strategy:
7+
matrix:
8+
ghc-8.6.5:
9+
GHC_VERSION: "8.6.5"
10+
ghc-8.4.4:
11+
GHC_VERSION: "8.4.4"
12+
variables:
13+
CABAL_VERSION: "3.0"
14+
steps:
15+
- task: Cache@2
16+
inputs:
17+
key: '"cabal-store" | "$(Agent.OS)" | "$(CABAL_VERSION)" | "$(GHC_VERSION)" | $(Build.SourcesDirectory)/cabal.project | $(Build.SourcesDirectory)/haskell-ide-engine.cabal | $(Build.SourcesDirectory)/hie-plugin-api/hie-plugin-api.cabal'
18+
path: .azure-cache
19+
cacheHitVar: CACHE_RESTORED
20+
displayName: "Download cache"
21+
- bash: |
22+
mkdir -p $HOME/.cabal
23+
tar -vxzf .azure-cache/cabal-root.tar.gz -C /
24+
mkdir -p $HOME/.ghc
25+
tar -vxzf .azure-cache/ghc-root.tar.gz -C /
26+
mkdir -p dist-newtyle
27+
tar -vxzf .azure-cache/cabal-dist.tar.gz
28+
displayName: "Unpack cache"
29+
condition: eq(variables.CACHE_RESTORED, 'true')
30+
- bash: |
31+
git submodule sync
32+
git submodule update --init
33+
displayName: Sync submodules
34+
- bash: |
35+
source .azure/linux-cabal.bashrc
36+
cabal v2-update
37+
cabal v2-build --only-dependencies
38+
displayName: Build dependencies
39+
- bash: |
40+
source .azure/linux-cabal.bashrc
41+
cabal v2-build
42+
displayName: Build `hie`
43+
- bash: |
44+
source .azure/linux-cabal.bashrc
45+
cabal v2-install --overwrite-policy=always # `hie` binary required locally for tests
46+
displayName: Install `hie`
47+
- bash: |
48+
source .azure/linux-cabal.bashrc
49+
cabal v2-build --enable-tests --enable-benchmarks --only-dependencies
50+
displayName: Build Test-dependencies
51+
- bash: |
52+
sudo apt update
53+
sudo apt install z3
54+
displayName: "Install Runtime Test-Dependencies: z3"
55+
- bash: |
56+
source .azure/linux-cabal.bashrc
57+
# to not reinstall hie
58+
cd $(Agent.TempDirectory)
59+
cabal v2-install liquidhaskell-0.8.6.2 -w /opt/ghc/8.6.5/bin/ghc --overwrite-policy=always
60+
displayName: "Install Runtime Test-Dependencies: liquidhaskell"
61+
- bash: |
62+
source .azure/linux-cabal.bashrc
63+
cabal v2-build hoogle
64+
cabal v2-exec hoogle generate
65+
displayName: "Install Runtime Test-Dependencies: hoogle database"
66+
- bash: |
67+
source .azure/linux-cabal.bashrc
68+
# TODO: Investigate why the test suite can't be run in parallel
69+
cabal v2-test -j1
70+
displayName: Run Test
71+
- bash: |
72+
mkdir -p .azure-cache
73+
tar -vczf .azure-cache/cabal-root.tar.gz $HOME/.cabal
74+
tar -vczf .azure-cache/ghc-root.tar.gz $HOME/.ghc
75+
tar -vczf .azure-cache/cabal-dist.tar.gz dist-newstyle
76+
displayName: "Pack cache"

.azure/linux-installhs-stack.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ jobs:
33
timeoutInMinutes: 0
44
pool:
55
vmImage: ubuntu-16.04
6-
strategy:
7-
matrix:
8-
shake:
9-
YAML_FILE: install/shake.yaml
6+
variables:
7+
YAML_FILE: install/shake.yaml
108
steps:
119
- bash: |
1210
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root
@@ -32,9 +30,5 @@ jobs:
3230
displayName: Run help of `install.hs`
3331
- bash: |
3432
source .azure/linux.bashrc
35-
stack install.hs stack-install-cabal
36-
displayName: Run stack-install-cabal target of `install.hs`
37-
- bash: |
38-
source .azure/linux.bashrc
39-
stack install.hs build-latest
40-
displayName: Run build-latest target of `install.hs`
33+
stack install.hs latest
34+
displayName: Run latest target of `install.hs`
File renamed without changes.

.azure/linux-stack.yml

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,59 +28,89 @@ jobs:
2828
variables:
2929
STACK_ROOT: /home/vsts/.stack
3030
steps:
31-
- task: CacheBeta@0
31+
- task: Cache@2
3232
inputs:
33-
key: stack-root | $(Agent.OS) | $(Build.SourcesDirectory)/$(YAML_FILE)
33+
key: '"stack-root" | "$(Agent.OS)" | $(Build.SourcesDirectory)/$(YAML_FILE)'
3434
path: .azure-cache
3535
cacheHitVar: CACHE_RESTORED
3636
displayName: "Download cache"
3737
- bash: |
3838
mkdir -p $STACK_ROOT
39-
tar -xzf .azure-cache/stack-root.tar.gz -C /
39+
tar -vxzf .azure-cache/stack-root.tar.gz -C /
4040
mkdir -p .stack-work
41-
tar -xzf .azure-cache/stack-work.tar.gz
41+
tar -vxzf .azure-cache/stack-work.tar.gz
4242
displayName: "Unpack cache"
4343
condition: eq(variables.CACHE_RESTORED, 'true')
4444
- bash: |
4545
git submodule sync
4646
git submodule update --init
47-
displayName: Sync submodules
4847
- bash: |
4948
mkdir -p ~/.local/bin
5049
curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | \
51-
tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
50+
tar vxz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
5251
displayName: Install stack
5352
- bash: |
54-
source .azure/linux.bashrc
53+
source .azure/linux-stack.bashrc
5554
stack setup --stack-yaml $(YAML_FILE)
5655
displayName: Install GHC
5756
- bash: |
58-
source .azure/linux.bashrc
57+
source .azure/linux-stack.bashrc
5958
stack --stack-yaml $(YAML_FILE) --install-ghc build --only-dependencies
6059
displayName: Build dependencies
6160
- bash: |
62-
source .azure/linux.bashrc
61+
source .azure/linux-stack.bashrc
6362
stack build --stack-yaml $(YAML_FILE)
6463
displayName: Build `hie`
6564
- bash: |
66-
source .azure/linux.bashrc
65+
source .azure/linux-stack.bashrc
66+
stack install --stack-yaml $(YAML_FILE) # `hie` binary required locally for tests
67+
mkdir .azure-deploy
68+
stack install --stack-yaml $(YAML_FILE) --local-bin-path .azure-deploy
69+
cd .azure-deploy
70+
if [ $YAML_FILE != "stack.yaml" ]; then
71+
GHC_MINOR_VERSION=${YAML_FILE:6:5}
72+
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
73+
cp hie hie-$GHC_MINOR_VERSION
74+
cp hie hie-$GHC_MAJOR_VERSION
75+
else
76+
GHC_MINOR_VERSION=nightly
77+
fi
78+
stack unpack hlint --stack-yaml ../$(YAML_FILE) --to "$(Agent.TempDirectory)"
79+
mkdir -p data
80+
cp "$(Agent.TempDirectory)"/hlint*/data/hlint.yaml data
81+
ARTIFACT_NAME=hie-$(hie --numeric-version)-ghc-$GHC_MINOR_VERSION-linux-x86_64
82+
tar -vczf $(Build.ArtifactStagingDirectory)/$ARTIFACT_NAME.tar.xz *
83+
displayName: Install `hie`
84+
- bash: |
85+
source .azure/linux-stack.bashrc
6786
stack build --stack-yaml $(YAML_FILE) --test --bench --only-dependencies
68-
stack install --stack-yaml $(YAML_FILE) # `hie` binary required for tests
6987
displayName: Build Test-dependencies
7088
- bash: |
7189
sudo apt update
7290
sudo apt install z3
7391
displayName: "Install Runtime Test-Dependencies: z3"
7492
- bash: |
75-
source .azure/linux.bashrc
76-
stack install --resolver=lts-11.18 liquid-fixpoint-0.7.0.7 dotgen-0.4.2 fgl-visualize-0.1.0.1 located-base-0.1.1.1 liquidhaskell-0.8.2.4
93+
source .azure/linux-stack.bashrc
94+
stack install --resolver=lts-13.20 liquid-fixpoint-0.8.0.2 liquidhaskell-0.8.6.2
7795
displayName: "Install Runtime Test-Dependencies: liquidhaskell"
78-
# - bash: |
79-
# source .azure/linux.bashrc
80-
# stack test --stack-yaml $(YAML_FILE)
81-
# displayName: Run Test
96+
- bash: |
97+
source .azure/linux-stack.bashrc
98+
stack build hoogle --stack-yaml=$(YAML_FILE)
99+
stack exec hoogle generate --stack-yaml=$(YAML_FILE)
100+
displayName: "Install Runtime Test-Dependencies: hoogle database"
101+
- bash: |
102+
source .azure/linux-stack.bashrc
103+
# cabal is also a test runtime dependency
104+
export PATH=/opt/cabal/3.0/bin:$PATH
105+
stack test --stack-yaml $(YAML_FILE)
106+
displayName: Run Test
107+
- task: PublishBuildArtifacts@1
108+
inputs:
109+
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
110+
artifactName: hie-$(Agent.OS)-$(YAML_FILE)
111+
condition: in(variables['Agent.JobStatus'], 'Succeeded', 'SucceededWithIssues')
82112
- bash: |
83113
mkdir -p .azure-cache
84-
tar -czf .azure-cache/stack-root.tar.gz $STACK_ROOT
85-
tar -czf .azure-cache/stack-work.tar.gz .stack-work
114+
tar -vczf .azure-cache/stack-root.tar.gz $STACK_ROOT
115+
tar -vczf .azure-cache/stack-work.tar.gz .stack-work
86116
displayName: "Pack cache"

.azure/macos-installhs-stack.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ jobs:
33
timeoutInMinutes: 0
44
pool:
55
vmImage: macOS-10.13
6-
strategy:
7-
matrix:
8-
shake:
9-
YAML_FILE: install/shake.yaml
6+
variables:
7+
YAML_FILE: install/shake.yaml
108
steps:
119
- bash: |
1210
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root
@@ -32,9 +30,5 @@ jobs:
3230
displayName: Run help of `install.hs`
3331
- bash: |
3432
source .azure/macos.bashrc
35-
stack install.hs stack-install-cabal
36-
displayName: Run stack-install-cabal target of `install.hs`
37-
- bash: |
38-
source .azure/macos.bashrc
39-
stack install.hs build-latest
40-
displayName: Run build-latest target of `install.hs`
33+
stack install.hs latest
34+
displayName: Run latest target of `install.hs`

.azure/macos-stack.yml

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ jobs:
2424
variables:
2525
STACK_ROOT: $(Build.SourcesDirectory)/.stack
2626
steps:
27-
- task: CacheBeta@0
27+
- task: Cache@2
2828
inputs:
29-
key: stack-root | $(Agent.OS) | $(Build.SourcesDirectory)/$(YAML_FILE)
29+
key: '"stack-root" | "$(Agent.OS)" | $(Build.SourcesDirectory)/$(YAML_FILE)'
3030
path: .azure-cache
3131
cacheHitVar: CACHE_RESTORED
3232
displayName: "Download cache"
3333
- bash: |
3434
mkdir -p $STACK_ROOT
35-
tar -xzf .azure-cache/stack-root.tar.gz -C /
35+
tar -vxzf .azure-cache/stack-root.tar.gz -C /
3636
mkdir -p .stack-work
37-
tar -xzf .azure-cache/stack-work.tar.gz
37+
tar -vxzf .azure-cache/stack-work.tar.gz
3838
displayName: "Unpack cache"
3939
condition: eq(variables.CACHE_RESTORED, 'true')
4040
- bash: |
@@ -44,7 +44,7 @@ jobs:
4444
- bash: |
4545
mkdir -p ~/.local/bin
4646
curl -skL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | \
47-
tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin;
47+
tar vxz --strip-components=1 --include '*/stack' -C ~/.local/bin;
4848
displayName: Install stack
4949
- bash: |
5050
source .azure/macos.bashrc
@@ -58,26 +58,66 @@ jobs:
5858
source .azure/macos.bashrc
5959
stack build --stack-yaml $(YAML_FILE)
6060
displayName: Build `hie`
61+
- bash: |
62+
source .azure/macos.bashrc
63+
stack install --stack-yaml $(YAML_FILE) # `hie` binary required locally for tests
64+
mkdir .azure-deploy
65+
stack install --stack-yaml $(YAML_FILE) --local-bin-path .azure-deploy
66+
cd .azure-deploy
67+
if [ $YAML_FILE != "stack.yaml" ]; then
68+
GHC_MINOR_VERSION=${YAML_FILE:6:5}
69+
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
70+
cp hie hie-$GHC_MINOR_VERSION
71+
cp hie hie-$GHC_MAJOR_VERSION
72+
else
73+
GHC_MINOR_VERSION=nightly
74+
fi
75+
stack unpack hlint --stack-yaml ../$(YAML_FILE) --to "$(Agent.TempDirectory)"
76+
mkdir -p data
77+
cp "$(Agent.TempDirectory)"/hlint*/data/hlint.yaml data
78+
ARTIFACT_NAME=hie-$(hie --numeric-version)-ghc-$GHC_MINOR_VERSION-macos-x86_64
79+
tar -vczf $(Build.ArtifactStagingDirectory)/$ARTIFACT_NAME.tar.xz *
80+
displayName: Install `hie`
6181
- bash: |
6282
source .azure/macos.bashrc
6383
stack build --stack-yaml $(YAML_FILE) --test --bench --only-dependencies
64-
stack install --stack-yaml $(YAML_FILE) # `hie` binary required for tests
6584
displayName: Build Test-dependencies
6685
- bash: |
6786
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
6887
brew update
88+
brew unlink python@2
6989
brew install z3
7090
displayName: "Install Runtime Test-Dependencies: z3"
7191
- bash: |
7292
source .azure/macos.bashrc
73-
stack install --resolver=lts-11.18 liquid-fixpoint-0.7.0.7 dotgen-0.4.2 fgl-visualize-0.1.0.1 located-base-0.1.1.1 liquidhaskell-0.8.2.4
93+
stack install --resolver=lts-13.20 liquid-fixpoint-0.8.0.2 liquidhaskell-0.8.6.2
7494
displayName: "Install Runtime Test-Dependencies: liquidhaskell"
75-
# - bash: |
76-
# source .azure/macos.bashrc
77-
# stack test --stack-yaml $(YAML_FILE)
78-
# displayName: Run Test
95+
- bash: |
96+
source .azure/macos.bashrc
97+
stack build hoogle --stack-yaml=$(YAML_FILE)
98+
stack exec hoogle generate --stack-yaml=$(YAML_FILE)
99+
displayName: "Install Runtime Test-Dependencies: hoogle database"
100+
- bash: |
101+
source .azure/macos.bashrc
102+
brew install cabal-install
103+
displayName: "Install Runtime Test-Dependencies: cabal"
104+
- bash: |
105+
source .azure/macos.bashrc
106+
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
107+
if [ $GHC_MAJOR_VERSION != "8.4" ]; then
108+
stack test --stack-yaml $(YAML_FILE)
109+
else
110+
#TODO Enable dispatcher-test and func-test for ghc-8.4.*
111+
stack test --stack-yaml $(YAML_FILE) :unit-test :plugin-dispatcher-test :wrapper-test
112+
fi
113+
displayName: Run Test
114+
- task: PublishBuildArtifacts@1
115+
inputs:
116+
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
117+
artifactName: hie-$(Agent.OS)-$(YAML_FILE)
118+
condition: in(variables['Agent.JobStatus'], 'Succeeded', 'SucceededWithIssues')
79119
- bash: |
80120
mkdir -p .azure-cache
81-
tar -czf .azure-cache/stack-root.tar.gz $STACK_ROOT
82-
tar -czf .azure-cache/stack-work.tar.gz .stack-work
121+
tar -vczf .azure-cache/stack-root.tar.gz $STACK_ROOT
122+
tar -vczf .azure-cache/stack-work.tar.gz .stack-work
83123
displayName: "Pack cache"

.azure/windows-installhs-cabal.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ jobs:
66
variables:
77
YAML_FILE: install/shake.yaml
88
PROJECT_FILE: install/shake.project
9+
STACK_ROOT: "C:\\sr"
10+
# TODO: Replace stack with chocolatey for installing ghc and cabal
911
steps:
1012
- bash: |
1113
curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip
@@ -17,21 +19,21 @@ jobs:
1719
displayName: Install GHC
1820
- bash: |
1921
source .azure/windows.bashrc
20-
stack install cabal-install --stack-yaml $(YAML_FILE)
22+
stack install Cabal-3.0.0.0 cabal-install-3.0.0.0 --stack-yaml $(YAML_FILE)
2123
displayName: Install `cabal-install`
2224
- bash: |
2325
source .azure/windows.bashrc
24-
cabal update
26+
cabal v2-update
2527
displayName: update cabal
26-
# - bash: |
27-
# source .azure/windows.bashrc
28-
# stack --stack-yaml $(YAML_FILE) build --only-dependencies
29-
# displayName: Build dependencies
30-
- bash: |
31-
source .azure/windows.bashrc
32-
cabal v2-build hie-install -w $(stack path --stack-yaml $(YAML_FILE) --compiler-exe) --project-file $(PROJECT_FILE)
33-
displayName: Build `hie-install`
3428
- bash: |
3529
source .azure/windows.bashrc
36-
cabal v2-run install.hs -w $(stack path --stack-yaml $(YAML_FILE) --compiler-exe) --project-file $(PROJECT_FILE) help
30+
GHC_PATH=$(stack path --stack-yaml $YAML_FILE --compiler-exe)
31+
cabal v2-run install.hs -w $GHC_PATH --project-file $(PROJECT_FILE) help
3732
displayName: Run help of `install.hs`
33+
# - bash: |
34+
# source .azure/windows.bashrc
35+
# GHC_PATH=$(stack path --stack-yaml $YAML_FILE --compiler-exe)
36+
# GHC_DIR=$(dirname $GHC_PATH)
37+
# export PATH=$(cygpath $GHC_DIR):$PATH
38+
# cabal v2-run install.hs -w $GHC_PATH --project-file $(PROJECT_FILE) build-latest
39+
# displayName: Run build-latest target of `install.hs`

0 commit comments

Comments
 (0)