Skip to content

Commit 19ff06b

Browse files
committed
Merge branch 'master' into rc/v2.9
Mostly typographical corrections in the code base. Also the update to the GitHub Actions workflows to avoid problems with forks and self-hosted runners.
2 parents 415cbfc + 3c3f5ef commit 19ff06b

File tree

43 files changed

+158
-121
lines changed

Some content is hidden

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

43 files changed

+158
-121
lines changed

.github/workflows/integration-tests.yml

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,45 @@ jobs:
9595
name: ${{ runner.os }}
9696
path: _release/stack-*
9797

98+
configuration:
99+
name: Check for self-hosted runners
100+
runs-on: ubuntu-latest
101+
env:
102+
CAN_SIGN: ${{ secrets.RELEASE_SIGNING_KEY != '' }}
103+
outputs:
104+
arm64: ${{ steps.runners.outputs.arm64 }}
105+
can-sign: ${{ env.CAN_SIGN }}
106+
steps:
107+
- name: Check for hosted runners
108+
id: runners
109+
shell: bash
110+
env:
111+
SELF_HOSTED_RUNNERS: ${{ secrets.SELF_HOSTED_RUNNERS || (github.repository_owner == 'commercialhaskell' && 'arm64') }}
112+
run: |
113+
echo "::set-output name=runners::$SELF_HOSTED_RUNNERS"
114+
if echo "$SELF_HOSTED_RUNNERS" | grep -q 'arm64'; then
115+
echo "::set-output name=arm64::['self-hosted', 'linux', 'ARM64']"
116+
else
117+
echo '::set-output name=arm64::"ubuntu-latest"'
118+
fi
119+
98120
linux-arm64:
99121
name: Linux ARM64
100-
runs-on: [self-hosted, linux, ARM64]
122+
runs-on: ${{ fromJSON(needs.configuration.outputs.arm64) }}
123+
needs: configuration
101124
steps:
125+
- name: Skipping ARM64
126+
if: needs.configuration.outputs.arm64 == 'ubuntu-latest'
127+
shell: bash
128+
run: |
129+
echo '::notice title=ARM64 skipped::To build ARM64, a self-hosted runner needs to be configured and the SELF_HOSTED_RUNNERS secret must contain arm64'
130+
102131
- name: Clone project
132+
if: needs.configuration.outputs.arm64 != 'ubuntu-latest'
103133
uses: actions/checkout@v3
104134

105135
- name: Build bindist
136+
if: needs.configuration.outputs.arm64 != 'ubuntu-latest'
106137
shell: bash
107138
run: |
108139
set -ex
@@ -112,13 +143,16 @@ jobs:
112143
docker run --rm -v $(pwd):/src -w /src stack bash -c "/home/stack/release build"
113144
114145
- name: Upload bindist
146+
if: needs.configuration.outputs.arm64 != 'ubuntu-latest'
115147
uses: actions/upload-artifact@v3
116148
with:
117149
name: Linux-ARM64
118150
path: _release/stack-*
119151

120152
github-release:
121-
name: Create Github release
153+
name: Create GitHub release
154+
permissions:
155+
contents: write
122156
needs:
123157
- integration-tests
124158
- linux-arm64
@@ -141,11 +175,13 @@ jobs:
141175
name: Windows
142176
path: _release
143177
- name: Download Linux-ARM64 artifact
178+
if: contains(needs.configuration.outputs.runners, 'arm64')
144179
uses: actions/download-artifact@v3
145180
with:
146181
name: Linux-ARM64
147182
path: _release
148183
- name: Hash and sign assets
184+
if: needs.configuration.outputs.can-sign
149185
shell: bash
150186
env:
151187
RELEASE_SIGNING_KEY: ${{ secrets.RELEASE_SIGNING_KEY }}
@@ -157,17 +193,17 @@ jobs:
157193
shasum -a 256 "$asset" >"$asset.sha256"
158194
gpg --digest-algo=sha512 --detach-sig --armor -u 0x575159689BEFB442 "$asset"
159195
done
160-
- name: Set Github ref variables
196+
- name: Set GitHub ref variables
161197
id: github_ref_vars
162198
run: |
163199
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
164-
- name: Create Github release (final)
200+
- name: Create GitHub release (final)
165201
if: "!startsWith(github.ref, 'refs/tags/rc/')"
166-
uses: actions/create-release@v1
202+
uses: ncipollo/release-action@v1.10.0
167203
env:
168204
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
169205
with:
170-
tag_name: ${{ github.ref }}
206+
tag: ${{ github.ref }}
171207
body: |
172208
See https://haskellstack.org/ for installation and upgrade instructions.
173209
@@ -180,20 +216,20 @@ jobs:
180216
[INSERT CONTRIBUTORS]
181217
draft: true
182218
prerelease: false
183-
- name: Create Github release (release candidate)
219+
- name: Create GitHub release (release candidate)
184220
if: "startsWith(github.ref, 'refs/tags/rc/')"
185-
uses: actions/create-release@v1
221+
uses: ncipollo/release-action@v1.10.0
186222
env:
187223
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
188224
with:
189-
tag_name: ${{ github.ref }}
225+
tag: ${{ github.ref }}
190226
body: |
191227
**Changes since v[INSERT PREVIOUS VERSION]:**
192228
193229
[INSERT CHANGELOG]
194230
draft: true
195231
prerelease: true
196-
- name: Upload assets to Github release (final)
232+
- name: Upload assets to GitHub release (final)
197233
if: "!startsWith(github.ref, 'refs/tags/rc/')"
198234
uses: xresloader/upload-to-github-release@v1
199235
env:
@@ -204,7 +240,7 @@ jobs:
204240
draft: true
205241
prerelease: false
206242
overwrite: true
207-
- name: Upload assets to Github release (release candidate)
243+
- name: Upload assets to GitHub release (release candidate)
208244
if: "startsWith(github.ref, 'refs/tags/rc/')"
209245
uses: xresloader/upload-to-github-release@v1
210246
env:

.github/workflows/stan.yml renamed to .github/workflows/stan.yml.disabled

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
# This workflow has been disabled by renaming the file `stan.yml.disabled`
2+
# because Stan does not yet support GHC >= 9.0.
3+
# See: https://github.com/kowainik/stan/issues/423.
4+
#
15
name: stan
26

3-
# Disabled because Stan does not yet support GHC >= 9.0. See:
4-
# https://github.com/kowainik/stan/issues/423
5-
6-
# on:
7-
# pull_request:
8-
# push:
9-
# branches:
10-
# - master
11-
# - stable
12-
# - rc/**
7+
on:
8+
pull_request:
9+
push:
10+
branches:
11+
- master
12+
- stable
13+
- rc/**
1314

1415
jobs:
1516
build:

etc/scripts/get-stack.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ post_install_separator() {
6969
info ""
7070
}
7171

72-
# determines the the CPU's instruction set
72+
# determines the CPU's instruction set
7373
get_isa() {
7474
if uname -m | grep -Eq 'armv[78]l?' ; then
7575
echo arm
@@ -301,7 +301,7 @@ do_osx_install() {
301301
info ""
302302
}
303303

304-
# # Attempts to insall on FreeBSD. Installs dependencies with
304+
# # Attempts to install on FreeBSD. Installs dependencies with
305305
# # 'pkg install' and then downloads bindist.
306306
# do_freebsd_install() {
307307
# install_dependencies() {

etc/scripts/mirror-ghc-bindists-to-github.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22
#
33
# This script will download official GHC bindists from download.haskell.org and upload
4-
# them to the Github Release that Stack uses.
4+
# them to the GitHub Release that Stack uses.
55
#
66
# Prerequisites:
7-
# - Create a Github release with tag `ghc-X.Y.Z-release`
7+
# - Create a GitHub release with tag `ghc-X.Y.Z-release`
88
# - Set GITHUB_AUTH_TOKEN to a token that has permission to upload assets to a Release
99
#
1010
# To use:
@@ -31,7 +31,7 @@ UPLOAD_URL="$(curl --fail -sSLH "Authorization: token $GITHUB_AUTH_TOKEN" https:
3131
if [[ -z "$UPLOAD_URL" ]]; then
3232
set +x
3333
echo
34-
echo "$0: Could not get upload URL from Github" >&2
34+
echo "$0: Could not get upload URL from GitHub" >&2
3535
exit 1
3636
fi
3737
echo 'ghc:' >stack-setup-$GHCVER.yaml

etc/scripts/release.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ main =
6767
gArch = arch
6868
gBinarySuffix = ""
6969
gTestHaddocks = True
70-
gProjectRoot = "" -- Set to real value velow.
70+
gProjectRoot = "" -- Set to real value below.
7171
gBuildArgs = platformArgs <> ["--flag", "stack:-developer-mode"]
7272
gStaticLinux = False
7373
gCertificateName = Nothing

src/Data/Attoparsec/Combinators.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ alternating a b = a <|> b
2020
pured :: (Applicative g,Applicative f) => g a -> g (f a)
2121
pured = fmap pure
2222

23-
-- | Concatting the result of an action.
23+
-- | Concating the result of an action.
2424
concating :: (Monoid m,Applicative f) => f [m] -> f m
2525
concating = fmap mconcat

src/Data/Monoid/Map.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Data.Monoid.Map where
66
import qualified Data.Map as M
77
import Stack.Prelude
88

9-
-- | Utility newtype wrapper to make make Map's Monoid also use the
9+
-- | Utility newtype wrapper to make Map's Monoid also use the
1010
-- element's Monoid.
1111
newtype MonoidMap k a = MonoidMap (Map k a)
1212
deriving (Eq, Ord, Read, Show, Generic, Functor)

src/Network/HTTP/StackClient.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module Network.HTTP.StackClient
4141
, partFileRequestBody
4242
, partBS
4343
, partLBS
44-
, setGithubHeaders
44+
, setGitHubHeaders
4545
, download
4646
, redownload
4747
, verifiedDownload
@@ -113,8 +113,8 @@ withResponse
113113
withResponse = Network.HTTP.Simple.withResponse . setUserAgent
114114

115115
-- | Set the user-agent request header
116-
setGithubHeaders :: Request -> Request
117-
setGithubHeaders = setRequestHeader "Accept" ["application/vnd.github.v3+json"]
116+
setGitHubHeaders :: Request -> Request
117+
setGitHubHeaders = setRequestHeader "Accept" ["application/vnd.github.v3+json"]
118118

119119
-- | Download the given URL to the given location. If the file already exists,
120120
-- no download is performed. Otherwise, creates the parent directory, downloads

src/Path/Extra.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Path.Extra
88
,dropRoot
99
,parseCollapsedAbsDir
1010
,parseCollapsedAbsFile
11-
,concatAndColapseAbsDir
11+
,concatAndCollapseAbsDir
1212
,rejectMissingFile
1313
,rejectMissingDir
1414
,pathToByteString
@@ -48,8 +48,8 @@ parseCollapsedAbsFile = parseAbsFile . collapseFilePath
4848
-- | Add a relative FilePath to the end of a Path
4949
-- We can't parse the FilePath first because we need to account for ".."
5050
-- in the FilePath (#2895)
51-
concatAndColapseAbsDir :: MonadThrow m => Path Abs Dir -> FilePath -> m (Path Abs Dir)
52-
concatAndColapseAbsDir base rel = parseCollapsedAbsDir (toFilePath base FP.</> rel)
51+
concatAndCollapseAbsDir :: MonadThrow m => Path Abs Dir -> FilePath -> m (Path Abs Dir)
52+
concatAndCollapseAbsDir base rel = parseCollapsedAbsDir (toFilePath base FP.</> rel)
5353

5454
-- | Collapse intermediate "." and ".." directories from a path.
5555
--
@@ -84,7 +84,7 @@ dropRoot (Path l) = Path (FP.dropDrive l)
8484
-- is to be used in conjunction with 'forgivingAbsence' and
8585
-- 'resolveFile'.
8686
--
87-
-- Previously the idiom @forgivingAbsence (relsoveFile …)@ alone was used,
87+
-- Previously the idiom @forgivingAbsence (resolveFile …)@ alone was used,
8888
-- which relied on 'canonicalizePath' throwing 'isDoesNotExistError' when
8989
-- path does not exist. As it turns out, this behavior is actually not
9090
-- intentional and unreliable, see

src/Stack/Build/ConstructPlan.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ tellExecutables _name (PSFilePath lp)
481481
| otherwise = return ()
482482
-- Ignores ghcOptions because they don't matter for enumerating
483483
-- executables.
484-
tellExecutables name (PSRemote pkgloc _version _fromSnaphot cp) =
484+
tellExecutables name (PSRemote pkgloc _version _fromSnapshot cp) =
485485
tellExecutablesUpstream name (pure $ Just pkgloc) Snap (cpFlags cp)
486486

487487
tellExecutablesUpstream ::
@@ -529,7 +529,7 @@ installPackage :: PackageName
529529
installPackage name ps minstalled = do
530530
ctx <- ask
531531
case ps of
532-
PSRemote pkgLoc _version _fromSnaphot cp -> do
532+
PSRemote pkgLoc _version _fromSnapshot cp -> do
533533
planDebug $ "installPackage: Doing all-in-one build for upstream package " ++ show name
534534
package <- loadPackage ctx pkgLoc (cpFlags cp) (cpGhcOptions cp) (cpCabalConfigOpts cp)
535535
resolveDepsAndInstall True (cpHaddocks cp) ps package minstalled
@@ -645,7 +645,7 @@ installPackageGivenDeps isAllInOne buildHaddocks ps package minstalled (missing,
645645
case ps of
646646
PSFilePath lp ->
647647
TTLocalMutable lp
648-
PSRemote pkgLoc _version _fromSnaphot _cp ->
648+
PSRemote pkgLoc _version _fromSnapshot _cp ->
649649
TTRemotePackage mutable package pkgLoc
650650
, taskAllInOne = isAllInOne
651651
, taskCachePkgSrc = toCachePkgSrc ps

0 commit comments

Comments
 (0)