Skip to content

Refactor CI build #121

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

Merged
merged 13 commits into from
Aug 19, 2025
Merged

Refactor CI build #121

merged 13 commits into from
Aug 19, 2025

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Aug 13, 2025

This refactors the CI build with the goal of making non-released branches easier to test and to re-use build logic between the test and the release workflow.

Similar to the setup we already have for Android, this moves the build of all binaries into a composite .github/actions/ action. The last step of that action is to upload the binaries it compiled as an asset. For Dart tests and the release, those assets are downloaded instead of compiling the core extension again. A neat side-effect of this is that we're guaranteed to test the libraries in the exact same way as we'll release them. Since the retention time of artifacts has been increased to 14 days, it has become a bit easier to test unreleased branches by updating download URLs in client packages (previously, one would always have to use a local build of the core extension).

I've also changed the linux build to run on x86-64 only, cross-compiling for multiple targets instead of using an aarch64 host. That also adds builds for armv7 and riscv64gc Linux, ensuring we support all Linux targets supported by Dart.
Since someone asked for it, I've also added 32-bit x86 builds for Windows and Linux.
In addition to the x86-64 Linux and aarch64 macOS targets previously used to run Dart tests, we're now running Dart tests on aarch64 ubuntu and both x86-64 and aarch64 Windows too.

@simolus3 simolus3 requested a review from rkistner August 13, 2025 15:37
@rkistner
Copy link
Contributor

rkistner commented Aug 19, 2025

So to summarize:

Windows:

  • x64 (64-bit) - already present, unchanged
  • x86 (32-bit) - added, cross-compiled from windows x64
  • aarch64 (arm64) - added, cross-compiled from windows x64
  • arm32 - no plans

Linux:

  • x64 (64-bit) - already present, unchanged
  • x86 (32-bit) - added, cross-compiled from linux x64 - many distributions are dropping support for this, but good to have for completeness
  • aarch64 (arm64) - already present, changed from native build to cross-compiled from linux x64
  • armv7 (arm32) - added, cross-compiled from linux x64 - some Raspberry Pi and similar boards may still use this
  • riscv64gc - added, cross-compiled from linux x64 - uncommon but might start seeing some newer devices with this

MacOS - dylib:

  • x64 (64-bit) - already present, unchanged apart from macos version (macos-14 -> macos-latest)
  • aarch64 (arm64) - already present, unchanged, cross-compiled from macos x64

Android - all unchanged, cross-compiled from linux x64:

  • aarch64 (arm64) - covers most devices
  • armv7 (arm32) - mostly older devices
  • x86_64 (64-bit) - mostly emulators, chromebooks
  • i686 (32-bit) - mostly older devices, probably very little use in practice, good to have just for completeness

xcframework - unchanged, all (cross-)compiled from macos x64:

  • x86_64-apple-darwin (macos 64-bit)
  • aarch64-apple-darwin (macos arm64)
  • aarch64-apple-ios (iOS arm64)
  • aarch64-apple-ios-sim (iOS simulator for arm64)
  • x86_64-apple-ios (iOS simulator for x64)
  • aarch64-apple-watchos
  • aarch64-apple-watchos-sim
  • x86_64-apple-watchos-sim
  • arm64_32-apple-watchos
  • aarch64-apple-tvos
  • aarch64-apple-tvos-sim
  • x86_64-apple-tvos

@simolus3 Could you please check that this list is correct?

@simolus3
Copy link
Contributor Author

That list is correct for Windows, Linux and Android. Since recently, the xcframework contains additional targets (aarch64-apple-watchos, aarch64-apple-watchos-sim, x86_64-apple-watchos-sim, arm64_32-apple-watchos, aarch64-apple-tvos, aarch64-apple-tvos-sim, x86_64-apple-tvos). It's also worth noting that GH is in the process of upgrading macos-latest to macOS 15, I'm not sure if that will also include a switch to aarch64 being the default. But it shouldn't matter whether we're cross-compiling from x64 or aarch64.

Copy link
Contributor

@rkistner rkistner left a comment

Choose a reason for hiding this comment

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

The new structure looks great, and it looks like this would now support practically every platform a user could want to use.

@simolus3 simolus3 merged commit 9373c07 into main Aug 19, 2025
23 checks passed
@simolus3 simolus3 deleted the ci-build-refactor branch August 19, 2025 08:11
@rkistner
Copy link
Contributor

rkistner commented Aug 19, 2025

Since recently, the xcframework contains additional targets

I see, I updated the list. I got the initial list from the rustup target add, and missed that the actual build script has additional targets. The Rust build chains gets a little confusing between the toolchain & rust-src component, targets added, and targets finally built - not sure if the additional targets are auto-installed, and if we need the initial rustup target add at all?

Edit: Reading up about this, it looks like since we're using -Zbuild-std, the targets are compiled from source, which is why the pre-installation may not be required. But it also doesn't hurt to keep it.

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