cirospaciari / socketify.py

Bringing Http/Https and WebSockets High Performance servers for PyPy3 and Python3
https://www.socketify.dev
MIT License
1.38k stars 48 forks source link

Create pre-build libraries for windows arm64 and linux arm64 #19

Open cirospaciari opened 1 year ago

cirospaciari commented 1 year ago

Linux on ARM is used a LOT (think in raspberry pi), a docker build or cross compile is an option. Windows on ARM on laptops use maybe grow so adding support is a great thing.

Today we support the most used cases (https://github.com/cirospaciari/socketify.py/issues/12): Windows x64 Linux x64 MacOS ARM and x64

cirospaciari commented 1 year ago

Something like this

 build-linux-arm:
    needs: build-linux
    runs-on: ubuntu-latest
    name: Build on linux-arm64
    steps:
      - uses: uraimo/run-on-arch-action@v2.1.1
        with:
          arch: aarch64
          distro: ubuntu20.04
          install: |
            apt-get update -q -y
            apt-get install -q -y build-essential cmake libz-dev golang libuv1-dev git
          run: |
            git clone --recursive https://github.com/cirospaciari/socketify.py.git
            cd socketify.py/src/socketify/native
            make linux
            cd ../
            git add libsocketify_linux_arm64.so
            git config --global user.email "ciro.spaciari@gmail.com"
            git config --global user.name "Ciro Spaciari"
            git commit -m "[GitHub Actions] Updated linux-arm64 binaries" || true
            git push "https://cirospaciari:${{ secrets.BUILDTOKEN }}@github.com/cirospaciari/socketify.py.git"
zelo commented 7 months ago

Maybe this will help someone in the future.

I've compiled libsocketify on rpi4@aarch64 but it required few changes.

Later in socketify/native.py it tried to load amd64 version so i changed "arm" in platform.processor().lower() to ("arm" in platform.processor().lower() or 'aarch64' in platform.machine().lower()) which solved the problem. platform.processor() returned empty string.