cabal-testsuite bare versus v2-prefixed command handling
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 65/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Haskell
- Stelle
- 1.8k
- Fork
- 766
- Merge medio
- 5g 21h
- PR unite (30g)
- 27
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di haskell/cabal
-
needs triage type: enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 3 giorni
-
needs triage type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
haskell/cabal#12568 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
needs triage type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
haskell/cabal#12525 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 3 giorni
-
Required version of `cabal-install` to build CabalForse già presa @philderbeast l’ha presa 24 giorni fa. Apertadocumentation type: discussion
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
haskell/cabal#12477 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
Document which are our LTS releasesForse già presa @KeuqS l’ha presa 41 giorni fa. Apertadocumentation type: discussion
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
haskell/cabal#12373 · 2 commenti ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di haskell/cabal
Issue simili
-
bug desktop
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
simplex-chat/simplex-chat#8291 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: C# programs with top-level statements fail to compileForse già presa @AsyncNigam l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
compiler-explorer/compiler-explorer#9625 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
reflex-0.10Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
commercialhaskell/stackage#8180 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenZeppelin/canton-contracts#140 ·
I maintainer di solito rispondono entro 1 giorno
-
takeInterval yields nothing, dropInterval drops nothingForse già presa @GuillaumedeVolpiano l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
composewell/streamly#3271 ·