sass / dart-sass

The reference implementation of Sass, written in Dart.
https://sass-lang.com/dart-sass
MIT License
3.87k stars 350 forks source link

Setup arm64 linux/windows runners for AOT releases #2259

Closed ntkme closed 2 months ago

ntkme commented 2 months ago

https://github.blog/2024-06-03-arm64-on-github-actions-powering-faster-more-efficient-build-systems/

Specifically this can address the following:

https://github.com/sass/dart-sass/blob/5ddd7fc723d5be220a38882010469bbd7390a3e7/.github/workflows/build-linux-musl.yml#L23-L28

It allows us to build AOT for linux-arm-musl directly, as QEMU wasn't working. The Ampere CPU used by GitHub hosted runners is compatible with 32-bit arm. We can also build arm64 on arm64 runners instead of QEMU, which can speed up the build.

https://github.com/sass/dart-sass/blob/5ddd7fc723d5be220a38882010469bbd7390a3e7/.github/workflows/build-windows.yml#L21-L22

It allows us to build aot for windows-arm64.

@nex3 These would require setting up two paid runners, one for linux and one for windows. As we did setup a paid macos runner in the past, is this something you can help look into?

nex3 commented 2 months ago

For windows, don't we have to build a script snapshot anyway to avoid code signing issues?

ntkme commented 2 months ago

For windows, don't we have to build a script snapshot anyway to avoid code signing issues?

As long as we're not building self-contained exe, there is no code sign issue. The production release of dart runtime and dartaotruntime should be both be pre-signed. The code sign issue comes from appending snapshot to any kind of runtime exe to create a self-contained file, which invalidates the signature.

Our windows x64 release is currently AOT.

nex3 commented 2 months ago

I believe all you'd need to do to get these runners going is declare them in the actions file—they should pull from the same spending pool as the existing paid runners.

ntkme commented 2 months ago

These arm runners are not public free tier, which need to be created first via https://github.com/organizations/sass/settings/actions/runners, and then it can be specified with the name define during creation.

nex3 commented 2 months ago

All right, I've created runners named linux-arm64 and windows-arm64.