Skip to content

feat: issue #319 update release github actions for supporting install via ghcup - #353

Merged
Saizan merged 1 commit into
well-typed:masterfrom
rajcspsg:issue-319
Sep 16, 2026
Merged

Saizan merged 1 commit into
well-typed:masterfrom
rajcspsg:issue-319

Conversation

@rajcspsg

@rajcspsg rajcspsg commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

@alt-romes @hasufell
I updated the release actions -

  • Adds a build-hdb-binary job to release.yaml producing .tar.xz archives for x86_64-linux, aarch64-linux, x86_64-apple-darwin, aarch64-apple-darwin at GHC 9.14.1, attached to the GitHub Release.
  • Updates cabal-version: 3.14 → 3.16 on docs-haskell-debugger (required for GHC 9.14.1's bundled boot Cabal package with Custom-build-type deps like entropy).

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.

@rajcspsg rajcspsg changed the title feat: issue-319 update release github actions for supporting install … feat: issue-319 update release github actions for supporting install via ghcup Aug 9, 2026
@rajcspsg rajcspsg mentioned this pull request Aug 11, 2026

@alt-romes alt-romes 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.

Thanks for contributing this! It is very worthwhile doing. See my inline comment though.

Comment thread .github/workflows/release.yaml Outdated

- name: Build hdb
shell: bash
run: cabal build exe:hdb --enable-executable-stripping

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 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!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@alt-romes are you fine with this approach?

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 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!

@alt-romes

Copy link
Copy Markdown
Collaborator

After the binaries are uploaded to the Github Release, how does the GHCup support come into play ?

@rajcspsg

Copy link
Copy Markdown
Contributor Author

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.

@hasufell

hasufell commented Sep 1, 2026

Copy link
Copy Markdown

I've been swamped with life and other work. What's the status here?

@rajcspsg rajcspsg reopened this Sep 1, 2026
@hasufell

hasufell commented Sep 1, 2026

Copy link
Copy Markdown

What's the status?

@rajcspsg

rajcspsg commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@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?

@rajcspsg

rajcspsg commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

What's the status?

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

@alt-romes

alt-romes commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Looks good now. Could you squash the commits please and mention in the commit message this enables the GHCup distribution? Also add to the message "Closes #319"

@hasufell if you're available, could you take a quick look too?

Comment thread .github/workflows/debugger.yaml Outdated
@alt-romes

Copy link
Copy Markdown
Collaborator

Note: the macOS-13 x64 macOS job takes a LONG time to get picked up.

@rajcspsg

rajcspsg commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

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.

Comment thread .github/workflows/debugger.yaml Outdated
@rajcspsg

rajcspsg commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@alt-romes any idea why the tests in macos is failing?

@alt-romes

Copy link
Copy Markdown
Collaborator

@alt-romes any idea why the tests in macos is failing?

I think there's a bug with process spawning on macOS Intel. Re-running solved the CI error. Fortunately, that only seems to be an issue with the non-default option of internal interpreter with runInTerminal proxy. It means if someone runs into this non-transiently, they have a way to work around it (e.g use the default --external-interpreter, or run with the internal interpreter using the cli mode).

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:

  • ubuntu-24.04-arm and macOS-intel jobs should only be run on the release pipeline (inputs.release is true)
  • the commits should all be squashed and the commit message should say "enables GHCup distribution" and "Closes Ship via ghcup #319"

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)

@hasufell

hasufell commented Sep 2, 2026

Copy link
Copy Markdown

Can you describe the architecture of the CI?

  1. What are the platforms for which artifacts will be built?
  2. What are the artifacts precisely?
  3. Are we building for multiple GHC versions?

@rajcspsg

rajcspsg commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Can you describe the architecture of the CI?

  1. What are the platforms for which artifacts will be built?
  2. What are the artifacts precisely?
  3. Are we building for multiple GHC versions?

@hasufell

  1. What are the platforms for which artifacts will be built? x86_64, aarch, mac-arm and mac-intel. Windows build is not working due to existing open issue.
  2. What are the artifacts precisely? the artifacts are hdb binary compressed in tar.gz
  3. Are we building for multiple GHC versions? Right now we are building only for ghc 9.14.1 as thats the only supported version.

Please let me know if you have any more questions.

@hasufell

hasufell commented Sep 3, 2026

Copy link
Copy Markdown

Is an hdb release always associated with a specific GHC version and only one?

@alt-romes

Copy link
Copy Markdown
Collaborator

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

@alt-romes

Copy link
Copy Markdown
Collaborator

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

@Saizan
Saizan self-requested a review September 4, 2026 09:48
@hasufell

hasufell commented Sep 4, 2026

Copy link
Copy Markdown

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.

@alt-romes

Copy link
Copy Markdown
Collaborator

@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 hdb-1.2.3-9.14.1

So, hdb-1.2.3-9.14.1 only ever supports GHC 9.14.1

But, the source of hdb version 1.2.3 can also be compiled with 9.14.2. If you do so, you get hdb-1.2.3-9.14.2.
This is the case because the same features are supported by hdb 1.2.3 regardless of whether you compiled it with 9.14.2 or 9.14.1.

@hasufell

hasufell commented Sep 4, 2026

Copy link
Copy Markdown

So, will you potentially compile hdb against multiple GHC versions in a single release?

@alt-romes

alt-romes commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

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)

@hasufell

hasufell commented Sep 4, 2026

Copy link
Copy Markdown

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

Saizan pushed a commit that referenced this pull request Sep 8, 2026
…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.
@rajcspsg

rajcspsg commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

@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.
I'm looking at hls releases, I see the format doesn't have GHC version(hls supporting multiple GHC) in the release artifacts.

May I know why the releases don't have GHC_VERSION?

@Saizan

Saizan commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

@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.
I guess most of those are done in docker containers?

So it seems that there are two remaining issues:

  1. Extend the list of OS/arch we prepare binary distros for, matching the binary distros of GHC, with a sensible way to include more in the future.
  2. For each OS/arch, include a binary for each version of ghc supported.

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.

@rajcspsg

rajcspsg commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@Saizan Thanks for your suggestion. That makes this merge request more easier.
I'll get the merge request add support for various binary distributions similar to hls here

@rajcspsg

Copy link
Copy Markdown
Contributor Author

@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?

@rajcspsg

rajcspsg commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

@Saizan @alt-romes @hasufell I fixed the other issues as well. Now all the binary distributions are building fine.
Please review and let me know if you have any questions

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

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?

Comment thread README.md
Comment thread .github/workflows/debugger.yaml Outdated
Comment thread bindist/wrapper.in
@hasufell

Copy link
Copy Markdown

@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. I'm looking at hls releases, I see the format doesn't have GHC version(hls supporting multiple GHC) in the release artifacts.

May I know why the releases don't have GHC_VERSION?

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 Saizan 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.

Great! Would you mind rebasing to squash all commits into one? Otherwise I can do a squash merge if you prefer.

@Saizan Saizan changed the title feat: issue-319 update release github actions for supporting install via ghcup feat: issue #319 update release github actions for supporting install via ghcup Sep 15, 2026
…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
@rajcspsg

Copy link
Copy Markdown
Contributor Author

Great! Would you mind rebasing to squash all commits into one? Otherwise I can do a squash merge if you prefer.

I squashed the commits into single one.

@Saizan
Saizan merged commit 8c6e08a into well-typed:master Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants