Skip to content

Commit 33877d7

Browse files
committed
Merge branch 'master' into rc/v3.1
2 parents 5204fa3 + 425cffa commit 33877d7

File tree

13 files changed

+79
-20
lines changed

13 files changed

+79
-20
lines changed

ChangeLog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ Behavior changes:
1212

1313
Other enhancements:
1414

15+
* Add flag `--[no-]allow-newer` to Stack's `build` command, which takes
16+
precedence over the existing `allow-newer` configuration option.
17+
1518
Bug fixes:
1619

1720
* Fix a regression, introduced in Stack 2.15.7, that caused GHC 8.10.7 or
@@ -383,6 +386,11 @@ Behavior changes:
383386
* On Windows, `stack upgrade` does not offer `sudo` command alternatives if
384387
attempting to write to the original file name of the running Stack exectuable
385388
results in a 'Permission' error.
389+
* On Linux, Stack's `setup` command now distinguishes GHC build
390+
`tinfo6-libc6-pre232` from existing `tinfo6`. The former refers to systems
391+
where the version of `libc6` (the GNU C Library) is not compatible with
392+
version 2.32. `tinfo6-libc6-pre232` is now a possible value for the
393+
`ghc-build` configuration option.
386394

387395
Other enhancements:
388396

doc/build_command.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,21 @@ of the Cabal build process (for further information, see the documentation for
216216
the [configure-options](yaml_configuration.md#configure-options) configuration
217217
option).
218218

219+
### `--[no-]allow-newer` flag
220+
221+
:octicons-tag-24: UNRELEASED
222+
223+
Overrides: [`allow-newer`](yaml_configuration.md#allow-newer) non-project
224+
specific configuration option
225+
226+
Pass the flag to enable or disable the ignoring of lower and upper version
227+
bounds in Cabal files.
228+
229+
!!! info
230+
231+
The name `allow-newer` was chosen to match a commonly-used Cabal option
232+
which ignored only upper version bounds.
233+
219234
### `--bench` flag
220235

221236
Pass the flag to add benchmark components to the targets, if specific components

doc/global_flags.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ it, it is best omitted from the debug output.
183183

184184
## `--resolver` option
185185

186-
A synonym for the [`--snapshot` option](#snapshot-option) to specify the
186+
A synonym for the [`--snapshot` option](#-snapshot-option) to specify the
187187
snapshot resolver.
188188

189189
## `--[no-]rsl-in-log` flag

doc/setup_command.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ By default:
1313

1414
* the version of GHC is the one required by the project. Specify the version of
1515
GHC as an argument to attempt to install a different version of GHC. For
16-
example `stack setup 9.4.4` will attempt to install GHC 9.4.4; and
16+
example `stack setup 9.6.6` will attempt to install GHC 9.6.6; and
1717

1818
* an attempt to install is made only if the version of GHC is not already
1919
available to Stack. Pass the flag `--reinstall` (disabled by default) to
@@ -43,15 +43,19 @@ command are inconsistent and take no action.
4343
required on Linux, Stack will refer to the presence or absence of certain
4444
libraries or the versions of those libraries.
4545

46-
For example, Stack 2.15.1 considers:
46+
For example, Stack 2.15.7 considers:
4747

4848
* If `libc.musl-x86_64.so.1` is present. This file is provided by the
4949
[musl libc](https://musl.libc.org/).
5050

51+
[:octicons-tag-24: 2.13.1](https://github.com/commercialhaskell/stack/releases/tag/v2.13.1)
52+
5153
* The version of `libc6` (if musl libc is not applicable), the
5254
[GNU C Library](https://www.gnu.org/software/libc/) (glibc), that is
5355
present. The GNU C Library is designed to be backwards compatible.
5456

57+
[:octicons-tag-24: 2.11.1](https://github.com/commercialhaskell/stack/releases/tag/v2.11.1)
58+
5559
* If `libgmp.so.3` or `libgmp.so.10` is present. These files are provided
5660
by different versions of the
5761
[GNU Multiple Precision Arithmetic Library](https://gmplib.org/).
@@ -63,7 +67,7 @@ command are inconsistent and take no action.
6367
provided by different versions of a shared low-level terminfo library
6468
for terminal handling.
6569

66-
Stack 2.15.1 uses `ghc-build`:
70+
Stack 2.15.7 uses `ghc-build`:
6771

6872
* `musl` to indicate `libc.musl-x86_64.so.1` is present and Stack should use
6973
the GHC binary distribution for Alpine Linux.
@@ -77,9 +81,14 @@ command are inconsistent and take no action.
7781
By default, Stack associates:
7882

7983
* the `tinfo6` build with the 'Fedora 33' binary distribution of GHC 9.4.1
80-
to 9.4.4. Those binary distributions require versions of `libc6` that are
81-
compatible with `libc6` 2.32; and
84+
to 9.4.3 and 9.6.1 and later. Those binary distributions require versions
85+
of `libc6` that are compatible with `libc6` 2.32;
8286

8387
* the `tinfo6-libc6-pre232` build with the 'Debian 10' binary distribution
84-
of GHC 9.4.1 to 9.4.4. Those binary distributions require versions of
85-
`libc6` that are compatible with `libc6` 2.28.
88+
of GHC 9.4.1 to 9.4.3 and the 'Rocky 8' binary distribution of GHC 9.6.1
89+
and later. Those binary distributions require versions of `libc6` that are
90+
compatible with `libc6` 2.28; and
91+
92+
* the `tinfo6` and `tinfo6-libc6-pre232` builds with the 'Fedora 27' binary
93+
distribution of GHC 9.4.4 to 9.4.8. Those binary distributions require
94+
versions of `libc6` that are compatible with `libc6` 2.26.

doc/yaml_configuration.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,15 @@ process.
498498

499499
Default: `false`
500500

501-
Whether to ignore version bounds in Cabal files. This also ignores lower bounds.
502-
The name `allow-newer` is chosen to match the commonly-used Cabal option.
501+
Command line equivalent (takes precedence):
502+
[`stack build --[no-]allow-newer`](build_command.md#-allow-newer-flag) flag
503+
504+
Whether to ignore lower and upper version bounds in Cabal files.
505+
506+
!!! info
503507

508+
The name `allow-newer` was chosen to match a commonly-used Cabal option
509+
which ignored only upper bounds.
504510

505511
~~~yaml
506512
allow-newer: true

src/Stack/Build/ConstructPlan.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,8 +896,11 @@ adrInRange ::
896896
adrInRange pkgId name range adr = if adrVersion adr `withinRange` range
897897
then pure True
898898
else do
899-
allowNewer <- view $ configL . to (.allowNewer)
900-
allowNewerDeps <- view $ configL . to (.allowNewerDeps)
899+
config <- view configL
900+
allowNewerCLI <- view $ envConfigL . to (.buildOptsCLI) . to (.allowNewer)
901+
let allowNewerConfig = config.allowNewer
902+
allowNewer = fromFirst False $ allowNewerCLI <> allowNewerConfig
903+
allowNewerDeps = config.allowNewerDeps
901904
if allowNewer
902905
then case allowNewerDeps of
903906
Nothing -> do

src/Stack/Config.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ configFromConfigMonoid
420420
fromFirst AGOLocals configMonoid.applyGhcOptions
421421
applyProgOptions =
422422
fromFirst APOLocals configMonoid.applyProgOptions
423-
allowNewer = fromFirst False configMonoid.allowNewer
423+
allowNewer = configMonoid.allowNewer
424424
allowNewerDeps = coerce configMonoid.allowNewerDeps
425425
defaultInitSnapshot <- do
426426
root <- getCurrentDir

src/Stack/Options/BuildParser.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ import Options.Applicative
1515
, metavar, option, strOption, switch, value
1616
)
1717
import Options.Applicative.Args ( cmdOption )
18-
import Options.Applicative.Builder.Extra ( textArgument, textOption )
18+
import Options.Applicative.Builder.Extra
19+
( firstBoolFlagsNoDefault, textArgument, textOption )
1920
import Stack.Options.Completion
2021
( flagCompleter, ghcOptsCompleter, targetCompleter )
2122
import Stack.Options.PackageParser ( readFlag )
23+
import Stack.Options.Utils ( hideMods )
2224
import Stack.Prelude
2325
import Stack.Types.BuildOptsCLI
2426
( ApplyCLIFlag, BuildCommand, BuildOptsCLI (..)
@@ -61,6 +63,10 @@ buildOptsParser cmd = BuildOptsCLI
6163
)
6264
<*> progsOptionsParser
6365
<*> flagsParser
66+
<*> firstBoolFlagsNoDefault
67+
"allow-newer"
68+
"ignoring of lower and upper version bounds in Cabal files."
69+
(hideMods False)
6470
<*> ( flag' BSOnlyDependencies
6571
( long "dependencies-only"
6672
<> help "A synonym for --only-dependencies."

src/Stack/Types/Build/Exception.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,9 @@ pprintExceptions exceptions configFile stackRoot isImplicitGlobal parentMap want
541541
then ["also"]
542542
else
543543
[ fillSep
544-
$ [ "in"
544+
$ [ "pass"
545+
, style Shell "--allow-newer" <> ","
546+
, flow "or, in"
545547
, pretty (defaultUserConfigPath stackRoot)
546548
, flow
547549
( "(global configuration)"

src/Stack/Types/BuildOptsCLI.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ import qualified Data.Map.Strict as Map
1919
import qualified Data.Text as T
2020
import Stack.Prelude
2121

22-
-- | Build options that may only be specified from the CLI
22+
-- | Build options that are specified from the CLI and not specified as
23+
-- non-project specific configuration options under the build key.
2324
data BuildOptsCLI = BuildOptsCLI
2425
{ targetsCLI :: ![Text]
2526
, dryrun :: !Bool
2627
, ghcOptions :: ![Text]
2728
, progsOptions :: ![(Text, [Text])]
2829
, flags :: !(Map ApplyCLIFlag (Map FlagName Bool))
30+
, allowNewer :: !(First Bool)
2931
, buildSubset :: !BuildSubset
3032
, fileWatch :: !FileWatchOpts
3133
, watchAll :: !Bool
@@ -41,6 +43,7 @@ defaultBuildOptsCLI = BuildOptsCLI
4143
{ targetsCLI = []
4244
, dryrun = False
4345
, flags = Map.empty
46+
, allowNewer = mempty
4447
, ghcOptions = []
4548
, progsOptions = []
4649
, buildSubset = BSAll

0 commit comments

Comments
 (0)