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

Merged
merged 18 commits into from
Jan 16, 2025

Conversation

Cubik65536
Copy link
Member

@Cubik65536 Cubik65536 commented Jan 3, 2025

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]>
@Cubik65536 Cubik65536 marked this pull request as ready for review January 8, 2025 01:15
@Cubik65536
Copy link
Member Author

/cc @PF4Public @networkException I want this to be sorted out before I update the version again...

@Cubik65536
Copy link
Member Author

Any updates on the content of this PR? /cc @networkException @PF4Public @ungoogled-software/macos

Copy link
Member

@networkException networkException left a comment

Choose a reason for hiding this comment

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

Sorry for the delays, work is not leaving me with much free time lately

Maybe we should look into loosening the approval requirements going forward

@Cubik65536 Cubik65536 merged commit 9c992b0 into ungoogled-software:master Jan 16, 2025
@Cubik65536 Cubik65536 deleted the feat/intel-build branch January 16, 2025 19:22
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.
2 participants