Skip to content

Commit 8042969

Browse files
authored
Merge pull request #6021 from commercialhaskell/ghc2021
Move Stack to -XGHC2021
2 parents cf9d8bb + 7fca6d4 commit 8042969

Some content is hidden

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

86 files changed

+32
-261
lines changed

package.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Hpack >= 0.35.0 is provided by Stack >= 2.9.1.
2+
spec-version: 0.35.0
3+
14
name: stack
25
version: '2.10.0'
36
synopsis: The Haskell Tool Stack
@@ -8,7 +11,7 @@ description: |
811
If building a 'stack' executable for distribution, please download the
912
source code from <https://github.com/commercialhaskell/stack/releases>
1013
and build it using Stack itself in order to ensure identical behaviour
11-
to official binaries. This package on Hackage is provided for convenience
14+
to official binaries. This package on Hackage is provided for convenience
1215
and bootstrapping purposes.
1316
.
1417
Note that the API for the library is not currently stable, and may
@@ -39,6 +42,8 @@ extra-source-files:
3942
- test/package-dump/ghc-head.txt
4043
- src/test/Stack/Untar/test1.tar.gz
4144
- src/test/Stack/Untar/test2.tar.gz
45+
# GHC's GHC2021 language extension is supported by GHC >= 9.2.1
46+
language: GHC2021
4247
ghc-options:
4348
- -fwrite-ide-info
4449
- -hiedir=.hie

src/Control/Concurrent/Execute.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE NoImplicitPrelude #-}
2-
{-# LANGUAGE DeriveDataTypeable #-}
32
{-# LANGUAGE RecordWildCards #-}
43

54
-- Concurrent execution with dependencies. Types currently hard-coded for needs

src/Data/Monoid/Map.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
{-# LANGUAGE DeriveGeneric #-}
2-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3-
41
module Data.Monoid.Map
52
( MonoidMap (..)
63
) where

src/Options/Applicative/Builder/Extra.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{-# LANGUAGE NoImplicitPrelude #-}
22
{-# LANGUAGE RecordWildCards #-}
3-
{-# LANGUAGE ScopedTypeVariables #-}
43

54
-- | Extra functions for optparse-applicative.
65

src/Path/CheckInstall.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE NoImplicitPrelude #-}
2-
{-# LANGUAGE FlexibleContexts #-}
32
{-# LANGUAGE OverloadedStrings #-}
43

54
module Path.CheckInstall

src/Stack/Build.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{-# LANGUAGE NoImplicitPrelude #-}
2-
{-# LANGUAGE ConstraintKinds #-}
3-
{-# LANGUAGE DeriveDataTypeable #-}
4-
{-# LANGUAGE FlexibleContexts #-}
52
{-# LANGUAGE LambdaCase #-}
63
{-# LANGUAGE OverloadedStrings #-}
7-
{-# LANGUAGE ScopedTypeVariables #-}
84

95
-- | Build the project.
106

src/Stack/Build/Cache.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{-# LANGUAGE NoImplicitPrelude #-}
2-
{-# LANGUAGE ConstraintKinds #-}
32
{-# LANGUAGE DataKinds #-}
4-
{-# LANGUAGE FlexibleContexts #-}
5-
{-# LANGUAGE MultiParamTypeClasses #-}
63
{-# LANGUAGE OverloadedStrings #-}
7-
{-# LANGUAGE ScopedTypeVariables #-}
84

95
-- | Cache information about previous builds
106
module Stack.Build.Cache

src/Stack/Build/ConstructPlan.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
{-# LANGUAGE NoImplicitPrelude #-}
2-
{-# LANGUAGE ConstraintKinds #-}
3-
{-# LANGUAGE DeriveGeneric #-}
4-
{-# LANGUAGE FlexibleContexts #-}
52
{-# LANGUAGE LambdaCase #-}
6-
{-# LANGUAGE MultiParamTypeClasses #-}
73
{-# LANGUAGE OverloadedStrings #-}
8-
{-# LANGUAGE ScopedTypeVariables #-}
9-
{-# LANGUAGE TupleSections #-}
104
{-# LANGUAGE ViewPatterns #-}
115

126
-- | Construct a @Plan@ for how to build

src/Stack/Build/Execute.hs

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
{-# LANGUAGE NoImplicitPrelude #-}
2-
{-# LANGUAGE ConstraintKinds #-}
32
{-# LANGUAGE DataKinds #-}
4-
{-# LANGUAGE FlexibleContexts #-}
5-
{-# LANGUAGE MultiParamTypeClasses #-}
63
{-# LANGUAGE OverloadedStrings #-}
7-
{-# LANGUAGE RankNTypes #-}
84
{-# LANGUAGE RecordWildCards #-}
9-
{-# LANGUAGE ScopedTypeVariables #-}
10-
{-# LANGUAGE TupleSections #-}
115
{-# LANGUAGE TypeFamilies #-}
126

137
-- | Perform a build
@@ -69,7 +63,7 @@ import Distribution.Types.UnqualComponentName
6963
( mkUnqualComponentName )
7064
import Distribution.Verbosity ( showForCabal )
7165
import Distribution.Version ( mkVersion )
72-
import Pantry.Internal.Companion ( withCompanion )
66+
import Pantry.Internal.Companion ( Companion, withCompanion )
7367
import Path
7468
( PathException, (</>), addExtension, filename
7569
, isProperPrefixOf, parent, parseRelDir, parseRelFile
@@ -1170,40 +1164,43 @@ announceTask ee task action = logInfo $
11701164
-- | Ensure we're the only action using the directory. See
11711165
-- <https://github.com/commercialhaskell/stack/issues/2730>
11721166
withLockedDistDir ::
1173-
HasEnvConfig env
1167+
forall env a. HasEnvConfig env
11741168
=> (Utf8Builder -> RIO env ()) -- ^ announce
11751169
-> Path Abs Dir -- ^ root directory for package
11761170
-> RIO env a
11771171
-> RIO env a
11781172
withLockedDistDir announce root inner = do
11791173
distDir <- distRelativeDir
11801174
let lockFP = root </> distDir </> relFileBuildLock
1175+
lockFP' = toFilePath lockFP
11811176
ensureDir $ parent lockFP
11821177

11831178
mres <-
11841179
withRunInIO $ \run ->
1185-
withTryFileLock (toFilePath lockFP) Exclusive $ \_lock ->
1180+
withTryFileLock lockFP' Exclusive $ \_lock ->
11861181
run inner
11871182

11881183
case mres of
11891184
Just res -> pure res
11901185
Nothing -> do
1191-
let complainer delay = do
1192-
delay 5000000 -- 5 seconds
1193-
announce $
1194-
"blocking for directory lock on "
1195-
<> fromString (toFilePath lockFP)
1196-
forever $ do
1197-
delay 30000000 -- 30 seconds
1198-
announce $
1199-
"still blocking for directory lock on "
1200-
<> fromString (toFilePath lockFP)
1201-
<> "; maybe another Stack process is running?"
1202-
withCompanion complainer $
1186+
withCompanion (complainer lockFP') $
12031187
\stopComplaining ->
12041188
withRunInIO $ \run ->
1205-
withFileLock (toFilePath lockFP) Exclusive $ \_ ->
1189+
withFileLock lockFP' Exclusive $ \_ ->
12061190
run $ stopComplaining *> inner
1191+
where
1192+
complainer :: FilePath -> Companion (RIO env)
1193+
complainer fp delay = do
1194+
delay 5000000 -- 5 seconds
1195+
announce $
1196+
"blocking for directory lock on "
1197+
<> fromString fp
1198+
forever $ do
1199+
delay 30000000 -- 30 seconds
1200+
announce $
1201+
"still blocking for directory lock on "
1202+
<> fromString fp
1203+
<> "; maybe another Stack process is running?"
12071204

12081205
-- | How we deal with output from GHC, either dumping to a log file or the
12091206
-- console (with some prefix).

src/Stack/Build/Haddock.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
{-# LANGUAGE NoImplicitPrelude #-}
2-
{-# LANGUAGE ConstraintKinds #-}
3-
{-# LANGUAGE FlexibleContexts #-}
4-
{-# LANGUAGE MultiParamTypeClasses #-}
52
{-# LANGUAGE OverloadedStrings #-}
6-
{-# LANGUAGE NamedFieldPuns #-}
7-
{-# LANGUAGE ScopedTypeVariables #-}
83

94
-- | Generate haddocks
105
module Stack.Build.Haddock

0 commit comments

Comments
 (0)