You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% cabal sdist splitmix
Error: [Cabal-7151]
The component library cannot be packaged for distribution on its own. Only entire packages may be packaged for distribution.
splitmix is the name of package. cabal-install is hallucinating.
I tried the reproducer but providing the package with .cabal extension and then not providing the package at all (relying on it being found in the current directory):
$ cabal sdist prova
Warning: this is a debug build of cabal-install with assertions enabled.
Error: [Cabal-7151]
The component library cannot be packaged for distribution on its own.
Only entire packages may be packaged for distribution.
$ cabal sdist prova.cabal
Warning: this is a debug build of cabal-install with assertions enabled.
Wrote tarball sdist to
/home/.../prova/dist-newstyle/sdist/prova-0.1.0.0.tar.gz
$ cabal sdist
Warning: this is a debug build of cabal-install with assertions enabled.
Wrote tarball sdist to
/home/.../prova/dist-newstyle/sdist/prova-0.1.0.0.tar.gz
Checking the targets and noting that this command is meant to take packages not targets.
$ cabal target
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...
Fully qualified target forms:
- prova:lib:prova
Found 1 target matching all.
$ cabal sdist --help
Generate a source distribution file (.tar.gz).
Usage: cabal sdist [FLAGS] [PACKAGES]
Generates tarballs of project packages suitable for upload to Hackage.
...
$ cabal sdist .
Warning: this is a debug build of cabal-install with assertions enabled.
Wrote tarball sdist to
/home/.../prova/dist-newstyle/sdist/prova-0.1.0.0.tar.gz
In this project the all target (all packages!) can be used:
$ cabal run cabal -- sdist all
Warning: this is a debug build of cabal-install with assertions enabled.
Build profile: -w ghc-9.12.2 -O1
In order, the following will be built (use -v for more details):
- cabal-install-3.17.0.0 (exe:cabal) (configuration changed)
Warning: this is a debug build of cabal-install with assertions enabled.
Configuring executable 'cabal' for cabal-install-3.17.0.0...
Warning: this is a debug build of cabal-install with assertions enabled.
Preprocessing executable 'cabal' for cabal-install-3.17.0.0...
Building executable 'cabal' for cabal-install-3.17.0.0...
Warning: this is a debug build of cabal-install with assertions enabled.
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/Cabal-3.17.0.0.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/Cabal-described-3.17.0.0.tar.gz
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/Cabal-syntax-3.17.0.0.tar.gz
Wrote tarball sdist to
...
Wrote tarball sdist to
/home/.../cabal/dist-newstyle/sdist/solver-benchmarks-3.tar.gz
% cabal sdist aeson:lib:aeson
Error: [Cabal-7151]
The component library cannot be packaged for distribution on its own. Only entire packages may be packaged for distribution.
still an issue. yes, I can use cabal sdist all; but if you trell me to use that, just remove the target selection from sdist compeltely if it doesnt' work.
Activity
ffaf1 commentedon Jan 5, 2026
To reproduce:
philderbeast commentedon Mar 5, 2026
I tried the reproducer but providing the package with
.cabalextension and then not providing the package at all (relying on it being found in the current directory):Checking the targets and noting that this command is meant to take packages not targets.
philderbeast commentedon Mar 5, 2026
The folder of the package can also be used:
philderbeast commentedon Mar 5, 2026
In this project the
alltarget (allpackages!) can be used:phadej commentedon Apr 16, 2026
still an issue. yes, I can use
cabal sdist all; but if you trell me to use that, just remove the target selection fromsdistcompeltely if it doesnt' work.fix: `cabal sdist` target selection (haskell#11385)