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

ci: Bring back x86_64 Release #217

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

Cubik65536
Copy link
Member

Background

There's no Intel builds for Ungoogled Chromium macOS since https://github.com/ungoogled-software/ungoogled-chromium-macos/releases/tag/131.0.6778.85-1.1. For more information, see (#216). In a nutshell, it is because Google took advantage of the new macOS 15 SDK since Chromium 131, and GitHub is not providing macOS 15 Free Action runners on Intel platform, which prevented our release workflow (that builds x86_64 and arm64 binaries on their native runner respectively) from running properly.

Solution

Back in the early days, arm64 binaries were also built on x86_64 host, which is officially supported and pretty well documented. However, there are nearly no up-to-date enough info to directly build x86_64 binaries on arm hosts.

This pull request contains the workaround of using Rosetta 2 (Apple's x86_64 to arm64 translator) to build the x86_64 binary in essentially an "emulated" x86_64 environment. /usr/bin/arch -x86_64 /bin/bash is used to switch the shell to Rosetta environment, then x86_64 Homebrew is installed to install x86_64 version of dependencies (Python, Ninja, etc.), and Ungoogled Chromium is built with those.

On local environment, "$(/usr/bin/uname -m)" which will be changed based on architecture assigned to script using /usr/bin/arch will be used to decide which platform to build for.

On GitHub Action, both uname and the workflow input is used depending on wether /usr/bin/arch is needed to run a certain script in Rosetta environment and if directly passing the value as a script parameter will be easier and play nicer with the GitHub Action flow.

/usr/bin/arch is probably not needed everywhere where it is right now, but I did put it everywhere where it might needed to be to guarantee this works.

One of the biggest problem of this solution is that it takes more than an entire day to build this on GitHub Action and release, but I don't have a better solution for this now.


TODO:

  • Build x86_64 Binary on local ARM Mac
  • Build x86_64 Binary on GitHub Action (Test Run)
  • Update README with the new build guide

Signed-off-by: Qian Qian "Cubik"‎ [email protected]

Signed-off-by: Qian Qian "Cubik"‎ <[email protected]>
This would also allow us to build x86_64 binaries on arm64 Macs, as, on Mac with Rosetta 2 installed,  `/usr/bin/arch -x86_64 /bin/zsh ./build.sh` will change the environment used to run the script and make uname report x86_64.

Signed-off-by: Qian Qian "Cubik"‎ <[email protected]>
Signed-off-by: Qian Qian "Cubik"‎ <[email protected]>
Signed-off-by: Qian Qian "Cubik"‎ <[email protected]>
…ipt (prepare for x86_64)

Signed-off-by: Qian Qian "Cubik"‎ <[email protected]>
Signed-off-by: Qian Qian "Cubik"‎ <[email protected]>
Signed-off-by: Qian Qian "Cubik"‎ <[email protected]>
Signed-off-by: Qian Qian "Cubik"‎ <[email protected]>
Signed-off-by: Qian Qian "Cubik"‎ <[email protected]>
This should prevent exit code `124` of the `timeout` from failing the build job.

Signed-off-by: Qian Qian "Cubik"‎ <[email protected]>
This prevent timeout from failing the build workflow.

Signed-off-by: Qian Qian "Cubik"‎ <[email protected]>
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.

Bringing back Intel (x86_64) builds for Ungoogled Chromium macOS.
1 participant