-
Notifications
You must be signed in to change notification settings - Fork 710
Use GHC CI infrastructure to produce release artifacts. #6616
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
Comments
Anyone interested should get in touch with me. I'm happy to advise. |
Hey @bgamari I'm interested in taking a stab at this! What needs to be done? |
@samuela, great! Essentially, the task is to write a I have put up a quick experiment here. Feel free to use it as a starting point. The remaining work is the following:
The platforms which don't use Docker are a bit tricky; on these platforms (Windows, Darwin, FreeBSD) GHC's I would be happy to set up a chat to discuss any details if this would be helpful. Alternatively, find me in Thanks for volunteering! |
- mkdir -p out
- cabal update
- cabal new-install --install-method=copy --overwrite-policy=always --installdir=$(pwd)/out cabal-install If you want to use new-build and then find the exe, do: - mkdir -p out
- cabal update
- cabal new-build
- cp "$(cabal new-exec --verbose=0 --offline sh -- -c 'command -v cabal')" out/cabal |
Thanks @hasufell! I adopted the |
Thanks for all the info! Since this project is hosted on GitHub whereas GHC is hosted on GitLab, we'll need to do something different than |
@bgamari Oh, I think I may have misunderstood! So your fork lives on gitlab and has a |
@samuela the plan here is to use GHC's GitLab CI to prepare the |
Ok, so in order to start adapting https://gitlab.haskell.org/bgamari/cabal-build-test/-/commit/50b81bcf1208dbd7ea566d0a2e0fa428dbdd4d00 to work with centos, we need a new docker image in ci-images. Here's an attempt: https://gitlab.haskell.org/samuela/ci-images/-/commit/b50c3c8049321d8542e7bc29bb03c4e815765621 but it fails with
So we'll need |
There is armv7 for https://downloads.haskell.org/~ghc/8.2.2/ (debian 8). You could try to bootstrap from there. |
@samuela I would say let's stick with building on Debian 9 on ARMv7 and AArch64. We don't currently build CentOS bindists on these platforms; it's something that ideally we would ideally do but this will take time and most people tend to use Debian-based distributions on these platforms anyways. |
Ok, I've started some work on this branch. Here are the pipeline results. So far armv7-linux-deb9 and aarch64-linux-deb9 seem to be working but x86_64-freebsd failed. |
@samuela nice, a few comments
|
Hmm, this is unfortunate. Ideally we could just update the Docker image? I guess that would require having the downloads up on downloads.haskell.org? For the sake of this issue should we just go ahead and skip freebsd? Or will we need all the platforms in order to switch over?
I'm a little confused where this CI is supposed to live. We've got a bunch of different repos flying around across GitHub and GitLab! I'm happy to put them wherever. I interpreted this comment to mean that they should be added to GHC's GitLab repo, but perhaps I misunderstood? |
@samuela, right, I'm not opposed to updating the Docker image to pull FreeBSD binaries from @hasufell's server for now.
We don't, although it would be nice to do it in one swoop.
No, https://gitlab.haskell.org/bgamari/cabal-build-test is a fork of this repository and builds
The idea is that we add a |
So a lot of magic is happening in GHC's
|
@samuela I think the idea was to start off where @bgamari left in his experimental branch: https://gitlab.haskell.org/bgamari/cabal-build-test/-/blob/build-test/.gitlab-ci.yml The GHC one is certainly overkill. |
Precisely. Very little of the complexity (maybe none?) in the GHC script is needed by Cabal, which is a standard Haskell package. As suggested by @hasufell, starting with my experiment is probably the best way to begin. |
This would be pretty great. |
Ok, I've been working on this branch and specifically
I think the only thing missing now is windows... |
@Mistuke do you have your cabal building scripts somewhere publicly available? |
Also @hvr, could you share the scripts you use. The setup samuela made seems simple enough, but it misses making actual tarball and providing license report + plan.json which IIRC we want to provide along (or inside) the tarballs. |
@phadej my CI runs a version of this
|
I'm not at all familiar with windows, and I also don't have a windows machine to test on. But if anyone else is familiar/can contribute then I think we'd be all done here! Is there anything else we'd be missing at that point? |
I can handle Windows. Thanks @samuela! |
Can we trigger those release builds for the previous 2-3 versions? |
Please hold your horses. In other words do not use these builds for anything yet. Let's make the setup work first and then propagate it. I don't want to see yet another feature left half-way because "it seems to work". |
What's left to do? :) |
All done here.
Out of scope per #6616 (comment).
Unclear whether this is required?
These are all done except for windows.
Done in https://gitlab.haskell.org/samuela/cabal-build-test/-/commit/1964e1c8.
Not sure which of these are hard requirements. Right now, we're not doing any of them AFAIK. |
@phadej so what is blocking further steps? |
I'll take a look. |
I'm having really a bad day, but I say it here anyways. I don't see how we can officially support FreeBSD or ARM as e.g. Windows eats occasionally days of work. In other words, it would be simpler and clearer for us to provide binaries for GHC's Tier 1 platforms only. We could have scripts for say FreeBSD or/and ARM in place, but if those fail, it won't hold release process or change any priorities. EDIT: I'd rather support FreeBSD and ARM than Windows, but if one have to choose (and we seems to be forced to) than Windows wins. |
I'm sorry you're having a bad day, I know what those are like. But I wonder why you think Windows is so much harder. I build cabal nightly in different configuration and have done so for 2 years now with the only time I had to make any changes was when I hit a GHC bug recently. So I wonder if Windows isn't more difficult because of the CI setup, and not Windows itself.
What exactly is the thing that is increasing your maintenance burden. I'd be happy to go over the configuration with you instead of having you stab around in the dark. You know where to find me. |
This CI issue is just a reminder that heterogeneous targets are tricky. There are occasionally issues with Windows, like this CI or segfaulting (https://gitlab.haskell.org/ghc/ghc/issues/17926). We don't have even thought about signing cabal binaries for macOS (which I guess will be required), I hope that whatever GHC will do could help cabal as well there. So adding ARM and/or FreeBSD to the set which one should keep working all the time doesn't feel good now. I do think that they will have less unique issues then mac or win, but I don't want to promise anything. I'm also really worried what the rumored ARM based mac would mean to all of us. |
And to clarify even more. I somehow know Linux, and understand mac. So can reasonably deal with most issues on those. If it weren't you @Mistuke, than Windows story would be a lot worse. You deserve a lot of thanks for helping us. But I have no idea about FreeBSD or OpenBSD, and what issues ARM might bring to the table. It's an unknown territory with no "support network". I guess if someone who would champion these areas (and don't want to change or rewrite all the rest of cabal because of that), then it would be great. |
@phadej FreeBSD support should really be no issue. I can spin up a FreeBSD vm in a few seconds, do tests, build stuff. In fact, the first few ghcup versions were all manually built on FreeBSD with manually built cabals. I haven't experienced major issues. The most problematic OS is macOS and it isn't easy to get your hands on a VM. |
@phadej I'm sorry to hear this is turning out to be so stressful. I understand first-hand that maintaining an OSS project involves a lot of work, much of it thankless. I think we should brainstorm ways to make this all easier to maintain. It sounds to me like there are two questions at play here: (a) How much can/should be put into CI? and (b) What platforms should be supported and at what "support tiers"? In terms of (a), I claim that having a CI should greatly reduce the workload and stress required in publishing a release and maintaining stability across a variety of platforms. Codifying all of this ad hoc logic into CI means that we have a single, reproducible, and version-controlled source-of-truth for the build and release process across all the platforms. This way, eg. @Mistuke could contribute with his unique Windows knowledge, and others could contribute to platforms of their own interest/ability. Now the question (b) of which platforms should be supported seems slightly thornier. One significant advantage of having a CI in place is that then the onus of support for each platform is shifted to committers when submitting PRs, and off of maintainers. Ie, platform-specific issues are caught on each build/test triggered on every PR. The easiest strategy in my mind would be to set up CI with the platforms listed in #6616 (comment), and then if certain platforms prove to be too onerous then a discussion can be had about whether or not to allow failures for those targets in CI. |
Please send an email to I promise to stay out of that discussion. |
To add I'm not completely happy with GitHub actions setup either.
But on the other hand
|
Well ARM support could be accomplished through self-hosted runners, which is actually the same as what the GitLab CI does. We could probably scavenge a Raspberry Pi or two to run those. I personally don't care about FreeBSD, but that can be run in docker on an Ubuntu runner, so it's not out of the question. Should we just forge ahead with GitHub Actions then? The work done here can be migrated to use GitHub Actions? |
The Raspberry Pi folks seem to be moving towards 64 bit builds, which makes armv7 less important in my mind. Of course aarch64 is still very much needed, and many devices will be running armv7 for a while to come. |
I think this is now done? |
@gbaz, I wouldn't say so. https://github.com/haskell/cabal/blob/6a8c3f80173b71436386d9724b64eb67ccb1cf40/.gitlab/ci.sh doesn't use https://github.com/haskell/cabal/blob/6a8c3f80173b71436386d9724b64eb67ccb1cf40/release.py which is however used in https://github.com/haskell/cabal/blob/master/.github/workflows/artifacts.yml So there is two ways to produce artifacts... I'd consider this done when there is only one way to build release artifacts used. |
Does |
Not really, I guess. |
Seriously, what kind of passive-aggressive conversation is that? @hasufell, |
@Mikolaj release.py doesn't do anything special, honestly. It takes some configuration via command line interface Lines 282 to 290 in 6a8c3f8
cabal v2-install as in gitlab setup; https://github.com/haskell/cabal/blob/6a8c3f80173b71436386d9724b64eb67ccb1cf40/.gitlab/ci.sh#L33-l41
one benefit of |
@phadej: but it has some tested and benchmarked options that have been accumulated over time, right? E.g, Line 169 in 6a8c3f8
Or are such recommended options easily available from somewhere else than this script? Or is that the only example of special configuration that |
there is https://github.com/haskell/cabal/blob/master/cabal.project.release, which however should probably be renamed to |
for better or worse
, it would be done |
@Mikolaj there were some pending cuestions like the missing flags you mentioned here: #6616 (comment) I really appreciate @phadej thoughts on ci exposed here, like
And there are other open questions about actual ci, like gitlab artifacts not being tested, but i think they would need new issues (if they do not exists already) |
Let's let it rest. I was booed into closing a ticket about testing the benefit of these options last time I tried, and the partial test results were strange --- I couldn't apply the options to the actual compilation of the cabal executable despite including them in the used cabal.project. So that would require some extra time, which the collective maintainer is not inclined to donate (but we took a similarly large time arguing why the potential measurements can't show anything useful, if completed). Regarding scavenging anything of value from |
The current CI is good for daily development, but GHC CI has wider platform coverage, which would be great for providing binary releases.
Yet, the setup have to be made.
The text was updated successfully, but these errors were encountered: