Skip to content

cabal upload behaves incorrect with -d flag #10227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
OrenGitHub opened this issue Jul 24, 2024 · 5 comments
Closed

cabal upload behaves incorrect with -d flag #10227

OrenGitHub opened this issue Jul 24, 2024 · 5 comments

Comments

@OrenGitHub
Copy link

The bug details are describe in this stack overflow question.
cabal upload fails with -d flag, but cabal haddock works fine.
without the -d flag, it also works fine.

@ulysses4ever
Copy link
Collaborator

It looks like you made some progress? Do you want to close this ticket?

@OrenGitHub
Copy link
Author

From what I understood - I think it's still a bug.
I only uploaded the package and not the documentation.
The cabal upload -d ... should also work, right? ( and currently it doesn't )

@ulysses4ever
Copy link
Collaborator

cabal upload -d will not work unless you build the documentation correctly first, unfortunately. Could you start from a clean state and try the instructions from the top post here: #8249 (comment) and show us all the output you get again?

Please, don't do any cabal install --lib as you show on SO -- this thing is meant for completely different use cases.

Also, there's no need to specify new as in cabal new-build because the new commands are the default these days.

@OrenGitHub
Copy link
Author

OrenGitHub commented Jul 24, 2024

Ohhh ... so this is what I was missing !
Here is what I ended up doing:

$ 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

@ulysses4ever - should I answer my own question in SO ? or simply point to this thread ?

@ulysses4ever
Copy link
Collaborator

Great!

It would be great if you could add the answer on SO, yes: it'll be much more discoverable that way, I think. Hopefully, future cabal users will benefit from it.

Happy hacking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants