Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Add M1 support to build #90

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

Stonedestroyer
Copy link
Contributor

@Stonedestroyer Stonedestroyer commented Aug 10, 2022

Depends on #88, thanks @Walkyst for your work there!

This adds M1 as a target compilation from x86_x64 mac runner, in addition min deployment target with the default XCode supplied is 10.12.6, as Lavalink will only run on 10.12, re @aikaterna.

Thanks to @aikaterna and @jack1142 for assisting with this PR.

Some improvements, we could ditch Java 15 and use the built-in Github runner java versions https://github.com/actions/runner-images/blob/main/images/macos/macos-11-Readme.md#java but it's not really needed, unless you want me to do that @natanbc

TODO:

  • Solve the native folder for darwin creating several files

Walkyst and others added 5 commits June 30, 2022 02:32
natives/toolchains.gradle Outdated Show resolved Hide resolved
@Stonedestroyer Stonedestroyer marked this pull request as ready for review August 10, 2022 19:09
@Stonedestroyer
Copy link
Contributor Author

Stonedestroyer commented Aug 11, 2022

This is blocked by the native lib loader not supporting mac m1,

Per tests by @aikaterna loading natives on mac m1 would load the avx2 one, as aarch64 does not contain support for avx2 it will crash.

The issue to my understanding the upstream library cpu_features for native lib detector does not support m1. The support is pending on the upstream library, see natanbc/native-loader#1.

A solution would be to do something smilar to , https://github.com/aikaterna/lavadsp/blob/f6fce3c9d3c630a77061780f2902c551416c5a12/src/main/java/com/github/natanbc/lavadsp/natives/TimescaleNativeLibLoader.java#L35.
This would ensure we do not load avx2 on Mac m1 arm, and would work until cpu_features gets updated or we get a better solution.

The solution above is tested and works.

@natanbc
Copy link
Owner

natanbc commented Aug 21, 2022

Started working on a rewrite of native-loader, which will also support M1 https://github.com/natanbc/native-loader/tree/native-rewrite

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants