Skip to content

Commit

Permalink
Manually run stack update (#3590)
Browse files Browse the repository at this point in the history
* Add stack to dev-env

* Manually run stack update before build

To work around multiple concurrent attempts to take the
hackage-security-lock.
  • Loading branch information
aherrmann-da authored and mergify[bot] committed Nov 22, 2019
1 parent f4d0eb6 commit 02f806b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .dadew
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"nodejs-10.16.3",
"python-3.6.7",
"nsis-3.04",
"maven-3.6.1"
"maven-3.6.1",
"stack"
]
}
11 changes: 11 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ if (Test-Path -Path $env:appdata\stack\pantry\hackage\hackage-security-lock) {
Remove-Item -ErrorAction Continue -Force -Recurse -Path $env:appdata\stack
}

# rules_haskell can automatically install stack if it is not in $PATH,
# yet. However, if the index has not been updated before building. Then
# multiple parallel invocations of `stack` will both attempt to update
# the index during build. This will fail with the following error.
#
# user error (hTryLock: lock already exists: C:\Users\VssAdministrator\AppData\Roaming\stack\pantry\hackage\hackage-security-lock)
#
# To avoid this issue we added stack to dadew and update the index beforehand.
# See https://github.com/tweag/stackage-head/issues/29.
stack update

function bazel() {
Write-Output ">> bazel $args"
$global:lastexitcode = 0
Expand Down
11 changes: 11 additions & 0 deletions dev-env/windows/manifests/stack.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"homepage": "https://docs.haskellstack.org/en/stable/README/",
"version": "2.1.3",
"bin": "stack.exe",
"architecture": {
"64bit": {
"url": "https://github.com/commercialhaskell/stack/releases/download/v2.1.3/stack-2.1.3-windows-x86_64.zip",
"hash": "415fb140c7497c4771b84e45a38b65ad47f50b9adc06499b03c4f5a8899aa32a"
}
}
}

0 comments on commit 02f806b

Please sign in to comment.