Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ Other enhancements:

Bug fixes:

* `stack test --no-rerun-tests` correctly skips test suites that have
previously been built and run successfully, including for non-Backpack
* `stack test --no-rerun-tests` correctly skips test suites that have
previously been built and run successfully, including for non-Backpack
packages built by the per-component planner.
* Stack's per-component build planner correctly handles the cross-package
test/library cycle shape from issue #6905: project package A's library
depending on project package B's library, with B's test suite depending on A,
* Stack's per-component build planner correctly handles the cross-package
test/library cycle shape from issue #6905: project package A's library
depending on project package B's library, with B's test suite depending on A,
builds in the right order with the right configure flags.

* If snapshot locations are cyclic, Stack reports an error rather than going
round in circles.

## v3.11.1 - 2026-06-13

**Changes since v3.9.3:**
Expand Down
2 changes: 1 addition & 1 deletion cabal.config
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ constraints:
, optparse-applicative ==0.18.1.0
, optparse-simple ==0.1.1.4
, os-string ==2.0.7
, pantry ==0.11.3
, pantry ==0.11.4
, parsec ==3.1.18.0
, parser-combinators ==1.3.1
, path ==0.9.6
Expand Down
6 changes: 3 additions & 3 deletions doc/topics/custom_snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ has changed by hashing the contents of the involved files, and using it to
identify the snapshot internally. It is often reasonably efficient to modify a
custom snapshot, due to Stack sharing snapshot packages whenever possible.

!!! warning "Cyclic snapshot locations"
!!! note "Cyclic snapshot locations"

If snapshot locations form a cycle, Stack will not detect this but will go
round in circles and appear to hang.
If Stack detects that snapshot locations form a cycle, it will report an
error.

### Overriding the compiler

Expand Down
6 changes: 3 additions & 3 deletions doc/topics/snapshot_location.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ There are four ways to specify a snapshot location:

This allows local file paths and covenience synonyms to be disambiguated.

!!! warning "Cyclic snapshot locations"
!!! note "Cyclic snapshot locations"

If snapshot locations form a cycle, Stack will not detect this but will go
round in circles and appear to hang.
If Stack detects that snapshot locations form a cycle, it will report an
error.

## At the command line

Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ dependencies:
- neat-interpolation
- open-browser
- optparse-applicative >= 0.18.1.0
- pantry >= 0.11.3
- pantry >= 0.11.4
- path >= 0.9.5
- path-io
# In order for Cabal (the tool) to build Stack, it needs to be told of the
Expand Down
2 changes: 1 addition & 1 deletion stack-ghc-9.12.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extra-deps:
# nightly-2026-07-02 specifies http-download-0.2.1.0
- http-download-0.2.2.0@sha256:cfe4722fcbad837db43b5758a49b6ea54b9fd475b1825b622e25f96a8406a4d0,1812
# nightly-2026-07-02 excludes pantry
- pantry-0.11.3@sha256:96fa2c7fa6cee9e470f984da567492f6bfaee058d14c1456f4f79b68a78d7be2,7668
- pantry-0.11.4@sha256:9885d02c58e8725179146352b6d3f57395d3f1337c7713dc1409c61c9c21bb09,7668

docker:
enable: false
Expand Down
6 changes: 3 additions & 3 deletions stack-ghc-9.12.4.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ packages:
original:
hackage: http-download-0.2.2.0@sha256:cfe4722fcbad837db43b5758a49b6ea54b9fd475b1825b622e25f96a8406a4d0,1812
- completed:
hackage: pantry-0.11.3@sha256:96fa2c7fa6cee9e470f984da567492f6bfaee058d14c1456f4f79b68a78d7be2,7668
hackage: pantry-0.11.4@sha256:9885d02c58e8725179146352b6d3f57395d3f1337c7713dc1409c61c9c21bb09,7668
pantry-tree:
sha256: bedd749e9cfdb8adb1a253b34a3350aa89f5ca903aa341579351ce0a937af1f5
sha256: cafafe0eb53f80194e20b7332db8e306c9eb949193f17cd48a71a79c8a3c30d2
size: 2722
original:
hackage: pantry-0.11.3@sha256:96fa2c7fa6cee9e470f984da567492f6bfaee058d14c1456f4f79b68a78d7be2,7668
hackage: pantry-0.11.4@sha256:9885d02c58e8725179146352b6d3f57395d3f1337c7713dc1409c61c9c21bb09,7668
snapshots:
- completed:
sha256: 7aed37f3f67db7b404c9b477077c0c9bc5fbefa709c5e0a231131869e631de56
Expand Down
2 changes: 1 addition & 1 deletion stack-ghc-9.12.5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extra-deps:
# nightly-2026-07-02 specifies http-download-0.2.1.0
- http-download-0.2.2.0@sha256:cfe4722fcbad837db43b5758a49b6ea54b9fd475b1825b622e25f96a8406a4d0,1812
# nightly-2026-07-02 excludes pantry
- pantry-0.11.3@sha256:96fa2c7fa6cee9e470f984da567492f6bfaee058d14c1456f4f79b68a78d7be2,7668
- pantry-0.11.4@sha256:9885d02c58e8725179146352b6d3f57395d3f1337c7713dc1409c61c9c21bb09,7668
# ghc-9.12.4.20260614 specifies semaphore-compat-2.0.0
- semaphore-compat-1.0.0@sha256:2dff81c2c0ec9bac9f8bae364db497188654d2e1e4330f4a0e2f12310149f3e9,1176

Expand Down
6 changes: 3 additions & 3 deletions stack-ghc-9.12.5.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ packages:
original:
hackage: http-download-0.2.2.0@sha256:cfe4722fcbad837db43b5758a49b6ea54b9fd475b1825b622e25f96a8406a4d0,1812
- completed:
hackage: pantry-0.11.3@sha256:96fa2c7fa6cee9e470f984da567492f6bfaee058d14c1456f4f79b68a78d7be2,7668
hackage: pantry-0.11.4@sha256:9885d02c58e8725179146352b6d3f57395d3f1337c7713dc1409c61c9c21bb09,7668
pantry-tree:
sha256: bedd749e9cfdb8adb1a253b34a3350aa89f5ca903aa341579351ce0a937af1f5
sha256: cafafe0eb53f80194e20b7332db8e306c9eb949193f17cd48a71a79c8a3c30d2
size: 2722
original:
hackage: pantry-0.11.3@sha256:96fa2c7fa6cee9e470f984da567492f6bfaee058d14c1456f4f79b68a78d7be2,7668
hackage: pantry-0.11.4@sha256:9885d02c58e8725179146352b6d3f57395d3f1337c7713dc1409c61c9c21bb09,7668
- completed:
hackage: semaphore-compat-1.0.0@sha256:2dff81c2c0ec9bac9f8bae364db497188654d2e1e4330f4a0e2f12310149f3e9,1176
pantry-tree:
Expand Down
2 changes: 1 addition & 1 deletion stack-ghc-9.14.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extra-deps:
# nightly-2026-07-02 specifies http-download-0.2.1.0
- http-download-0.2.2.0@sha256:cfe4722fcbad837db43b5758a49b6ea54b9fd475b1825b622e25f96a8406a4d0,1812
# nightly-2026-07-02 excludes pantry
- pantry-0.11.3@sha256:96fa2c7fa6cee9e470f984da567492f6bfaee058d14c1456f4f79b68a78d7be2,7668
- pantry-0.11.4@sha256:9885d02c58e8725179146352b6d3f57395d3f1337c7713dc1409c61c9c21bb09,7668

docker:
enable: false
Expand Down
6 changes: 3 additions & 3 deletions stack-ghc-9.14.1.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ packages:
original:
hackage: http-download-0.2.2.0@sha256:cfe4722fcbad837db43b5758a49b6ea54b9fd475b1825b622e25f96a8406a4d0,1812
- completed:
hackage: pantry-0.11.3@sha256:96fa2c7fa6cee9e470f984da567492f6bfaee058d14c1456f4f79b68a78d7be2,7668
hackage: pantry-0.11.4@sha256:9885d02c58e8725179146352b6d3f57395d3f1337c7713dc1409c61c9c21bb09,7668
pantry-tree:
sha256: bedd749e9cfdb8adb1a253b34a3350aa89f5ca903aa341579351ce0a937af1f5
sha256: cafafe0eb53f80194e20b7332db8e306c9eb949193f17cd48a71a79c8a3c30d2
size: 2722
original:
hackage: pantry-0.11.3@sha256:96fa2c7fa6cee9e470f984da567492f6bfaee058d14c1456f4f79b68a78d7be2,7668
hackage: pantry-0.11.4@sha256:9885d02c58e8725179146352b6d3f57395d3f1337c7713dc1409c61c9c21bb09,7668
snapshots:
- completed:
sha256: 7aed37f3f67db7b404c9b477077c0c9bc5fbefa709c5e0a231131869e631de56
Expand Down
8 changes: 4 additions & 4 deletions stack.cabal

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extra-deps:
# lts-24.43 specifies open-browser-0.4.0.0
- open-browser-0.5.1.0@sha256:0dc8dc33b9bba0e025e444355f6c2d806f62a4656446961c3647165f80f0d278,1959
# lts-24.43 specifies pantry-0.10.1
- pantry-0.11.3@sha256:96fa2c7fa6cee9e470f984da567492f6bfaee058d14c1456f4f79b68a78d7be2,7668
- pantry-0.11.4@sha256:9885d02c58e8725179146352b6d3f57395d3f1337c7713dc1409c61c9c21bb09,7668
# lts-24.43 specifies persistent-2.17.1.0
- persistent-2.18.1.0@sha256:6a111b26c3e710f1e080a7543cf93766c4cc53ac560dbaa0d4b7ddc98a2f7b1d,7096
# lts-24.43 excludes ram
Expand Down
6 changes: 3 additions & 3 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ packages:
original:
hackage: open-browser-0.5.1.0@sha256:0dc8dc33b9bba0e025e444355f6c2d806f62a4656446961c3647165f80f0d278,1959
- completed:
hackage: pantry-0.11.3@sha256:96fa2c7fa6cee9e470f984da567492f6bfaee058d14c1456f4f79b68a78d7be2,7668
hackage: pantry-0.11.4@sha256:9885d02c58e8725179146352b6d3f57395d3f1337c7713dc1409c61c9c21bb09,7668
pantry-tree:
sha256: bedd749e9cfdb8adb1a253b34a3350aa89f5ca903aa341579351ce0a937af1f5
sha256: cafafe0eb53f80194e20b7332db8e306c9eb949193f17cd48a71a79c8a3c30d2
size: 2722
original:
hackage: pantry-0.11.3@sha256:96fa2c7fa6cee9e470f984da567492f6bfaee058d14c1456f4f79b68a78d7be2,7668
hackage: pantry-0.11.4@sha256:9885d02c58e8725179146352b6d3f57395d3f1337c7713dc1409c61c9c21bb09,7668
- completed:
hackage: persistent-2.18.1.0@sha256:6a111b26c3e710f1e080a7543cf93766c4cc53ac560dbaa0d4b7ddc98a2f7b1d,7096
pantry-tree:
Expand Down
32 changes: 32 additions & 0 deletions tests/integration/tests/6927-cyclic-snapshots/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-- | Stack detects when snapshot locations form a cycle and reports an error.
--
-- See: https://github.com/commercialhaskell/stack/issues/6927

import Control.Monad ( unless )
import Data.List ( isInfixOf )
import StackTest

main :: IO ()
main = do
-- `stack build` makes use of pantry's loadAndCompleteSnapshotRaw':
stackErrStderr
["--stack-yaml", "stack1.yaml", "build"]
(expectMessage cycleDetected)
stackErrStderr
["--stack-yaml", "stack2.yaml", "build"]
(expectMessage cycleDetected)
-- `stack --snapshot <snapshot> list` makes use of pantry's loadSnapshot:
stackErrStderr
["--snapshot", "my-snapshot.yaml", "list", "base"]
(expectMessage cycleDetected)
stackErrStderr
["--snapshot", "my-snapshot1.yaml", "list", "base"]
(expectMessage cycleDetected)

cycleDetected :: String
cycleDetected = "Cycle detected while reading snapshot."

expectMessage :: String -> String -> IO ()
expectMessage msg stderr =
unless (words msg `isInfixOf` words stderr) $
error $ "Expected:\n\n" <> msg <> "\n\nin stderr, got:\n\n" <> stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
myPackage.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: my-snapshot

# In error, refers to itself:
snapshot: my-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: my-snapshot1

snapshot: my-snapshot2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: my-snapshot2

snapshot: my-snapshot3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: my-snapshot3

# In error, refers to my-snapshot1, creating a cycle:
snapshot: my-snapshot4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: my-snapshot4

# In error, refers to my-snapshot2, creating a cycle:
snapshot: my-snapshot2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
spec-version: 0.36.0

name: myPackage

dependencies:
- base

library:
source-dirs: src
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module Lib where
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
snapshot: my-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
snapshot: my-snapshot1.yaml
Loading