Skip to content

Commit 7534592

Browse files
committed
Merge remote-tracking branch 'origin/master' into pantry
2 parents e445576 + ad524e5 commit 7534592

11 files changed

Lines changed: 62 additions & 35 deletions

File tree

ChangeLog.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@ Major changes:
1515
must be specified in `extra-deps`.
1616
* The `extra-dep` key in `packages` is no longer supported; please
1717
move any such specifications to `extra-deps`.
18+
19+
Behavior changes:
20+
21+
Other enhancements:
22+
23+
Bug fixes:
24+
25+
26+
## v1.9.0 (release candidate)
27+
28+
Release notes:
29+
30+
* We will be deleting the Ubuntu, Debian, CentOS, Fedora, and Arch package repos from `download.fpcomplete.com` soon. These have been deprecated for over a year and have not received new releases, but were left in place for compatibility with older scripts.
31+
32+
Major changes:
33+
1834
* `GHCJS` support is being downgraded to 'experimental'. At time of writing the upcoming release is 1.8. A warning notifying the user of the experimental status of `GHCJS` will be incorporated into 1.8.
1935

2036
Behavior changes:
@@ -96,6 +112,8 @@ Other enhancements:
96112
* It is possible to specify the Hackage base URL to upload packages to, instead
97113
of the default of `https://hackage.haskell.org/`, by using `hackage-base-url`
98114
configuration option.
115+
* When using Nix, if a specific minor version of GHC is not requested, the
116+
latest minor version in the given major branch will be used automatically.
99117

100118
Bug fixes:
101119

package.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: stack
2-
version: '1.8.0'
2+
version: '1.10.0'
33
synopsis: The Haskell Tool Stack
44
description: ! 'Please see the README.md for usage information, and
55
the wiki on Github for more details. Also, note that
@@ -61,7 +61,7 @@ dependencies:
6161
- generic-deriving
6262
- hackage-security
6363
- hashable
64-
- hpack >= 0.29
64+
- hpack >= 0.29.6
6565
- hpc
6666
- http-client
6767
- http-client-tls

src/Stack/Config/Nix.hs

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,28 @@ nixOptsFromMonoid NixOptsMonoid{..} os = do
5353

5454
nixCompiler :: WantedCompiler -> Either StringException T.Text
5555
nixCompiler compilerVersion =
56-
let -- These are the latest minor versions for each respective major version available in nixpkgs
57-
fixMinor "8.2" = "8.2.1"
58-
fixMinor "8.0" = "8.0.2"
59-
fixMinor "7.10" = "7.10.3"
60-
fixMinor "7.8" = "7.8.4"
61-
fixMinor "7.6" = "7.6.3"
62-
fixMinor "7.4" = "7.4.2"
63-
fixMinor "7.2" = "7.2.2"
64-
fixMinor "6.12" = "6.12.3"
65-
fixMinor "6.10" = "6.10.4"
66-
fixMinor v = v
67-
nixCompilerFromVersion v = T.append (T.pack "haskell.compiler.ghc")
68-
(T.filter (/= '.')
69-
(fixMinor (displayC v)))
70-
in case compilerVersion of
71-
WCGhc v -> Right $ nixCompilerFromVersion v
72-
WCGhcjs{} -> Left $ stringException "Only GHC is supported by stack --nix"
56+
case compilerVersion of
57+
WCGhc version ->
58+
case T.split (== '.') (displayC version) of
59+
x : y : minor ->
60+
Right $
61+
case minor of
62+
[] ->
63+
-- The minor version is not specified. Select the latest minor
64+
-- version in Nixpkgs corresponding to the requested major
65+
-- version.
66+
let major = T.concat [x, y] in
67+
"(let compilers = builtins.filter \
68+
\(name: builtins.match \
69+
\\"ghc" <> major <> "[[:digit:]]*\" name != null) \
70+
\(lib.attrNames haskell.compiler); in \
71+
\if compilers == [] \
72+
\then abort \"No compiler found for GHC "
73+
<> displayC version <> "\"\
74+
\else haskell.compiler.${builtins.head compilers})"
75+
_ -> "haskell.compiler.ghc" <> T.concat (x : y : minor)
76+
_ -> Left $ stringException "GHC major version not specified"
77+
WCGhcjs{} -> Left $ stringException "Only GHC is supported by stack --nix"
7378

7479
-- Exceptions thown specifically by Stack.Nix
7580
data StackNixException

src/Stack/Package.hs

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

src/Stack/PrettyPrint.hs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,57 +151,59 @@ debugBracket msg f = do
151151
output $ "Finished in" <+> displayMilliseconds diff <> ":" <+> msg
152152
return x
153153

154+
-- The following syles do not affect the colour of the background.
155+
154156
-- | Style an 'AnsiDoc' as an error. Should be used sparingly, not to style
155157
-- entire long messages. For example, it's used to style the "Error:"
156158
-- label for an error message, not the entire message.
157159
styleError :: AnsiDoc -> AnsiDoc
158-
styleError = dullred . ondullblack
160+
styleError = dullred
159161

160162
-- | Style an 'AnsiDoc' as a warning. Should be used sparingly, not to style
161163
-- entire long messages. For example, it's used to style the "Warning:"
162164
-- label for an error message, not the entire message.
163165
styleWarning :: AnsiDoc -> AnsiDoc
164-
styleWarning = yellow . ondullblack
166+
styleWarning = dullyellow
165167

166168
-- | Style an 'AnsiDoc' in a way to emphasize that it is a particularly good
167169
-- thing.
168170
styleGood :: AnsiDoc -> AnsiDoc
169-
styleGood = green . ondullblack
171+
styleGood = green
170172

171173
-- | Style an 'AnsiDoc' as a shell command, i.e. when suggesting something
172174
-- to the user that should be typed in directly as written.
173175
styleShell :: AnsiDoc -> AnsiDoc
174-
styleShell = magenta . ondullblack
176+
styleShell = magenta
175177

176178
-- | Style an 'AnsiDoc' as a filename. See 'styleDir' for directories.
177179
styleFile :: AnsiDoc -> AnsiDoc
178-
styleFile = bold . white . ondullblack
180+
styleFile = dullcyan
179181

180182
-- | Style an 'AsciDoc' as a URL. For now using the same style as files.
181183
styleUrl :: AnsiDoc -> AnsiDoc
182184
styleUrl = styleFile
183185

184186
-- | Style an 'AnsiDoc' as a directory name. See 'styleFile' for files.
185187
styleDir :: AnsiDoc -> AnsiDoc
186-
styleDir = bold . blue . ondullblack
188+
styleDir = bold . blue
187189

188190
-- | Style used to highlight part of a recommended course of action.
189191
styleRecommendation :: AnsiDoc -> AnsiDoc
190-
styleRecommendation = bold . green . ondullblack
192+
styleRecommendation = bold . green
191193

192194
-- | Style an 'AnsiDoc' in a way that emphasizes that it is related to
193195
-- a current thing. For example, could be used when talking about the
194196
-- current package we're processing when outputting the name of it.
195197
styleCurrent :: AnsiDoc -> AnsiDoc
196-
styleCurrent = yellow . ondullblack
198+
styleCurrent = dullyellow
197199

198200
-- TODO: figure out how to describe this
199201
styleTarget :: AnsiDoc -> AnsiDoc
200-
styleTarget = cyan . ondullblack
202+
styleTarget = cyan
201203

202204
-- | Style an 'AnsiDoc' as a module name
203205
styleModule :: AnsiDoc -> AnsiDoc
204-
styleModule = magenta . ondullblack -- TODO: what color should this be?
206+
styleModule = magenta -- TODO: what color should this be?
205207

206208
instance Display (Path b File) where
207209
display = styleFile . fromString . toFilePath

stack-nightly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
resolver: nightly-2018-07-31
1+
resolver: nightly-2018-08-04
22

33
# docker:
44
# enable: true

stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ flags:
1818
supported-build: true
1919
extra-deps:
2020
- infer-license-0.2.0@rev:0
21-
- hpack-0.29.5@rev:0
21+
- hpack-0.29.6@rev:0
2222
- githash-0.1.0.1@rev:0
2323

2424
ghc-options:

subs/pantry/src/Pantry.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ hpack pkgDir = do
495495
he <- view $ pantryConfigL.to pcHpackExecutable
496496
case he of
497497
HpackBundled -> do
498-
r <- liftIO $ Hpack.hpackResult $ Hpack.setTarget (toFilePath hpackFile) Hpack.defaultOptions
498+
r <- liftIO $ Hpack.hpackResult $ Hpack.setProgramName "stack" $ Hpack.setTarget (toFilePath hpackFile) Hpack.defaultOptions
499499
forM_ (Hpack.resultWarnings r) (logWarn . fromString)
500500
let cabalFile = fromString . Hpack.resultCabalFile $ r
501501
case Hpack.resultStatus r of

subs/stack.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ resolver: lts-12.0
22
packages:
33
- pantry
44
- curator
5+
extra-deps:
6+
- infer-license-0.2.0@rev:0
7+
- hpack-0.29.6@rev:0

test/integration/tests/3520-revision-matching/files/bad-stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
resolver: lts-11.19
1+
resolver: lts-10.10
22

33
package-indices:
44
- name: Hackage00

0 commit comments

Comments
 (0)