Skip to content
New issue

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

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

Already on GitHub? # to your account

Automate Hackage release #2275

Open
steve-chavez opened this issue May 4, 2022 · 2 comments
Open

Automate Hackage release #2275

steve-chavez opened this issue May 4, 2022 · 2 comments
Labels
ci Related to CI setup

Comments

@steve-chavez
Copy link
Member

steve-chavez commented May 4, 2022

Manual Hackage releases can lag considerably - I just released https://hackage.haskell.org/package/postgrest-9.0.0 🤦‍♂️

This should be automated on CI.

Steps I follow:

$ nix-shell

$ cabal v2-haddock --haddock-for-hackage --enable-doc
$ cabal sdist # might not be necessary

$ cabal upload dist-newstyle/sdist/postgrest-9.0.0.tar.gz
hackage.haskell.org username:
hackage.haskell.org password:
Uploading dist-newstyle/sdist/postgrest-9.0.0.tar.gz...
Error uploading dist-newstyle/sdist/postgrest-9.0.0.tar.gz: http code 400
Error: Invalid package

'ghc-options: -fhpc' is not necessary. Use the configure flag
--enable-coverage instead.

# I manually remove the fhpc from postgrest.cabal and run cabal sdist again

$ cabal upload dist-newstyle/sdist/postgrest-9.0.0.tar.gz
hackage.haskell.org username: 
hackage.haskell.org password:
Uploading dist-newstyle/sdist/postgrest-9.0.0.tar.gz...
Error uploading dist-newstyle/sdist/postgrest-9.0.0.tar.gz: http code 400
Error: Invalid package

'ghc-options: -Wall -Werror' makes the package very easy to break with future
GHC versions because new GHC versions often add new warnings. Use just
'ghc-options: -Wall' instead. Alternatively, if you want to use this, make it
conditional based on a Cabal configuration flag (with 'manual: True' and
'default: False') and enable that flag during development.

# Same with above, rerun cabal sdist

$ cabal upload dist-newstyle/sdist/postgrest-9.0.0.tar.gz
hackage.haskell.org username: 
hackage.haskell.org password:
Uploading dist-newstyle/sdist/postgrest-9.0.0.tar.gz...
Package successfully uploaded as candidate. You can now preview the result at
'https://hackage.haskell.org/package/postgrest-9.0.0/candidate'. To publish
the candidate, use 'cabal upload --publish'.
Warnings:
- 'ghc-options: -O0' is not needed. Use the --disable-optimization configure
flag.
- 'ghc-options: -O0' is not needed. Use the --disable-optimization configure
flag.
- 'ghc-options: -O2' is rarely needed. Check that it is giving a real benefit
and not just imposing longer compile times on your users.

# The above succeeded

# For docs
cabal upload -d dist-newstyle/postgrest-9.0.0-docs.tar.gz
hackage.haskell.org username: 
hackage.haskell.org password:
Uploading documentation dist-newstyle/postgrest-9.0.0-docs.tar.gz...
Documentation successfully uploaded for package candidate. You can now preview
the result at 'https://hackage.haskell.org/package/postgrest-9.0.0/candidate'.
To upload non-candidate documentation, use 'cabal upload --publish'.

# The above were just for generating a candidate for CI we should use the following directly
$ cabal upload --publish dist-newstyle/sdist/postgrest-9.0.0.tar.gz
$ cabal upload -d --publish dist-newstyle/postgrest-9.0.0-docs.tar.gz

We should probably clear some of those warnings with flags in the .cabal file.

References:

@steve-chavez steve-chavez added the ci Related to CI setup label May 4, 2022
@sternenseemann
Copy link

Timely hackage releases would be appreciated!

@steve-chavez
Copy link
Member Author

There are some ready made Github actions nowadays:

However this is currently blocked bc we use a fork of https://github.com/haskellari/postgresql-libpq:

postgresql-libpq = lib.dontCheck
(prev.callCabal2nix "postgresql-libpq"
(super.fetchFromGitHub {
owner = "PostgREST";
repo = "postgresql-libpq";
rev = "890a0a16cf57dd401420fdc6c7d576fb696003bc"; # master
sha256 = "1wmyhldk0k14y8whp1p4akrkqxf5snh8qsbm7fv5f7kz95nyffd0";
})
{ });

https://github.com/PostgREST/postgresql-libpq, which is not on Hackage.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
ci Related to CI setup
Development

No branches or pull requests

2 participants