tdlib.native icon indicating copy to clipboard operation
tdlib.native copied to clipboard

provide M1 binary

Open batara666 opened this issue 2 years ago • 11 comments

xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install gperf cmake openssl
git clone https://github.com/tdlib/td.git
cd td
rm -rf build
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl/ -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ..
cmake --build . --target install
cd ..
cd ..
ls -l /usr/local

batara666 avatar Jun 05 '22 20:06 batara666

If anyone here is aware of any public CI server supporting M1 Mac (or how to cross-compile the binaries onto M1 Mac from a "normal" one), I'd be happy to integrate that into our builds.

ForNeVeR avatar Jun 06 '22 04:06 ForNeVeR

https://circleci.com/ seems to support M1 but registration didn't work for me

PiN73 avatar May 10 '23 00:05 PiN73

Here is an example of macOS cross-compilation Intel+M1 with GitHub Actions: https://github.com/up9cloud/ios-libtdjson

If anyone need just libtdjson.dylib working for M1, go to Releases, download libtdjson.xcframework.tar.gz, and use file from folder macos-arm64_x86_64

PiN73 avatar May 10 '23 00:05 PiN73

Finally, the runners are available on GitHub: https://github.com/actions/runner-images/issues/8439

Perhaps we can do something about this.

ForNeVeR avatar Oct 02 '23 19:10 ForNeVeR

Finally, the runners are available on GitHub: actions/runner-images#8439

Perhaps we can do something about this.

What you have linked to is the beta version of the large runners. All large runners require payment and information on an upcoming free to use apple silicon runner has not yet been released.

georg-getz avatar Oct 04 '23 11:10 georg-getz

Ugh.

ForNeVeR avatar Oct 04 '23 12:10 ForNeVeR

Just to note, that I have prebuilt TDLib here, prebuilt-tdlib.yml, that crosscompiles the binary to M1 on a x86_64 runner (other differences from tdlib.native are: the dependencies except libc are linked statically, so the resulting library doesn't depend on random shared libraries available in the CI environment, and the Linux library is built on older system in docker to run with old versions of glibc), it is distributed on npm. On macOS, it isn't too difficult to cross-compile from x86_64 to arm64 or vice versa.

Bannerets avatar Oct 04 '23 12:10 Bannerets

While the main concern here is compilation, there's also a secondary concern of testing. And it's impossible to test M1 binaries without M1 agent.

ForNeVeR avatar Oct 04 '23 13:10 ForNeVeR

While the main concern here is compilation, there's also a secondary concern of testing. And it's impossible to test M1 binaries without M1 agent.

I'm facing an urgent issue as well.

Could I give you remote access to my M1 Mac mini?

Would that solve the problem?

nikolaykusch avatar Nov 02 '23 00:11 nikolaykusch

I have M2 hardware myself. That doesn't solve any problems. If you want to help, please open a PR that builds the needed binaries.

ForNeVeR avatar Nov 02 '23 16:11 ForNeVeR

While the main concern here is compilation, there's also a secondary concern of testing. And it's impossible to test M1 binaries without M1 agent.

@ForNeVeR You can try FlyCI's M1 and M2 runners. They are on average 2x faster and 2x cheaper than GitHub's AND we have a free tier for OSS projects (see below).

Install Instructions

  1. Install FlyCI app and
  2. Easily replace one line of code and start using FlyCI runners:
jobs:
 ci:
-    runs-on: macos-latest
+    runs-on: flyci-macos-large-latest-m1
   steps:
   - name: 👀 Checkout repo
     uses: actions/checkout@v4

500 mins/month Free for Public Repos

Since your repo is public, FlyCI offers 500 mins/month of free M1 runner usage with the flyci-macos-large-latest-m1 runner for public projects.

Don't hesitate to contact us in case the free tier doesn't suit your needs or you experience any issues with the runners. Our team is here to support you!

Best Regards, Veselina Radeva Product Manager at FlyCI

radeva avatar Jan 18 '24 12:01 radeva