feat: issue #319 update release github actions for supporting install via ghcup - #353
Conversation
alt-romes
left a comment
There was a problem hiding this comment.
Thanks for contributing this! It is very worthwhile doing. See my inline comment though.
|
|
||
| - name: Build hdb | ||
| shell: bash | ||
| run: cabal build exe:hdb --enable-executable-stripping |
There was a problem hiding this comment.
I don't expect that this would work, since hdb must be built with a handful of flags like --enable-executable-dynamic?
More broadly, what is the difference between the existing build-haskell-debugger and build-hdb-binary that you added?
It seems the important bit is to make sure the binary artifacts are uploaded (they currently aren't; just built.)
Also: the previous commit doesn't stand very well on its own; Might as well just squash both if you could.
Thanks!
There was a problem hiding this comment.
@alt-romes thanks for your review. I initially verified releases page and couldn't find the built hdb in the release page. Also I didn't find build for different OS/architecture matrix in the build-haskell-debugger job debugger.yaml so I added duplicate one with support for multiple os/architecture.
I think the cleaner approach is update the existing build-haskell-debugger to build for all supported os/arch and upload the artifacts to releases.
I'll do the changes and let you know.
There was a problem hiding this comment.
@alt-romes are you fine with this approach?
There was a problem hiding this comment.
I think the cleaner approach is update the existing build-haskell-debugger to build for all supported os/arch and upload the artifacts to releases.
Yup!
|
After the binaries are uploaded to the Github Release, how does the GHCup support come into play ? |
@alt-romes once the releases contains the binary, we need to update ghcup-metadata similar to agda/dhall/purescript. |
|
I've been swamped with life and other work. What's the status here? |
|
What's the status? |
|
@hasufell Thanks for getting back. I closed the PR by mistake. @alt-romes I've updated the github actions to build for linux/mac x86_64 and arm architectures and include the built binaries in the releases. could you please take a look and let me know if this looks good to you? |
@hasufell I've initially created the pull request adding duplicate github actions and build the hdb executable. I got feedback from @alt-romes and decided to reuse the existing build-haskell-debugger action and upload the extuable to releases page. I just updated the PR for the review comment. appreciate your feedback. |
|
Note: the macOS-13 x64 macOS job takes a LONG time to get picked up. |
I think i used old mac github job runner. I updated the runner to macos-15-intel. |
|
@alt-romes any idea why the tests in macos is failing? |
I think there's a bug with I do not want to go out of my way to fix macOS Intel-specific since it's been discontinued. I think it's fine if we build binaries for it though, since there are certainly still many users. I'm happy to land this now, but there are still two things to address:
Note: if there are issues with the CI bits which are only run on the release pipeline, we'll deal with them afterwards when we do the next release (which we hope to do right after this lands) |
|
Can you describe the architecture of the CI?
|
Please let me know if you have any more questions. |
|
Is an hdb release always associated with a specific GHC version and only one? |
Yes, to use GHC 9.14.1 you need hdb compiled against 9.14.1 lib. and so on and so forth. For the time being, the only released supported version is 9.14.1, but we’ll also support 9.14.2 and 10.0 soon |
|
@hasufell will this setup work well with GHCup? what else should we do to have 3rd party GHCup support? Thanks for your help in advance. |
|
That doesn't quite answer my question. If hdb 1.2.3 only ever supports GHC 9.14.1, then that's a simple situation. If hdb 1.2.4 suddenly supports GHC 9.14.1 and 10.0.0, then it gets much harder. |
|
@hasufell sorry, I wasn't very clear: The hdb executable has to be compiled against the GHC library. If you choose 9.14.1 to compile hdb 1.2.3, you get something like So, But, the source of hdb version 1.2.3 can also be compiled with 9.14.2. If you do so, you get |
|
So, will you potentially compile hdb against multiple GHC versions in a single release? |
Yes (though the next release will only be compiled with 9.14.1 specifically) |
|
Then you essentially need an HLS style CI and you need to account for the different bindist mappings across GHC versions to reach an exhaustive configuration. E.g. GHC 9.12.4 may have the same bindist for debian 10 and 12, but GHC 10.0.0 might be shipped with different ones. That means hdb needs to be built on both debian versions. The other thing is detecting ABI incompatibility when the user mixes toolchains. HLS has a startup script that does that: https://github.com/haskell/haskell-language-server/blob/master/bindist/wrapper.in |
…via ghcup PR #353 Squashed commits: update cabal version to 3.16 chore: issue-319 add github actions to build hdb for linux/mac and release use macos-15-intel runner for mac x86-64 architecture github: extra arch runners only for release.
|
@hasufell thanks for your feedback. I have a question. I searched how the bindist/wrapper.in is used to build hlshere, is see it have GHC_VERSION used in GNUmakefile. May I know why the releases don't have GHC_VERSION? |
|
@rajcspsg btw hdb already checks the runtime version of ghc used matches the one it was compiled with, if that helps. See this function. Looking at HLS, it gets compiled against ~13 or so distros, spanning several versions of debian, fedora, mint, and ubuntu, plus a generic linux. So it seems that there are two remaining issues:
At the moment we support only 9.14.1 though, so (2) is already satisfied. @rajcspsg would it make sense to you for this PR to focus on (1)? i.e. building for more OSes, and introduce a more general solution for (2) in a later PR? It would be a good way to contain the scope, especially because we would like to make a new release soon (issue #366) to take advantage of hie-bios-0.20+ and it would be great to have your work merged so the new version is available on ghcup. |
|
@Saizan @hasufell @alt-romes I created bindist github actions similar to hls(mostly copied). Some of the distributions build are failing - cbits/stack.c: In function 'bco_frame_args_offset':
cbits/stack.c:254:13: error:
error: a label can only be part of a statement and a declaration is not a statement
254 | const void * return_frame_info = frame_entry.return_info;
| ^~~~~
|
254 | const void * return_frame_info = frame_entry.return_info;
| ^
`gcc' failed in phase `C Compiler'. (Exit code: 1)
Error: [Cabal-7125]
Failed to build haskell-debugger-0.13.1.0 (which is required by exe:hdb from haskell-debugger-0.13.1.0).Any idea about this error? |
|
@Saizan @alt-romes @hasufell I fixed the other issues as well. Now all the binary distributions are building fine. |
Saizan
left a comment
There was a problem hiding this comment.
Looks great, thank you for your work, just some small changes I'd like.
After those, can you also squash the commits to only one or maybe a few if they are truly independent?
I don't quite understand the question. The wrapper does not build HLS. It's probably easier to understand the CI in my fork, because HLS upstream has turned their CI into an autogenerated monstrosity:
|
Saizan
left a comment
There was a problem hiding this comment.
Great! Would you mind rebasing to squash all commits into one? Otherwise I can do a squash merge if you prefer.
…via ghcup update cabal version to 3.16 chore: issue-319 add github actions to build hdb for linux/mac and release use macos-15-intel runner for mac x86-64 architecture add support for bindist similar to hls add trace to debug in build.sh add use stable ghc update INSTALL and TOOLS to PKG_INSTALL_CMD and PKG_TOOLS respectively fix deb 11 ghc install issue fix cbits compilation issue fix the ubuntu-2004 build waiting due to interactive tz prompt fixed the inputs.is-release bug always log ghc version on GHC_BIN and GHC_LIBDIR
I squashed the commits into single one. |
@alt-romes @hasufell
I updated the release actions -
Tested the jobs in my main branch here. I tried adding windows support, but seems like there is existing issue so I removed it.
Please review and let me know if you have any feedback.