Skip to content

Commit 43165ce

Browse files
psibimpilgrem
authored andcommitted
add back import Data.List.Extra
Trim packages from release.hs
1 parent c447294 commit 43165ce

File tree

6 files changed

+53
-73
lines changed

6 files changed

+53
-73
lines changed

.github/workflows/integration-tests.yml

Lines changed: 18 additions & 16 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,29 +28,32 @@ jobs:
2628
cache-bust: ""
2729
- os: windows-latest
2830
release-args: ""
29-
cache-bust: "12"
31+
cache-bust: "13"
3032
- os: macos-latest
3133
release-args: ""
3234
cache-bust: "23"
3335
steps:
3436
- name: Clone project
35-
uses: actions/checkout@v2
36-
- name: Cache dependencies
37-
uses: actions/cache@v1
37+
uses: actions/checkout@v3
38+
- name: Cache dependencies on Unix-like OS
39+
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
40+
uses: actions/cache@v3
3841
with:
3942
path: ~/.stack
40-
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}${{ matrix.cache-bust }}
43+
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ matrix.cache-bust }}
44+
- name: Cache dependencies on Windows
45+
if: startsWith(runner.os, 'Windows')
46+
uses: actions/cache@v3
47+
with:
48+
path: |
49+
~\AppData\Roaming\stack
50+
~\AppData\Local\Programs\stack
51+
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ matrix.cache-bust }}
4152
- name: Install deps and run checks
4253
shell: bash
4354
run: |
4455
set -ex
4556
46-
# Work around 'git status' always showing symlinks modified on Windows; see
47-
# https://github.com/git-for-windows/git/issues/2653#issuecomment-640234081
48-
git config --global core.fscache false
49-
50-
stack upgrade || curl -sSL https://get.haskellstack.org/ | sh -s - -f
51-
5257
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]
5358
then
5459
# Retry installing nix due to nondeterministic error
@@ -60,9 +65,6 @@ jobs:
6065
. ~/.nix-profile/etc/profile.d/nix.sh
6166
nix-channel --add https://nixos.org/channels/nixos-22.05 nixpkgs
6267
nix-channel --update # Get GHC 8.2.2
63-
elif [[ "${{ matrix.os }}" == "windows-latest" ]]
64-
then
65-
choco install nsis-unicode -y
6668
fi
6769
6870
if [[ "${{ matrix.release-args }}" == "--alpine" ]]

.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: 19 additions & 20 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,34 +43,35 @@ 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
5651
stack-yaml: stack-macos.yaml
5752
extra-suffix: ""
5853
stack-args: ""
5954
steps:
6055
- name: Clone project
61-
uses: actions/checkout@v2
62-
- name: Cache dependencies
63-
uses: actions/cache@v1
56+
uses: actions/checkout@v3
57+
- name: Cache dependencies on Unix-like OS
58+
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
59+
uses: actions/cache@v3
6460
with:
6561
path: ~/.stack
66-
key: ${{ runner.os }}-${{ hashFiles( matrix.stack-yaml ) }}-${{ matrix.extra-suffix }}
67-
- shell: bash
62+
key: ${{ runner.os }}-${{ hashFiles(matrix.stack-yaml) }}-${{ matrix.extra-suffix }}
63+
- name: Cache dependencies on Windows
64+
if: startsWith(runner.os, 'Windows')
65+
uses: actions/cache@v3
66+
with:
67+
path: |
68+
~\AppData\Roaming\stack
69+
~\AppData\Local\Programs\stack
70+
key: ${{ runner.os }}-${{ hashFiles(matrix.stack-yaml) }}-${{ matrix.extra-suffix }}
71+
- name: Run tests
72+
shell: bash
6873
run: |
6974
set -ex
70-
stack upgrade || curl -sSL https://get.haskellstack.org/ | sh -s - -f
7175
7276
if [[ "${{ matrix.extra-suffix }}" == "alpine" ]]
7377
then
@@ -81,11 +85,6 @@ jobs:
8185
EOF
8286
fi
8387
84-
if [[ "${{ matrix.os }}" == "windows-latest" ]]
85-
then
86-
stack exec pacman -- --sync --refresh --noconfirm autoconf
87-
fi
88-
8988
stack test ${{ matrix.stack-args }} --stack-yaml ${{ matrix.stack-yaml }} --haddock --no-haddock-deps --ghc-options="-Werror -O0" --copy-bins --local-bin-path bin
9089
9190
# Get output about whether the exe is dynamically linked

etc/scripts/release.hs

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,23 @@
11
{- stack script
22
--resolver nightly-2022-08-02
3-
--system-ghc
3+
--extra-dep Cabal-3.6.3.0
44
--ghc-options -Wall
5-
--package Cabal
6-
--package aeson
7-
--package bytestring
8-
--package extra
9-
--package directory
10-
--package http-types
11-
--package process
12-
--package shake
13-
--package tar
14-
--package text
15-
--package zip-archive
16-
--package zlib
175
-}
18-
{-# LANGUAGE CPP #-}
196
{-# LANGUAGE RecordWildCards #-}
207

218
import Control.Applicative
229
import Control.Exception
2310
import Control.Monad
2411
import qualified Data.ByteString.Lazy.Char8 as L8
2512
import Data.List
13+
import Data.List.Extra
2614
import Data.Maybe
2715
import Distribution.PackageDescription.Parsec
2816
import Distribution.Text
2917
import Distribution.System
3018
import Distribution.Package
3119
import Distribution.PackageDescription hiding (options)
32-
#if MIN_VERSION_Cabal(3, 0, 0)
3320
import Distribution.Utils.ShortText (fromShortText)
34-
#endif
3521
import Distribution.Verbosity
3622
import System.Console.GetOpt
3723
import System.Directory
@@ -47,11 +33,6 @@ import Development.Shake.FilePath
4733
import qualified System.Info as Info
4834
import Prelude -- Silence AMP warning
4935

50-
#if !MIN_VERSION_Cabal(3, 0, 0)
51-
fromShortText :: String -> String
52-
fromShortText = id
53-
#endif
54-
5536
-- | Entrypoint.
5637
main :: IO ()
5738
main =
@@ -182,11 +163,7 @@ rules global@Global{..} args = do
182163
entries <- forM stageFiles $ \stageFile -> do
183164
Zip.readEntry
184165
[Zip.OptLocation
185-
#if MIN_VERSION_zip_archive(0,3,0)
186166
(dropFileName (dropDirectoryPrefix (releaseStageDir </> binaryName) stageFile))
187-
#else
188-
(dropDirectoryPrefix (releaseStageDir </> binaryName) stageFile)
189-
#endif
190167
False]
191168
stageFile
192169
let archive = foldr Zip.addEntryToArchive Zip.emptyArchive entries
@@ -246,7 +223,7 @@ rules global@Global{..} args = do
246223
need [releaseDir </> binaryExeFileName]
247224
need [releaseDir </> binaryInstallerNSIFileName]
248225

249-
command_ [Cwd releaseDir] "c:\\Program Files (x86)\\NSIS\\Unicode\\makensis.exe"
226+
command_ [Cwd releaseDir] "makensis.exe"
250227
[ "-V3"
251228
, binaryInstallerNSIFileName]
252229

@@ -416,12 +393,6 @@ stackArgs Global{..} = ["--arch=" ++ display gArch, "--interleaved-output"]
416393
stackProgName :: FilePath
417394
stackProgName = "stack"
418395

419-
-- | Linux distribution/version combination.
420-
data DistroVersion = DistroVersion
421-
{ dvDistro :: !String
422-
, dvVersion :: !String
423-
, dvCodeName :: !String }
424-
425396
-- | Global values and options.
426397
data Global = Global
427398
{ gStackPackageDescription :: !PackageDescription

stack.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ resolver: nightly-2022-08-02
44
packages:
55
- .
66

7+
drop-packages:
8+
# See https://github.com/commercialhaskell/stack/pull/4712
9+
- cabal-install
10+
711
docker:
812
enable: false
913
repo: psibi/alpine-haskell-stack:9.2.4
@@ -21,10 +25,6 @@ flags:
2125
ghc-options:
2226
"$locals": -fhide-source-paths
2327

24-
drop-packages:
25-
# See https://github.com/commercialhaskell/stack/pull/4712
26-
- cabal-install
27-
2828
user-message: |
2929
If building Stack on macOS, you are advised to use stack-macos.yaml as the
3030
project-level configuration file, and command:

0 commit comments

Comments
 (0)