xpack-dev-tools / openocd-xpack

A binary distribution of OpenOCD
https://xpack-dev-tools.github.io/openocd-xpack/
MIT License
333 stars 57 forks source link

Switch Mac build to use Github-hosted runner #18

Closed maxgerhardt closed 2 years ago

maxgerhardt commented 2 years ago

Description

The builder actions contained in this repository currently all rely on self-hosted runners. Specifically, the MacOS action declares

https://github.com/xpack-dev-tools/openocd-xpack/blob/461b1278437d5a1ad99481e87ccaa7b5e6e535b8/.github/workflows/build.yml#L128-L131

However, GitHub provides, even in their free account model, access to Github-hosted runners, which include MacOS.

With the Linux build described in the above file, it suffices to replace runs-on: [self-hosted, Linux, X64] with runs-on: [ubuntu-latest] to get a successful build of OpenOCD (refer here and here). This demonstrates that it's not necessary to go through the hassle of a self-hosted runner to get the basic Linux + Windows builds.

When doing the same for MacOS however (using macos-latest), the build aborts pretty early with the error message (source)

Script "scripts/helper/build.sh" started at Tue Dec 28 12:52:33 UTC 2021.

Please install the macOS XBB and rerun. https://github.com/xpack/xpack-build-box/tree/master/macos Error: Process completed with exit code 1.

The build.yml and related file should be updated, or alternatives for it should be provided, which use the Github-hosted runner for MacOS, along with the necessary preperation of the runner in the form of installing XBB for MacOS, to obtain an automated build for MacOS with no self-owned hardware.

Steps to Reproduce

  1. Fork this repository
  2. Exchange MacOS Github Action in build.yml as shown in diff
  3. Trigger workflow run (e.g., in branch xpack-develop and version 0.11.0-3)
  4. Observe Github Action output

Expected behaviour: Build goes through.

Actual behaviour: Error during build (Please install the macOS XBB and rerun.) since Github Action file does not setup XBB.

Versions

ilg-ul commented 2 years ago

Hi Maximilian,

You are perfectly right, the production builds use self hosted runners. I though that the reason is clearly explained by the error message you mentioned, which is that the build requires the macOS XBB.

As of now, the macOS XBB environment is a very large set of folders, which must be build from sources on each macOS release. These build environment is obviously not available on the GitHub hosted runners.

I plan to replace the monolithic XBB with a modular one, based on binary xPacks, installed with xpm for each build, but this will take some time.

Another reason for using a self-hosted runner is that the base system for the Intel macOS binaries is 10.13, which is not available from GitHub.

If you have any suggestion on how to improve the build processes, please let me know.