Skip to content
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

Use Alpine Linux as base image for s390x testing #1564

Merged
merged 4 commits into from
Mar 5, 2025

Conversation

pyrmont
Copy link
Contributor

@pyrmont pyrmont commented Mar 4, 2025

NOTE: The approach proposed in this PR has changed as described here.


The GitHub workflow that Janet runs to check Janet builds on the s390x architecture has started failing intermittently. More information is here.

This PR uses the run-on-arch-action GitHub action by Umberto Raimondi. This is done for 3 reasons:

  1. The action includes a fix that works around the problem.
  2. The action simplifies the workflow's steps.
  3. The action can support caching of the container.

In terms of (3), I have not enabled this because it I think it means you get a bit of an ugly listing in the GitHub project's packages (e.g. see simdjson for what that would look like) but perhaps that's an acceptable trade-off for the speed gain.

@pyrmont
Copy link
Contributor Author

pyrmont commented Mar 4, 2025

I should have demonstrated the code to enable the caching. I believe it's this:

  test-s390x-linux:
    name: Build and test s390x in qemu
    runs-on: ubuntu-latest
    steps:
    - name: Checkout the repository
      uses: actions/checkout@master
    - name: Do Qemu build and test
      uses: uraimo/run-on-arch-action@v3
      with:
        arch: s390x
        distro: ubuntu_latest
+       githubToken: ${{ github.token }}
        dockerRunArgs: |
          --volume ".:/janet"
        install: |
          apt-get -y update
          apt-get -y install git build-essential
        run: |
          cd /janet
          make -j3
          make test

@pyrmont pyrmont changed the title Use new GitHub action for s390x testing Use Alpine Linux as base image for s390x testing Mar 4, 2025
@pyrmont
Copy link
Contributor Author

pyrmont commented Mar 4, 2025

After looking more into this, I think the better solution is:

  1. Replace multiarch/qemu-user-static with tonistiigi/binfmt
  2. Use Alpine Linux for the base image rather than Ubuntu

Apologies for all the back and forth.

@bakpakin
Copy link
Member

bakpakin commented Mar 4, 2025

I think the main issue is that GCC is crashing with s390x. It's not clear if this is a GCC bug or a qemu bug. Either way, not sure if binfmt would actually fix it - doesn't it just use qemu under the hood?

@pyrmont
Copy link
Contributor Author

pyrmont commented Mar 4, 2025

This is a bit above my head so take all of this with a grain of salt but the problem is discussed in more detail in this bug report in the QEMU project repository. This post in that issue seems to suggest the bug will be fixed (or at least reliably worked around) in an upcoming release of QEMU.

Unfortunately, the Docker container being used currently (multiarch/qemu-user-static) hasn’t been updated in two years so it seems unlikely the fix will get picked up soon. This is not true with the proposed container (tonistiigi/binfmt) which seems to be under active development and is used as the basis for Docker’s own docker-setup-qemu GitHub Action.

@bakpakin bakpakin merged commit a456c67 into janet-lang:master Mar 5, 2025
13 checks passed
@pyrmont pyrmont deleted the bugfix.qemu-segfault branch March 5, 2025 21:51
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.

2 participants