Skip to content

CI: add automated GitHub prereleases - #8914

Merged
mergify[bot] merged 3 commits into
haskell:masterfrom
ulysses4ever:master
May 21, 2023
Merged

mergify[bot] merged 3 commits into
haskell:masterfrom
ulysses4ever:master

Conversation

@ulysses4ever

@ulysses4ever ulysses4ever commented Apr 21, 2023 •

Copy link
Copy Markdown
Collaborator

As announced on the meeting, this PR adds an automated GitHub prerelease holding the cabal-install binaries in this repository. If you wanna taste what it looks like, you can head out to my fork: the Releases tab has the cabal-head prerelease with three binaries for the three main OSes in the Assets section -- that's what you get with this PR.

I add a note about it in the README but perhaps some more advertisement could be done (not sure how). Prereleases appear only on the Releases tab in GitHub UI, while proper releases are also featured on the index page of the repo. So, it's not very visible...

I'm not sure if ghcup can be used to easily get these. Suggestions are welcome. I don't think ghcup can add much on top of a wget for the direct link (e.g. wget https://github.com/ulysses4ever/cabal/releases/download/cabal-head/cabal-head-Linux-x86_64.tar; well, you need to untar and put it in the right spot, I guess...). Again, if someone is willing to explore it, I can add instructions to the README.

The artifacts that I put in the prerelease are built in the CI as usual, so they're debug builds with assertions enabled. It'd be more work to have actual release-mode binaries, and I didn't feel like it's worth it. Hopefully, after #8821, it's not as hard to use debug binaries. But if we get too much complains about failing assertions, we can consider going the full-blown release mode instead of debug mode.

Should close #8541, I think.


Please include the following checklist in your PR:

@ulysses4ever ulysses4ever added can-workaround There is a (maybe partial) workaround for the issue or missing feature and removed can-workaround There is a (maybe partial) workaround for the issue or missing feature labels Apr 21, 2023

@Mikolaj Mikolaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's see how it goes. We can add ghcup pre-releases as an addition or replacement afterwards, based on the experience with this one.

@ulysses4ever

Copy link
Copy Markdown
Collaborator Author

@Mikolaj thanks! Yes, creating a job for ghcup metadata channel would be even better, but I don’t think it necessarily makes this PR useless. I imagine that there would be people who find GitHub prerelease UX more convenient (Also, ghcup is not always applicable, e.g. it doesn’t work on NixOS).

Also, it’s not exactly trivial to create a ghcup channel from scratch. It’s not hard either, but my hunch is that we may have to wait for a while until this happens…

Comment thread .github/workflows/validate.yml Outdated
fi
tar -cvf cabal-head.tar -C $(dirname "$CABAL_EXEC") $(basename "$CABAL_EXEC")
echo "CABAL_EXEC_TAR=cabal-head.tar" >> $GITHUB_ENV
export CABAL_EXEC_TAR="cabal-head-${{ runner.os }}-x86_64.tar"

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.

Should it be .tar or .tar.gz (or .tar.whatever-else)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That's a good point. I just checked that .gz shrinks the size from 53M to 10M. There's a worry though that Windows users may not have a great support for .gz. (I'm not sure about .tar either). People used to create zips just based on this in my experience. And I don't know anything about Mac. So, I just left whatever was there before (which was a tar)... Maybe if we have tar, gz shouldn't be a big additional hurdle, and I should do it, thanks!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It looks like tarring was added by @jneira who is also our main Windows expert. Javier, do you have any thoughts on gzipping the binary on top of tar?

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.

I thought the file was already gzipped, just with the wrong extension (below we use tar -xf …).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

tar -xf means "eXtract a tar File". In contrast, tar -xzf would mean "eXtract a gZipped tar file`.

Fun fact: last week I learned that you can omit - in tar -xf and alike. How cool is that?!...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

iirc there was not specific reason to not use gzip and windows support is similar between gz.tar and tar (nowadays people uses 7z which supports both)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

thanks! will update the pr

@ffaf1 ffaf1 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.

let’s try this!

@ulysses4ever

ulysses4ever commented May 18, 2023 •

Copy link
Copy Markdown
Collaborator Author

Let's wait a little bit and see if we hear from Javier about gzipping. Thanks a lot for the review!

@ffaf1

ffaf1 commented May 18, 2023 via email

Copy link
Copy Markdown
Collaborator

@mergify mergify Bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label May 21, 2023
@mergify
mergify Bot merged commit bd252d2 into haskell:master May 21, 2023
kylixafonso pushed a commit to kylixafonso/cabal that referenced this pull request May 21, 2023
* CI: add automated GitHub prereleases

* CI: gzip binary artifacts (ffaf1's review)

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

attention: needs-review continuous-integration merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days squash+merge me Tell Mergify Bot to squash-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: mention GitHub CI build artifacts in README

5 participants