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

add possibility to run install.hs from cabal #1221

Merged
merged 22 commits into from
Jul 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8462418
add possibility to run `install.hs` from cabal
samuelpilz Apr 29, 2019
1cc4501
refactor installer-code
samuelpilz May 4, 2019
b77e39b
refactor help messages and clean up cabal- and stack- targets
samuelpilz Jun 14, 2019
e0e8a07
upgrade shake
samuelpilz Jun 16, 2019
4167153
include work of #1297 into this project
samuelpilz Jun 25, 2019
39e5c3c
use strict copyFile function for hie-x.y binaries
samuelpilz Jun 25, 2019
d670f5a
move shake.* files into install/ folder
samuelpilz Jun 27, 2019
9b35194
correct help message to show only available ghcs for cabal
samuelpilz Jun 27, 2019
71cbab1
apply brittany reformat
samuelpilz Jun 27, 2019
f07ad7c
add cabal.project to install-dir
samuelpilz Jun 27, 2019
7fad241
add documentation to install-helper-functions
samuelpilz Jun 27, 2019
edb411c
let stack use moved shake.yaml in install.hs
samuelpilz Jun 28, 2019
aa49439
increase max-backjumps when building `hie` with cabal
samuelpilz Jun 28, 2019
385de65
document running install.hs from cabal in readme
samuelpilz Jun 29, 2019
8d10d6e
fix typos in readme
samuelpilz Jun 30, 2019
109df60
remove todo for review
samuelpilz Jun 30, 2019
8346b7f
rename module Install to HieInstall in hie-install
samuelpilz Jul 1, 2019
84baa24
add a testrun of install.hs to ci
samuelpilz Jul 1, 2019
767f467
remove todo for review
samuelpilz Jul 1, 2019
a8ae740
add install.hs tests on more plattforms
samuelpilz Jul 11, 2019
34f7964
readme typo
samuelpilz Jul 11, 2019
9aa390d
add note that cabal v2-run is not supported on windows
samuelpilz Jul 11, 2019
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
32 changes: 32 additions & 0 deletions .azure/linux-installhs-stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
jobs:
- job: Linux_installhs_Stack
timeoutInMinutes: 0
pool:
vmImage: ubuntu-16.04
strategy:
matrix:
shake:
YAML_FILE: install/shake.yaml
steps:
- bash: |
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root
mkdir -p ~/.local/bin
curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | \
tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
displayName: Install stack
- bash: |
source .azure/linux.bashrc
stack setup --stack-yaml $(YAML_FILE)
displayName: Install GHC
- bash: |
source .azure/linux.bashrc
stack --stack-yaml $(YAML_FILE) --install-ghc build --only-dependencies
displayName: Build dependencies
- bash: |
source .azure/linux.bashrc
stack build --stack-yaml $(YAML_FILE)
displayName: Build `hie-install`
- bash: |
source .azure/linux.bashrc
stack install.hs help
displayName: Run help of `instal.hs`
32 changes: 32 additions & 0 deletions .azure/macos-installhs-stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
jobs:
- job: MacOs_installhs_Stack
timeoutInMinutes: 0
pool:
vmImage: macOS-10.13
strategy:
matrix:
shake:
YAML_FILE: install/shake.yaml
steps:
- bash: |
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root
mkdir -p ~/.local/bin
curl -skL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | \
tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin;
displayName: Install stack
- bash: |
source .azure/macos.bashrc
stack setup --stack-yaml $(YAML_FILE)
displayName: Install GHC
- bash: |
source .azure/macos.bashrc
stack --stack-yaml $(YAML_FILE) --install-ghc build --only-dependencies
displayName: Build dependencies
- bash: |
source .azure/macos.bashrc
stack build --stack-yaml $(YAML_FILE)
displayName: Build `hie-install`
- bash: |
source .azure/macos.bashrc
stack install.hs help
displayName: Run help of `instal.hs`
37 changes: 37 additions & 0 deletions .azure/windows-installhs-cabal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
jobs:
- job: Windows_installhs_Cabal
timeoutInMinutes: 0
pool:
vmImage: windows-2019
variables:
YAML_FILE: install/shake.yaml
PROJECT_FILE: install/shake.project
steps:
- 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/
displayName: Install stack
- bash: |
source .azure/windows.bashrc
stack setup --stack-yaml $(YAML_FILE)
displayName: Install GHC
- bash: |
source .azure/windows.bashrc
stack install cabal-install --stack-yaml $(YAML_FILE)
displayName: Install `cabal-install`
- bash: |
source .azure/windows.bashrc
cabal update
displayName: update cabal
# - bash: |
# source .azure/windows.bashrc
# stack --stack-yaml $(YAML_FILE) build --only-dependencies
# displayName: Build dependencies
- bash: |
source .azure/windows.bashrc
cabal v2-build hie-install -w $(stack path --stack-yaml $(YAML_FILE) --compiler-exe) --project-file $(PROJECT_FILE)
displayName: Build `hie-install`
- bash: |
source .azure/windows.bashrc
cabal v2-run install.hs -w $(stack path --stack-yaml $(YAML_FILE) --compiler-exe) --project-file $(PROJECT_FILE) help
displayName: Run help of `install.hs`
30 changes: 30 additions & 0 deletions .azure/windows-installhs-stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
jobs:
- job: Windows_installhs_Stack
timeoutInMinutes: 0
pool:
vmImage: windows-2019
strategy:
matrix:
shake:
YAML_FILE: install/shake.yaml
steps:
- 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/
displayName: Install stack
- bash: |
source .azure/windows.bashrc
stack setup --stack-yaml $(YAML_FILE)
displayName: Install GHC
- bash: |
source .azure/windows.bashrc
stack --stack-yaml $(YAML_FILE) --install-ghc build --only-dependencies
displayName: Build dependencies
- bash: |
source .azure/windows.bashrc
stack build --stack-yaml $(YAML_FILE)
displayName: Build `hie-install`
- bash: |
source .azure/windows.bashrc
stack install.hs help
displayName: Run help of `instal.hs`
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ _build/

# stack 2.1 stack.yaml lock files
stack*.yaml.lock
shake.yaml.lock
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,20 @@ stack ./install.hs help

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

##### Install via cabal

The install-script can be invoked via `cabal` instead of `stack` with the command

```bash
cabal v2-run ./install.hs --project-file install/shake.project <target>
```

Running the script with cabal on windows seems to have some issues and is currently not fully supported.

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.

For brevity, only the `stack`-based commands are presented in the following sections.

##### Install specific GHC Version

Install **Nightly** (and hoogle docs):
Expand Down
3 changes: 3 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ jobs:
- template: ./.azure/linux-stack.yml
- template: ./.azure/windows-stack.yml
- template: ./.azure/macos-stack.yml
- template: ./.azure/linux-installhs-stack.yml
- template: ./.azure/windows-installhs-stack.yml
samuelpilz marked this conversation as resolved.
Show resolved Hide resolved
- template: ./.azure/macos-installhs-stack.yml
Loading