Skip to content

Semiautomatic hackage releases#2163

Merged
jneira merged 28 commits into
haskell:masterfrom
jneira:release-hackage
Sep 9, 2021
Merged

Semiautomatic hackage releases#2163
jneira merged 28 commits into
haskell:masterfrom
jneira:release-hackage

Conversation

@jneira

@jneira jneira commented Sep 6, 2021

Copy link
Copy Markdown
Member
  • This try to make hackage releases as smooth as possible, hopefully fixes Automate hackage releases #1310
  • It is dumb about changes: if some file (module obvious exclusions like docs files) has changed, we have to bomp up the version or it will fail
  • It builds all packages for three last ghc major versions so it will take some time (with cold cache)
  • It upload package candidates, a human should confirm the definitive release (ahopefully fter some manual checks)
  • It depends on Remove ghc-api source snapshot #2156 to avoid errors about ghc-api-compat
  • It is failing for hls-call-hierarchy-plugin:

Comment thread .github/workflows/hackage.yml Outdated
@July541

July541 commented Sep 6, 2021

Copy link
Copy Markdown
Collaborator

It is caused by aeson's Value, Value support Ord instance after their 1.5.2.0.

I checked your test and found it uses 1.4.7.1...

I think to add a lower bound for aeson in hls-call-hierarchy-plugin is enough (Maybe you can add it directly, I don't know how to participate in this thread..)

@jneira

jneira commented Sep 6, 2021

Copy link
Copy Markdown
Member Author

I think to add a lower bound for aeson in hls-call-hierarchy-plugin is enough (Maybe you can add it directly, I don't know how to participate in this thread..)

dont worry, the diagnostic is the "hard" part, will add the bound here, thanks!

Comment thread .github/workflows/hackage.yml
cd $(ls -d ./incoming/${{ matrix.package }}-*)
echo "packages: . ../../* ../../plugins/*" > cabal.project
# TODO: remove when not needed
echo "allow-newer: Chart-diagrams:diagrams-core, SVGFonts:diagrams-core" >> cabal.project

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are only needed to build the benchmark suite of ghcide. The benchmark suite is not a requirement for uploading to Hackage imho, and should be skipped

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya, but to use a simple autogenerated cabal.project with packages: . ../../* ../../plugins/* cabal has to find a build plan for shake-bench. The alternative is a cabal project listing explicitly all packages but shake-bench.
Otoh in theory you should be able to run the benchmarks (like tests) with the hackage version too, and ideally those allow-newer should be removed to allow it

if: steps.get-hackage-version.exists != 'true'
run: |
cd $(ls -d ./incoming/${{ matrix.package }}-*)
cabal build --enable-tests --enable-benchmarks

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cabal build --enable-tests --enable-benchmarks
cabal build --enable-tests

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally benchmarks should be able to run using the hackage version

@pepeiborra pepeiborra left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job, this is going to be super useful

@pepeiborra

Copy link
Copy Markdown
Collaborator

Next step would be integrating @kowainik Policeman to validate the updated version numbers: https://kowainik.github.io/projects/policeman

@jneira

jneira commented Sep 7, 2021

Copy link
Copy Markdown
Member Author

Next step would be integrating @kowainik Policeman to validate the updated version numbers: https://kowainik.github.io/projects/policeman

wow, i had forgotten it, it would be really nice, will open an issue after merging this

@jneira

jneira commented Sep 7, 2021

Copy link
Copy Markdown
Member Author

I've used a hackage token generated from my account, it can be changed in the project secrets
However i have not perms to upload to all packages involved, missing are:

Most of them have @pepeiborra as unique maitainer so an option could be that @pepeiborra generates a hackage api key (i would create a new, dedicated, one). But even doing that i would add some more maintainers to those plugin with only one parent 😉

EDIT: resolved with a new token with full access, thanks @pepeiborra!

@pepeiborra

Copy link
Copy Markdown
Collaborator

I have added you to the maintainers list for all of them

@jneira

jneira commented Sep 7, 2021

Copy link
Copy Markdown
Member Author

Ok the workflow has failed in the last step, cause i did not put the hackage api key:

https://github.com/jneira/haskell-language-server/actions/runs/1208936609

Run haskell-actions/hackage-publish@v1
  with:
    packagesPath: packages
    publish: false
    hackageServer: http://hackage.haskell.org
Uploading hls-module-name-plugin-1.0.0.1 to http://hackage.haskell.org/packages/candidates
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  7777    0     0  100  7777      0  42037 --:--:-- --:--:-- --:--:-- 42037
curl: (22) The requested URL returned error: 401 Unauthorized
Error: Process completed with exit code 22.

I think the deinitive test can be done with the next release

@jneira jneira added the merge me Label to trigger pull request merge label Sep 7, 2021
@pepeiborra

Copy link
Copy Markdown
Collaborator

It would be nice to back port this to the 1.3.0-hackage branch and use it for the Hackage upload

@jneira

jneira commented Sep 8, 2021

Copy link
Copy Markdown
Member Author

I was waiting for the automatic backport, but CI is quite slow lately, will backport manually

jneira added a commit that referenced this pull request Sep 8, 2021
@jneira

jneira commented Sep 8, 2021

Copy link
Copy Markdown
Member Author

@jneira

jneira commented Sep 8, 2021

Copy link
Copy Markdown
Member Author

As the workflow will take ages to start i've started it in my repo: https://github.com/jneira/haskell-language-server/runs/3545669772

@haskell haskell deleted a comment from mergify Bot Sep 9, 2021
@jneira
jneira merged commit adb964c into haskell:master Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge me Label to trigger pull request merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate hackage releases

4 participants