Skip to content

Commit 1e62b82

Browse files
committed
Add test cases that reproduce haskell#7241.
- Move project sdist tests to cabal-testsuite - Add --ignore-project test - Duplicate tests but without cabal.project - Add a cabal.project one folder up - Add a package Z in the root - Rerun --accept with more immediate parent project - Add a readme for the tests - Fix problems with uv package, update expected output - Add U and V modules - Explain what is wrong with cabal.dot-uv.test.hs - Add a note on cabal.no-project.test.hs - Explain what is wrong with cabal.sub-pq.test.hs - Explain what is wrong with cabal.sub-rs.test.hs - Explain what is wrong with cabal.dot-uv.test.hs - Leave a note explaining cabal.no-project.test.hs - Leave a note explaining cabal.project.test.hs - Leave a note explaining cabal.sub-pq.test.hs - Explain what is wrong with cabal.sub-rs.test.hs - Patches for project respecting behaviour - Explain root ignore-project and no-project tests - Add *.v2.test.hs variants exercising v2-sdist - Add v2 patches, test out not using <ROOT>
1 parent 1a8b93c commit 1e62b82

File tree

92 files changed

+500
-0
lines changed

Some content is hidden

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

92 files changed

+500
-0
lines changed

cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/U.hs

Whitespace-only changes.

cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/V.hs

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal sdist
2+
Wrote tarball sdist to <ROOT>/cabal.dot-uv.dist/work/./dist/sdist/p-0.1.tar.gz
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.out b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.out
2+
index 3d6859f99..a7ffc109e 100644
3+
--- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.out
4+
+++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.out
5+
@@ -1,2 +1,2 @@
6+
# cabal sdist
7+
-Wrote tarball sdist to <ROOT>/cabal.dot-uv.dist/work/./dist/sdist/p-0.1.tar.gz
8+
+Wrote tarball sdist to <ROOT>/cabal.dot-uv.dist/work/./dist/sdist/uv-0.1.tar.gz
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: .
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Test.Cabal.Prelude
2+
3+
-- cabal.dot-uv.project has "packages: .". That package is uv.cabal but "cabal
4+
-- sdist" writes sdist/p-0.1.tar.gz instead of the expected sdist/uv-0.1.tar.gz.
5+
-- That is wrong, "cabal sdist" should respect the "--project-file" option but
6+
-- instead probes the parent directory and picks up "../cabal.project" that has
7+
-- "packages: Projects-Default-No/p".
8+
--
9+
-- TODO: Fix this behaviour and apply the patch cabal.dot-uv.patch to update the
10+
-- expected output to what we'd expect if "cabal sdist" respected the project.
11+
main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do
12+
cabal "sdist" ["all"]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal v2-sdist
2+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/uv-0.1.tar.gz
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Test.Cabal.Prelude
2+
3+
-- cabal.dot-uv.project has "packages: .". That package is uv.cabal and "cabal
4+
-- v2-sdist" writes sdist/uv-0.1.tar.gz. This is correct.
5+
main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do
6+
cabal "v2-sdist" ["all"]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal sdist
2+
Wrote tarball sdist to <ROOT>/cabal.ignore-project.dist/work/./dist/sdist/uv-0.1.tar.gz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Test.Cabal.Prelude
2+
3+
-- This test correctly writes sdist/uv-0.1.tar.gz for the uv.cabal package.
4+
main = cabalTest $ do
5+
cabal "sdist" ["all", "--ignore-project"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal v2-sdist
2+
Wrote tarball sdist to /home/philderbeast/dev/src/cabalism/cabal/cabal-testsuite/PackageTests/SDist/Respect-Project-File/dist-newstyle/sdist/p-0.1.tar.gz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Test.Cabal.Prelude
2+
3+
-- This test should have written sdist/uv-0.1.tar.gz for the uv.cabal package
4+
-- but instead it probed up the directory tree, found a default cabal.project
5+
-- and wrote sdist/p-0.1.tar.gz. That is incorrect. It didn't ignore the
6+
-- project.
7+
main = cabalTest $ do
8+
cabal "v2-sdist" ["all", "--ignore-project"]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal sdist
2+
Wrote tarball sdist to <ROOT>/cabal.no-project.dist/work/./dist/sdist/p-0.1.tar.gz
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Test.Cabal.Prelude
2+
3+
-- When no project is given, "cabal sdist" probes up the directory tree, finds a
4+
-- default cabal.project and writes sdist/p-0.1.tar.gz. That is acceptable. An
5+
-- alternative and reasonable expectation (but not the behaviour seen) is that
6+
-- project probing would not occur and "cabal sdist" would work on the local
7+
-- uv.cabal package.
8+
main = cabalTest $ do
9+
cabal "sdist" ["all"]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal v2-sdist
2+
Wrote tarball sdist to /home/philderbeast/dev/src/cabalism/cabal/cabal-testsuite/PackageTests/SDist/Respect-Project-File/dist-newstyle/sdist/p-0.1.tar.gz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Test.Cabal.Prelude
2+
3+
-- When no project is given, "cabal v2-sdist" probes up the directory tree,
4+
-- finds a default cabal.project and writes sdist/p-0.1.tar.gz. That is
5+
-- acceptable. An alternative and reasonable expectation (but not the behaviour
6+
-- seen) is that project probing would not occur and "cabal v2-sdist" would work
7+
-- on the local uv.cabal package.
8+
main = cabalTest $ do
9+
cabal "v2-sdist" ["all"]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal sdist
2+
Wrote tarball sdist to <ROOT>/cabal.sub-pq.dist/work/./dist/sdist/p-0.1.tar.gz
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.out b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.out
2+
index c96d15ee6..12dcc1217 100644
3+
--- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.out
4+
+++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.out
5+
@@ -1,2 +1,3 @@
6+
# cabal sdist
7+
Wrote tarball sdist to <ROOT>/cabal.sub-pq.dist/work/./dist/sdist/p-0.1.tar.gz
8+
+Wrote tarball sdist to <ROOT>/cabal.sub-pq.dist/work/./dist/sdist/q-0.1.tar.gz
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: p/ q/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Test.Cabal.Prelude
2+
3+
-- cabal.sub-pq.project has "packages: p/ q/" but "cabal sdist" only writes
4+
-- sdist/p-0.1.tar.gz instead of the expected sdist/p-0.1.tar.gz and
5+
-- sdist/q-0.1.tar.gz. That is wrong, "cabal sdist" should respect the
6+
-- "--project-file" option but instead probes the parent directory and picks up
7+
-- "../cabal.project" that has "packages: Projects-Default-No/p".
8+
--
9+
-- TODO: Fix this behaviour and apply the patch cabal.sub-pq.patch to update the
10+
-- expected output to what we'd expect if "cabal sdist" respected the project.
11+
main = cabalTest . withProjectFile "cabal.sub-pq.project" $ do
12+
cabal "sdist" ["all"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cabal v2-sdist
2+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/p-0.1.tar.gz
3+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/q-0.1.tar.gz
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Test.Cabal.Prelude
2+
3+
-- cabal.sub-pq.project has "packages: p/ q/" and "cabal v2-sdist" writes
4+
-- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct.
5+
main = cabalTest . withProjectFile "cabal.sub-pq.project" $ do
6+
cabal "v2-sdist" ["all"]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal sdist
2+
Wrote tarball sdist to <ROOT>/cabal.sub-rs.dist/work/./dist/sdist/p-0.1.tar.gz
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-rs.out b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-rs.out
2+
index 3a0a8e5f4..b4cced990 100644
3+
--- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-rs.out
4+
+++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-rs.out
5+
@@ -1,2 +1,3 @@
6+
# cabal sdist
7+
-Wrote tarball sdist to <ROOT>/cabal.sub-rs.dist/work/./dist/sdist/p-0.1.tar.gz
8+
+Wrote tarball sdist to <ROOT>/cabal.sub-rs.dist/work/./dist/sdist/r-0.1.tar.gz
9+
+Wrote tarball sdist to <ROOT>/cabal.sub-rs.dist/work/./dist/sdist/s-0.1.tar.gz
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: r/ s/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Test.Cabal.Prelude
2+
3+
-- cabal.sub-rs.project has "packages: r/ s/" but "cabal sdist" writes
4+
-- sdist/p-0.1.tar.gz instead of the expected sdist/r-0.1.tar.gz and
5+
-- sdist/s-0.1.tar.gz. That is wrong, "cabal sdist" should respect the
6+
-- "--project-file" option but instead probes the parent directory and picks up
7+
-- "../cabal.project" that has "packages: Projects-Default-No/p".
8+
--
9+
-- TODO: Fix this behaviour and apply the patch cabal.sub-rs.patch to update the
10+
-- expected output to what we'd expect if "cabal sdist" respected the project.
11+
main = cabalTest . withProjectFile "cabal.sub-rs.project" $ do
12+
cabal "sdist" ["all"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cabal v2-sdist
2+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/r-0.1.tar.gz
3+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/s-0.1.tar.gz
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Test.Cabal.Prelude
2+
3+
-- cabal.sub-rs.project has "packages: r/ s/" and "cabal v2-sdist" writes
4+
-- sdist/r-0.1.tar.gz and sdist/s-0.1.tar.gz. This is correct.
5+
main = cabalTest . withProjectFile "cabal.sub-rs.project" $ do
6+
cabal "v2-sdist" ["all"]

cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/p/P.hs

Whitespace-only changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: p
2+
version: 0.1
3+
build-type: Simple
4+
cabal-version: >= 1.2
5+
6+
library
7+
exposed-modules: P
8+
build-depends: base

cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/q/Q.hs

Whitespace-only changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: q
2+
version: 0.1
3+
build-type: Simple
4+
cabal-version: >= 1.2
5+
6+
library
7+
exposed-modules: Q
8+
build-depends: base

cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/r/R.hs

Whitespace-only changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: r
2+
version: 0.1
3+
build-type: Simple
4+
cabal-version: >= 1.2
5+
6+
library
7+
exposed-modules: R
8+
build-depends: base

cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/s/S.hs

Whitespace-only changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: s
2+
version: 0.1
3+
build-type: Simple
4+
cabal-version: >= 1.2
5+
6+
library
7+
exposed-modules: S
8+
build-depends: base
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
cabal-version: 3.0
2+
name: uv
3+
version: 0.1
4+
build-type: Simple
5+
6+
library U
7+
visibility: public
8+
exposed-modules: U
9+
build-depends: base
10+
11+
library V
12+
visibility: public
13+
exposed-modules: V
14+
build-depends: base

cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/U.hs

Whitespace-only changes.

cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/V.hs

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cabal sdist
2+
Wrote tarball sdist to <ROOT>/cabal.dot-uv.dist/work/./dist/sdist/p-0.1.tar.gz
3+
Wrote tarball sdist to <ROOT>/cabal.dot-uv.dist/work/./dist/sdist/q-0.1.tar.gz
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.dot-uv.out b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.dot-uv.out
2+
index 231e0d306..a7ffc109e 100644
3+
--- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.dot-uv.out
4+
+++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.dot-uv.out
5+
@@ -1,3 +1,2 @@
6+
# cabal sdist
7+
-Wrote tarball sdist to <ROOT>/cabal.dot-uv.dist/work/./dist/sdist/p-0.1.tar.gz
8+
-Wrote tarball sdist to <ROOT>/cabal.dot-uv.dist/work/./dist/sdist/q-0.1.tar.gz
9+
+Wrote tarball sdist to <ROOT>/cabal.dot-uv.dist/work/./dist/sdist/uv-0.1.tar.gz
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: .
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Test.Cabal.Prelude
2+
3+
-- cabal.dot-uv.project has "packages: .". That package is uv.cabal but "cabal
4+
-- sdist" writes sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz instead of the
5+
-- expected sdist/uv-0.1.tar.gz. That is wrong, "cabal sdist" should respect
6+
-- the "--project-file" option but instead picks up the default "cabal.project"
7+
-- that has "packages: p/ q/".
8+
--
9+
-- TODO: Fix this behaviour and apply the patch cabal.dot-uv.patch to update the
10+
-- expected output to what we'd expect if "cabal sdist" respected the project.
11+
main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do
12+
cabal "sdist" ["all"]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal v2-sdist
2+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/uv-0.1.tar.gz
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Test.Cabal.Prelude
2+
3+
-- cabal.dot-uv.project has "packages: .". That package is uv.cabal and "cabal
4+
-- v2-sdist" writes sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. That is correct.
5+
main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do
6+
cabal "v2-sdist" ["all"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal sdist
2+
Wrote tarball sdist to <ROOT>/cabal.ignore-project.dist/work/./dist/sdist/uv-0.1.tar.gz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Test.Cabal.Prelude
2+
3+
-- This test correctly writes sdist/uv-0.1.tar.gz for the uv.cabal package.
4+
main = cabalTest $ do
5+
cabal "sdist" ["all", "--ignore-project"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cabal v2-sdist
2+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/p-0.1.tar.gz
3+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/q-0.1.tar.gz

cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.ignore-project.v2.patch

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Test.Cabal.Prelude
2+
3+
-- This test doesn't ignore the project. It should have written
4+
-- sdist/uv-0.1.tar.gz for the uv.cabal package but instead it wrote
5+
-- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz.
6+
main = cabalTest $ do
7+
cabal "v2-sdist" ["all", "--ignore-project"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cabal sdist
2+
Wrote tarball sdist to <ROOT>/cabal.no-project.dist/work/./dist/sdist/p-0.1.tar.gz
3+
Wrote tarball sdist to <ROOT>/cabal.no-project.dist/work/./dist/sdist/q-0.1.tar.gz
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Test.Cabal.Prelude
2+
3+
-- When no project is given, "cabal sdist" finds a default cabal.project that
4+
-- has "packages: p/ q/" and writes sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz.
5+
-- This is correct.
6+
--
7+
-- TODO: Check that the code is behaving the same as it would have if
8+
-- "--project-file=cabal.project" was given or if it is using project probing.
9+
main = cabalTest $ do
10+
cabal "sdist" ["all"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cabal v2-sdist
2+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/p-0.1.tar.gz
3+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/q-0.1.tar.gz

cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.no-project.v2.patch

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Test.Cabal.Prelude
2+
3+
-- When no project is given, "cabal v2-sdist" finds a default cabal.project that
4+
-- has "packages: p/ q/" and writes sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz.
5+
-- This is correct.
6+
main = cabalTest $ do
7+
cabal "v2-sdist" ["all"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: p/ q/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cabal sdist
2+
Wrote tarball sdist to <ROOT>/cabal.project.dist/work/./dist/sdist/p-0.1.tar.gz
3+
Wrote tarball sdist to <ROOT>/cabal.project.dist/work/./dist/sdist/q-0.1.tar.gz
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Test.Cabal.Prelude
2+
3+
-- The given cabal.project has has "packages: p/ q/" and "cabal sdist" writes
4+
-- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct but likely
5+
-- accidental as the default cabal.project has the same packages.
6+
main = cabalTest . withProjectFile "cabal.project" $ do
7+
cabal "sdist" ["all"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cabal v2-sdist
2+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/p-0.1.tar.gz
3+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/q-0.1.tar.gz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Test.Cabal.Prelude
2+
3+
-- The given cabal.project has has "packages: p/ q/" and "cabal v2-sdist" writes
4+
-- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct.
5+
main = cabalTest . withProjectFile "cabal.project" $ do
6+
cabal "v2-sdist" ["all"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cabal sdist
2+
Wrote tarball sdist to <ROOT>/cabal.sub-pq.dist/work/./dist/sdist/p-0.1.tar.gz
3+
Wrote tarball sdist to <ROOT>/cabal.sub-pq.dist/work/./dist/sdist/q-0.1.tar.gz
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: p/ q/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Test.Cabal.Prelude
2+
3+
-- cabal.sub-pq.project has "packages: p/ q/" and "cabal sdist" writes
4+
-- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct.
5+
main = cabalTest . withProjectFile "cabal.sub-pq.project" $ do
6+
cabal "sdist" ["all"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cabal v2-sdist
2+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/p-0.1.tar.gz
3+
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/q-0.1.tar.gz
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Test.Cabal.Prelude
2+
3+
-- cabal.sub-pq.project has "packages: p/ q/" and "cabal v2-sdist" writes
4+
-- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct.
5+
main = cabalTest . withProjectFile "cabal.sub-pq.project" $ do
6+
cabal "v2-sdist" ["all"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cabal sdist
2+
Wrote tarball sdist to <ROOT>/cabal.sub-rs.dist/work/./dist/sdist/p-0.1.tar.gz
3+
Wrote tarball sdist to <ROOT>/cabal.sub-rs.dist/work/./dist/sdist/q-0.1.tar.gz
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-rs.out b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-rs.out
2+
index 264d9e001..b4cced990 100644
3+
--- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-rs.out
4+
+++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-rs.out
5+
@@ -1,3 +1,3 @@
6+
# cabal sdist
7+
-Wrote tarball sdist to <ROOT>/cabal.sub-rs.dist/work/./dist/sdist/p-0.1.tar.gz
8+
-Wrote tarball sdist to <ROOT>/cabal.sub-rs.dist/work/./dist/sdist/q-0.1.tar.gz
9+
+Wrote tarball sdist to <ROOT>/cabal.sub-rs.dist/work/./dist/sdist/r-0.1.tar.gz
10+
+Wrote tarball sdist to <ROOT>/cabal.sub-rs.dist/work/./dist/sdist/s-0.1.tar.gz
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: r/ s/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Test.Cabal.Prelude
2+
3+
-- cabal.sub-rs.project has "packages: r/ s/" but "cabal sdist" writes
4+
-- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz instead of the expected
5+
-- sdist/r-0.1.tar.gz and sdist/s-0.1.tar.gz. That is wrong, "cabal sdist"
6+
-- should respect the "--project-file" option but instead picks up the default
7+
-- "cabal.project" that has "packages: p/ q/".
8+
--
9+
-- TODO: Fix this behaviour and apply the patch cabal.sub-rs.patch to update the
10+
-- expected output to what we'd expect if "cabal sdist" respected the project.
11+
main = cabalTest . withProjectFile "cabal.sub-rs.project" $ do
12+
cabal "sdist" ["all"]

0 commit comments

Comments
 (0)