cabal-testsuite bare versus v2-prefixed command handling
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 65/100
Research direction
Start by reading cabal-testsuite/src/Test/Cabal/Prelude.hs around the linked cabalGArgs code, then run the provided PackageTests/SDist/Respect-Project-File/cabal.no-project.test.hs reproduction. Check how the test helper recognizes Cabal commands and aliases. Done means the test can use sdist and behaves like v2-sdist, with the expected output and location.
Written by the indexing model from the issue text.
Description
Describe the bug
I used sdist in a cabal-testsuite test in #12499 and it failed the validate step. Changing this to v2-dist fixed the test failure but v2-sdist is a synonym for sdist, isn't it?
$ cabal --help
[sanity checks and shipping]
...
sdist Generate a source distribution file (.tar.gz).
...
[new-style projects (forwards-compatible aliases)]
...
v2-sdist Generate a source distribution file (.tar.gz).
[legacy command aliases]
v1-build Compile all/specific components.
v1-configure Prepare to build the package.
v1-repl Open an interpreter session for the given component.
v1-run Builds and runs an executable.
v1-test Run all/specific tests in the test suite.
v1-bench Run all/specific benchmarks.
v1-freeze Freeze dependencies.
v1-haddock Generate Haddock HTML documentation.
v1-install Install packages.
v1-clean Clean up after a build.
v1-copy Copy the files of all/specific components to install locations.
v1-register Register this package with the compiler.
v1-reconfigure Reconfigure the package if necessary.
v1-gen-bounds Generate dependency bounds.
Note there is no v1-sdist included with the help.
Perhaps the command matching in cabalGArgs is out of step with cabal's commands and command aliases?
To Reproduce
On master from the root:
cabal build cabal-install:exe:cabal cabal-testsuite:cabal-tests
CABAL=$(cabal list-bin cabal-install:exe:cabal)
TESTS=$(cabal list-bin cabal-testsuite:cabal-tests)
cd cabal-testsuite
$TESTS --with-cabal=$CABAL --intree-cabal-lib=$PWD/.. \
--test-tmp=/tmp/cabal-testdb \
PackageTests/SDist/Respect-Project-File/cabal.no-project.test.hs
...
Error: cabal: unrecognized 'sdist' option
`--package-db=/tmp/cabal-testdb/intree/store/ghc-9.14.1-c6c3/package.db'
Now change the test:
--- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.no-project.test.hs
+++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.no-project.test.hs
- cabal "sdist" ["all"]
+ cabal "v2-sdist" ["all"]
The test has different output when run again with this diff:
CABAL=$(cabal list-bin cabal-install:exe:cabal)
TESTS=$(cabal list-bin cabal-testsuite:cabal-tests)
cd cabal-testsuite
$TESTS --with-cabal=$CABAL --intree-cabal-lib=$PWD/.. \
--test-tmp=/tmp/cabal-testdb \
PackageTests/SDist/Respect-Project-File/cabal.no-project.test.hs
...
# STDERR:
--- /tmp/cabal-testsuite-3454100/cabal.no-project.dist/cabal.no-project.out.normalized 2026-10-30 12:09:13.663990497 -0400
+++ /tmp/cabal-testsuite-3454100/cabal.no-project.dist/cabal.no-project.comp.out.normalized 2026-10-30 12:09:13.663929684 -0400
@@ -1,2 +1,2 @@
-# cabal sdist
-Wrote tarball sdist to <ROOT>/cabal.no-project.dist/work/./dist/sdist/p-0.1.tar.gz
+# cabal v2-sdist
+Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/p-0.1.tar.gz
cabal.no-project.test.hs: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
FAIL
...
Expected behavior
That I can use the current command vocabulary in tests. In this case that I can usesdist for a test and that behaves the same as if I'd used v2-sdist.
- Dominant language
- Haskell
- Stars
- 1.8k
- Forks
- 766
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 27
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from haskell/cabal
-
needs triage type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
haskell/cabal#12568 · 1 comment ·
Maintainers usually reply within 3 days
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
haskell/cabal#12525 · 3 comments · 1 reaction ·
Maintainers usually reply within 3 days
-
Required version of `cabal-install` to build CabalPossibly taken @philderbeast claimed this 24 days ago. Opendocumentation type: discussion
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
haskell/cabal#12477 · 2 comments · 1 assignee ·
Maintainers usually reply within 3 days
-
Document which are our LTS releasesPossibly taken @KeuqS claimed this 41 days ago. Opendocumentation type: discussion
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
haskell/cabal#12373 · 2 comments ·
Maintainers usually reply within 3 days
Similar issues
-
bug desktop
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
simplex-chat/simplex-chat#8291 ·
Maintainers usually reply within 1 day
-
[BUG]: C# programs with top-level statements fail to compilePossibly taken @AsyncNigam claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
compiler-explorer/compiler-explorer#9625 · 1 comment ·
Maintainers usually reply within 1 day
-
reflex-0.10Open
Difficulty 1/5 Under an hour Newbie friendliness 62/100
commercialhaskell/stackage#8180 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenZeppelin/canton-contracts#140 ·
Maintainers usually reply within 1 day
-
takeInterval yields nothing, dropInterval drops nothingPossibly taken @GuillaumedeVolpiano claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
composewell/streamly#3271 ·