Skip to content

Commit c20ff12

Browse files
authored
Merge pull request #5763 from commercialhaskell/ghc-922
Add support for GHC 9.2.4 and its Cabal-3.6.3.0
2 parents 9c70a67 + 074c5c9 commit c20ff12

File tree

143 files changed

+2688
-458
lines changed

Some content is hidden

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

143 files changed

+2688
-458
lines changed

.github/workflows/arm64-release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ARM64 Release
1+
name: ARM64 (AArch64) Release
22

33
on:
44
pull_request:
@@ -17,18 +17,18 @@ jobs:
1717
runs-on: [self-hosted, linux, ARM64]
1818
steps:
1919
- name: Clone project
20-
uses: actions/checkout@v2
21-
- shell: bash
20+
uses: actions/checkout@v3
21+
- name: Build bindist
22+
shell: bash
2223
run: |
2324
set -ex
24-
2525
docker build . -f etc/dockerfiles/arm64.Dockerfile -t stack --build-arg USERID=$(id -u) --build-arg GROUPID=$(id -g)
2626
rm -rf _release
2727
mkdir -p _release
2828
docker run --rm -v $(pwd):/src -w /src stack bash -c "/home/stack/release build"
2929
3030
- name: Upload bindist
31-
uses: actions/upload-artifact@v2
31+
uses: actions/upload-artifact@v3
3232
with:
3333
name: Linux-ARM64
3434
path: _release/stack-*

.github/workflows/integration-tests.yml

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ on:
99
- rc/**
1010
tags:
1111
- '**'
12-
schedule:
13-
- cron: "0 0 * * *"
1412
workflow_dispatch:
1513

14+
# As of 11 August 2022, ubuntu-latest, windows-latest and macos-latest come with
15+
# Stack 2.7.5. windows-latest comes with NSIS 3.08, for which the default value
16+
# of the 'Unicode' installer attribute is 'true'.
17+
1618
jobs:
1719
integration-tests:
1820
name: Integration tests
@@ -26,52 +28,55 @@ jobs:
2628
cache-bust: ""
2729
- os: windows-latest
2830
release-args: ""
29-
cache-bust: ""
31+
cache-bust: "13"
3032
- os: macos-latest
3133
release-args: ""
32-
cache-bust: "1"
34+
cache-bust: "23"
3335
steps:
3436
- name: Clone project
35-
uses: actions/checkout@v2
37+
uses: actions/checkout@v3
3638
- name: Cache dependencies on Unix-like OS
3739
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
3840
uses: actions/cache@v3
3941
with:
4042
path: ~/.stack
41-
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}${{ matrix.cache-bust }}
43+
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ matrix.cache-bust }}
4244
- name: Cache dependencies on Windows
4345
if: startsWith(runner.os, 'Windows')
4446
uses: actions/cache@v3
4547
with:
4648
path: |
4749
~\AppData\Roaming\stack
4850
~\AppData\Local\Programs\stack
49-
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}${{ matrix.cache-bust }}
50-
- shell: bash
51-
name: Install deps and run checks
51+
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ matrix.cache-bust }}
52+
- name: Install deps and run checks
53+
shell: bash
5254
run: |
5355
set -ex
5456
55-
# Work around 'git status' always showing symlinks modified on Windows; see
56-
# https://github.com/git-for-windows/git/issues/2653#issuecomment-640234081
57-
git config --global core.fscache false
58-
59-
stack upgrade || curl -sSL https://get.haskellstack.org/ | sh -s - -f
60-
6157
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]
6258
then
6359
# Retry installing nix due to nondeterministic error
6460
# Fatal error: glibc detected an invalid stdio handle
6561
# See:
6662
# https://github.com/nh2/static-haskell-nix/pull/27#issuecomment-502652181
6763
# https://github.com/NixOS/nix/issues/2733
68-
(for i in {1..5}; do bash <(curl -sSL https://nixos.org/nix/install) && exit 0; done; exit 1)
64+
(for i in {1..5}; do bash <(curl -sSL https://nixos.org/nix/install) --no-daemon && exit 0; done; exit 1)
6965
. ~/.nix-profile/etc/profile.d/nix.sh
70-
nix-channel --add https://nixos.org/channels/nixos-19.09 nixpkgs
66+
nix-channel --add https://nixos.org/channels/nixos-22.05 nixpkgs
7167
nix-channel --update # Get GHC 8.2.2
72-
elif [[ "${{ matrix.os }}" == "windows-latest" ]]
68+
fi
69+
70+
if [[ "${{ matrix.release-args }}" == "--alpine" ]]
7371
then
74-
choco install nsis-unicode -y
72+
touch ~/.stack/config.yaml
73+
cat > ~/.stack/config.yaml <<EOF
74+
extra-include-dirs:
75+
- /usr/include
76+
extra-lib-dirs:
77+
- /lib
78+
- /usr/lib
79+
EOF
7580
fi
7681
7782
# Do this in the same step as installing deps to get relevant env var modifications
@@ -84,7 +89,7 @@ jobs:
8489
run: stack etc/scripts/release.hs build ${{ matrix.release-args }}
8590

8691
- name: Upload bindist
87-
uses: actions/upload-artifact@v2
92+
uses: actions/upload-artifact@v3
8893
with:
8994
name: ${{ runner.os }}
9095
path: _release/stack-*
@@ -96,17 +101,17 @@ jobs:
96101
if: startsWith(github.ref, 'refs/tags/')
97102
steps:
98103
- name: Download Linux artifact
99-
uses: actions/download-artifact@v2
104+
uses: actions/download-artifact@v3
100105
with:
101106
name: Linux
102107
path: _release
103108
- name: Download macOS artifact
104-
uses: actions/download-artifact@v2
109+
uses: actions/download-artifact@v3
105110
with:
106111
name: macOS
107112
path: _release
108113
- name: Download Windows artifact
109-
uses: actions/download-artifact@v2
114+
uses: actions/download-artifact@v3
110115
with:
111116
name: Windows
112117
path: _release

.github/workflows/lint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Linting
33
on:
44
pull_request:
55
push:
6+
branches:
7+
- master
8+
- stable
9+
- rc/**
610

711
jobs:
812
style:

.github/workflows/stan.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
name: stan
22

33
on:
4-
push:
54
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- stable
9+
- rc/**
610

711
jobs:
812
build:

.github/workflows/unit-tests.yml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
- rc/**
1010
workflow_dispatch:
1111

12+
# As of 11 August 2022, ubuntu-latest, windows-latest and macos-latest come with
13+
# Stack 2.7.5. ubuntu-latest comes with GHC 9.2.4.
14+
1215
jobs:
1316
pedantic:
1417
name: Pedantic
@@ -17,7 +20,7 @@ jobs:
1720
- name: Clone project
1821
uses: actions/checkout@v3
1922
- name: Cache dependencies
20-
uses: actions/cache@v1
23+
uses: actions/cache@v3
2124
with:
2225
path: ~/.stack
2326
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}
@@ -40,44 +43,49 @@ jobs:
4043
stack-yaml: stack.yaml
4144
extra-suffix: "alpine"
4245
stack-args: "--docker --system-ghc --no-install-ghc --flag stack:static"
43-
- os: ubuntu-latest
44-
stack-yaml: stack-ghc-902.yaml
45-
extra-suffix: ""
46-
stack-args: ""
4746
- os: windows-latest
4847
stack-yaml: stack.yaml
4948
extra-suffix: ""
5049
stack-args: ""
51-
- os: windows-latest
52-
stack-yaml: stack-ghc-902.yaml
53-
extra-suffix: ""
54-
stack-args: ""
5550
- os: macos-latest
56-
stack-yaml: stack.yaml
51+
stack-yaml: stack-macos.yaml
5752
extra-suffix: ""
5853
stack-args: ""
5954
steps:
6055
- name: Clone project
61-
uses: actions/checkout@v2
56+
uses: actions/checkout@v3
6257
- name: Cache dependencies on Unix-like OS
6358
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
6459
uses: actions/cache@v3
6560
with:
6661
path: ~/.stack
67-
key: ${{ runner.os }}-${{ hashFiles( matrix.stack-yaml ) }}-${{ matrix.extra-suffix }}
62+
key: ${{ runner.os }}-${{ hashFiles(matrix.stack-yaml) }}-${{ matrix.extra-suffix }}
6863
- name: Cache dependencies on Windows
6964
if: startsWith(runner.os, 'Windows')
7065
uses: actions/cache@v3
7166
with:
7267
path: |
7368
~\AppData\Roaming\stack
7469
~\AppData\Local\Programs\stack
75-
key: ${{ runner.os }}-${{ hashFiles( matrix.stack-yaml ) }}-${{ matrix.extra-suffix }}
76-
- shell: bash
70+
key: ${{ runner.os }}-${{ hashFiles(matrix.stack-yaml) }}-${{ matrix.extra-suffix }}
71+
- name: Run tests
72+
shell: bash
7773
run: |
7874
set -ex
79-
stack upgrade || curl -sSL https://get.haskellstack.org/ | sh -s - -f
80-
stack test ${{ matrix.stack-args }} --haddock --no-haddock-deps --ghc-options="-Werror" --copy-bins --local-bin-path bin
75+
76+
if [[ "${{ matrix.extra-suffix }}" == "alpine" ]]
77+
then
78+
touch ~/.stack/config.yaml
79+
cat > ~/.stack/config.yaml <<EOF
80+
extra-include-dirs:
81+
- /usr/include
82+
extra-lib-dirs:
83+
- /lib
84+
- /usr/lib
85+
EOF
86+
fi
87+
88+
stack test ${{ matrix.stack-args }} --stack-yaml ${{ matrix.stack-yaml }} --haddock --no-haddock-deps --ghc-options="-Werror -O0" --copy-bins --local-bin-path bin
8189
8290
# Get output about whether the exe is dynamically linked
8391
if [[ "${{ matrix.os }}" == "macos-latest" ]]

etc/scripts/build-stack-installer.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{- stack script
2-
--resolver lts-14.27
2+
--resolver nightly-2022-08-02
33
--install-ghc
44
--package nsis
55
-}

etc/scripts/release.hs

Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,23 @@
11
{- stack script
2-
--resolver lts-14.27
3-
--install-ghc
2+
--resolver nightly-2022-08-02
3+
--extra-dep Cabal-3.6.3.0
44
--ghc-options -Wall
5-
--package Cabal
6-
--package aeson
7-
--package bytestring
8-
--package case-insensitive
9-
--package conduit
10-
--package conduit-combinators
11-
--package cryptohash
12-
--package directory
13-
--package extra
14-
--package http-conduit
15-
--package http-types
16-
--package mime-types
17-
--package process
18-
--package resourcet
19-
--package shake
20-
--package tar
21-
--package text
22-
--package zip-archive
23-
--package zlib
245
-}
25-
{-# LANGUAGE CPP #-}
266
{-# LANGUAGE RecordWildCards #-}
277

288
import Control.Applicative
299
import Control.Exception
3010
import Control.Monad
3111
import qualified Data.ByteString.Lazy.Char8 as L8
3212
import Data.List
13+
import Data.List.Extra
3314
import Data.Maybe
3415
import Distribution.PackageDescription.Parsec
3516
import Distribution.Text
3617
import Distribution.System
3718
import Distribution.Package
3819
import Distribution.PackageDescription hiding (options)
39-
#if MIN_VERSION_Cabal(3, 0, 0)
4020
import Distribution.Utils.ShortText (fromShortText)
41-
#endif
4221
import Distribution.Verbosity
4322
import System.Console.GetOpt
4423
import System.Directory
@@ -49,16 +28,11 @@ import qualified Codec.Archive.Tar as Tar
4928
import qualified Codec.Archive.Tar.Entry as TarEntry
5029
import qualified Codec.Archive.Zip as Zip
5130
import qualified Codec.Compression.GZip as GZip
52-
import Data.List.Extra
5331
import Development.Shake
5432
import Development.Shake.FilePath
33+
import qualified System.Info as Info
5534
import Prelude -- Silence AMP warning
5635

57-
#if !MIN_VERSION_Cabal(3, 0, 0)
58-
fromShortText :: String -> String
59-
fromShortText = id
60-
#endif
61-
6236
-- | Entrypoint.
6337
main :: IO ()
6438
main =
@@ -79,12 +53,16 @@ main =
7953
gHomeDir <- getHomeDirectory
8054

8155
let gAllowDirty = False
56+
platformArgs :: [String]
57+
platformArgs = if Info.os == "darwin"
58+
then ["--stack-yaml", "stack-macos.yaml"]
59+
else []
8260
Platform arch _ = buildPlatform
8361
gArch = arch
8462
gBinarySuffix = ""
8563
gTestHaddocks = True
8664
gProjectRoot = "" -- Set to real value velow.
87-
gBuildArgs = ["--flag", "stack:-developer-mode"]
65+
gBuildArgs = platformArgs <> ["--flag", "stack:-developer-mode"]
8866
gStaticLinux = False
8967
gCertificateName = Nothing
9068
global0 = foldl (flip id) Global{..} flags
@@ -185,11 +163,7 @@ rules global@Global{..} args = do
185163
entries <- forM stageFiles $ \stageFile -> do
186164
Zip.readEntry
187165
[Zip.OptLocation
188-
#if MIN_VERSION_zip_archive(0,3,0)
189166
(dropFileName (dropDirectoryPrefix (releaseStageDir </> binaryName) stageFile))
190-
#else
191-
(dropDirectoryPrefix (releaseStageDir </> binaryName) stageFile)
192-
#endif
193167
False]
194168
stageFile
195169
let archive = foldr Zip.addEntryToArchive Zip.emptyArchive entries
@@ -249,7 +223,7 @@ rules global@Global{..} args = do
249223
need [releaseDir </> binaryExeFileName]
250224
need [releaseDir </> binaryInstallerNSIFileName]
251225

252-
command_ [Cwd releaseDir] "c:\\Program Files (x86)\\NSIS\\Unicode\\makensis.exe"
226+
command_ [Cwd releaseDir] "makensis.exe"
253227
[ "-V3"
254228
, binaryInstallerNSIFileName]
255229

@@ -419,12 +393,6 @@ stackArgs Global{..} = ["--arch=" ++ display gArch, "--interleaved-output"]
419393
stackProgName :: FilePath
420394
stackProgName = "stack"
421395

422-
-- | Linux distribution/version combination.
423-
data DistroVersion = DistroVersion
424-
{ dvDistro :: !String
425-
, dvVersion :: !String
426-
, dvCodeName :: !String }
427-
428396
-- | Global values and options.
429397
data Global = Global
430398
{ gStackPackageDescription :: !PackageDescription

src/Stack/Build/Execute.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ getSetupExe setupHs setupShimHs tmpdir = do
294294
, toFilePath tmpOutputPath
295295
]
296296
compilerPath <- getCompilerPath
297-
withWorkingDir (toFilePath tmpdir) (proc (toFilePath compilerPath) args $ \pc0 -> do
297+
withWorkingDir (toFilePath tmpdir) $ proc (toFilePath compilerPath) args (\pc0 -> do
298298
let pc = setStdout (useHandleOpen stderr) pc0
299299
runProcess_ pc)
300300
`catch` \ece ->

src/Stack/PackageDump.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ ghcPkgCmdArgs pkgexe@(GhcPkgExe pkgPath) cmd mpkgDbs sink = do
6464
case reverse mpkgDbs of
6565
(pkgDb:_) -> createDatabase pkgexe pkgDb -- TODO maybe use some retry logic instead?
6666
_ -> return ()
67-
sinkProcessStdout (toFilePath pkgPath) args sink'
67+
-- https://github.com/haskell/process/issues/251
68+
snd <$> sinkProcessStderrStdout (toFilePath pkgPath) args CL.sinkNull sink'
6869
where
6970
args = concat
7071
[ case mpkgDbs of

0 commit comments

Comments
 (0)