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

Commit 58461a0

Browse files
authored
Merge pull request #1221 from power-fungus/install-via-cabal
add possibility to run `install.hs` from cabal
2 parents 0759352 + 9aa390d commit 58461a0

21 files changed

+909
-599
lines changed

.azure/linux-installhs-stack.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
jobs:
2+
- job: Linux_installhs_Stack
3+
timeoutInMinutes: 0
4+
pool:
5+
vmImage: ubuntu-16.04
6+
strategy:
7+
matrix:
8+
shake:
9+
YAML_FILE: install/shake.yaml
10+
steps:
11+
- bash: |
12+
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root
13+
mkdir -p ~/.local/bin
14+
curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | \
15+
tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
16+
displayName: Install stack
17+
- bash: |
18+
source .azure/linux.bashrc
19+
stack setup --stack-yaml $(YAML_FILE)
20+
displayName: Install GHC
21+
- bash: |
22+
source .azure/linux.bashrc
23+
stack --stack-yaml $(YAML_FILE) --install-ghc build --only-dependencies
24+
displayName: Build dependencies
25+
- bash: |
26+
source .azure/linux.bashrc
27+
stack build --stack-yaml $(YAML_FILE)
28+
displayName: Build `hie-install`
29+
- bash: |
30+
source .azure/linux.bashrc
31+
stack install.hs help
32+
displayName: Run help of `instal.hs`

.azure/macos-installhs-stack.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
jobs:
2+
- job: MacOs_installhs_Stack
3+
timeoutInMinutes: 0
4+
pool:
5+
vmImage: macOS-10.13
6+
strategy:
7+
matrix:
8+
shake:
9+
YAML_FILE: install/shake.yaml
10+
steps:
11+
- bash: |
12+
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root
13+
mkdir -p ~/.local/bin
14+
curl -skL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | \
15+
tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin;
16+
displayName: Install stack
17+
- bash: |
18+
source .azure/macos.bashrc
19+
stack setup --stack-yaml $(YAML_FILE)
20+
displayName: Install GHC
21+
- bash: |
22+
source .azure/macos.bashrc
23+
stack --stack-yaml $(YAML_FILE) --install-ghc build --only-dependencies
24+
displayName: Build dependencies
25+
- bash: |
26+
source .azure/macos.bashrc
27+
stack build --stack-yaml $(YAML_FILE)
28+
displayName: Build `hie-install`
29+
- bash: |
30+
source .azure/macos.bashrc
31+
stack install.hs help
32+
displayName: Run help of `instal.hs`

.azure/windows-installhs-cabal.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
jobs:
2+
- job: Windows_installhs_Cabal
3+
timeoutInMinutes: 0
4+
pool:
5+
vmImage: windows-2019
6+
variables:
7+
YAML_FILE: install/shake.yaml
8+
PROJECT_FILE: install/shake.project
9+
steps:
10+
- bash: |
11+
curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip
12+
unzip -o /usr/bin/stack.zip -d /usr/bin/
13+
displayName: Install stack
14+
- bash: |
15+
source .azure/windows.bashrc
16+
stack setup --stack-yaml $(YAML_FILE)
17+
displayName: Install GHC
18+
- bash: |
19+
source .azure/windows.bashrc
20+
stack install cabal-install --stack-yaml $(YAML_FILE)
21+
displayName: Install `cabal-install`
22+
- bash: |
23+
source .azure/windows.bashrc
24+
cabal update
25+
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`
34+
- bash: |
35+
source .azure/windows.bashrc
36+
cabal v2-run install.hs -w $(stack path --stack-yaml $(YAML_FILE) --compiler-exe) --project-file $(PROJECT_FILE) help
37+
displayName: Run help of `install.hs`

.azure/windows-installhs-stack.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
jobs:
2+
- job: Windows_installhs_Stack
3+
timeoutInMinutes: 0
4+
pool:
5+
vmImage: windows-2019
6+
strategy:
7+
matrix:
8+
shake:
9+
YAML_FILE: install/shake.yaml
10+
steps:
11+
- bash: |
12+
curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip
13+
unzip -o /usr/bin/stack.zip -d /usr/bin/
14+
displayName: Install stack
15+
- bash: |
16+
source .azure/windows.bashrc
17+
stack setup --stack-yaml $(YAML_FILE)
18+
displayName: Install GHC
19+
- bash: |
20+
source .azure/windows.bashrc
21+
stack --stack-yaml $(YAML_FILE) --install-ghc build --only-dependencies
22+
displayName: Build dependencies
23+
- bash: |
24+
source .azure/windows.bashrc
25+
stack build --stack-yaml $(YAML_FILE)
26+
displayName: Build `hie-install`
27+
- bash: |
28+
source .azure/windows.bashrc
29+
stack install.hs help
30+
displayName: Run help of `instal.hs`

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ _build/
7373

7474
# stack 2.1 stack.yaml lock files
7575
stack*.yaml.lock
76+
shake.yaml.lock

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,20 @@ stack ./install.hs help
201201

202202
Remember, this will take time to download a Stackage-LTS and an appropriate GHC. However, afterwards all commands should work as expected.
203203

204+
##### Install via cabal
205+
206+
The install-script can be invoked via `cabal` instead of `stack` with the command
207+
208+
```bash
209+
cabal v2-run ./install.hs --project-file install/shake.project <target>
210+
```
211+
212+
Running the script with cabal on windows seems to have some issues and is currently not fully supported.
213+
214+
Unfortunately, it is still required to have `stack` installed so that the install-script can locate the `local-bin` directory (on Linux `~/.local/bin`) and copy the `hie` binaries to `hie-x.y.z`, which is required for the `hie-wrapper` to function as expected.
215+
216+
For brevity, only the `stack`-based commands are presented in the following sections.
217+
204218
##### Install specific GHC Version
205219

206220
Install **Nightly** (and hoogle docs):

azure-pipelines.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ jobs:
22
- template: ./.azure/linux-stack.yml
33
- template: ./.azure/windows-stack.yml
44
- template: ./.azure/macos-stack.yml
5+
- template: ./.azure/linux-installhs-stack.yml
6+
- template: ./.azure/windows-installhs-stack.yml
7+
- template: ./.azure/macos-installhs-stack.yml

0 commit comments

Comments
 (0)