I'm trying to upload my first Haskell package:
$ git clone https://github.com/OrenGitHub/dhscanner.ast.git 2>/dev/null
$ cd dhscanner.ast/
$ cabal --version
cabal-install version 3.10.1.0 # <--- modern enough, right ?
compiled using version 3.10.1.0 of the Cabal library
$ cabal update # <--- just to be on the safe side
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org is up to date.
The index-state is set to 2024-07-23T00:03:37Z.
When I google-d the error message, cabal new-build
was recommended
$ cabal new-build
Resolving dependencies...
Build profile: -w ghc-9.4.7 -O1
In order, the following will be built (use -v for more details):
- dhscanner-ast-0.1.0.0 (lib) (first run)
Configuring library for dhscanner-ast-0.1.0.0..
Preprocessing library for dhscanner-ast-0.1.0.0..
Building library for dhscanner-ast-0.1.0.0..
[1 of 3] Compiling Location ( ... )
[2 of 3] Compiling Token ( ... )
[3 of 3] Compiling Ast ( ... )
$ cabal install --force-reinstalls --lib
Wrote tarball sdist to
/home/oren/GitHub/dhscanner.ast/dist-newstyle/sdist/dhscanner-ast-0.1.0.0.tar.gz
< ... omitted for brevity ...>
But it didn't help, and I still can't upload my package:
$ cabal upload -d --publish -u ***** -p ********
No documentation tarball specified. Building a documentation tarball with
default settings...
If you need to customise Haddock options, run 'haddock --for-hackage' first to
generate a documentation tarball.
Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
[__0] trying: dhscanner-ast-0.1.0.0 (user goal)
[__1] unknown package: aeson (dependency of dhscanner-ast)
[__1] fail (backjumping, conflict set: aeson, dhscanner-ast)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: dhscanner-ast, aeson
Trying configure anyway.
Configuring dhscanner-ast-0.1.0.0...
Error: cabal: Encountered missing or private dependencies:
aeson <2.3
EDIT1:
$ cabal info aeson
* aeson (library)
Synopsis: Fast JSON parsing and encoding
Versions available: 1.5.5.1, 1.5.6.0, 2.0.3.0, 2.1.1.0, 2.1.2.0, 2.1.2.1,
2.2.1.0, 2.2.2.0, 2.2.3.0 (and 89 others)
Versions installed: [ Not installed ] # <--- that's weird, right?
also, cabal haddock
finishes fine, with resulting html
files.
1 requested in comments
cabal upload
it.$ cabal haddock --haddock-for-hackage --haddock-option=--hyperlinked-source
# < ... omitted for brevity ... >
Documentation tarball created:
C:\Users\tuna_\GitHub\dhscanner.ast\dist-newstyle\dhscanner-ast-0.1.0.1-docs.tar.gz
$ cabal upload --publish C:\Users\tuna_\GitHub\dhscanner.ast\dist-newstyle\sdist\dhscanner-ast-0.1.0.0.tar.gz # the package comes *before* the documentation
$ cabal upload --publish -d C:\Users\tuna_\GitHub\dhscanner.ast\dist-newstyle\dhscanner-ast-0.1.0.0-docs.tar.gz