05nelsonm / kmp-tor-binary

Apache License 2.0
5 stars 2 forks source link

Add `linux-arm` binary build #27

Closed 05nelsonm closed 9 months ago

05nelsonm commented 1 year ago

tor-browser-build now has reproducible builds for arm.

./rbm/rbm build tor --target release --target torbrowser-linux-arm

https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/blob/main/rbm.conf#L391

05nelsonm commented 1 year ago

Error when building openssl

Logs ``` Opening log file: Wed Oct 12 10:42:05 2022 Starting build (script: build): 2022-10-12 10:42:09 /var/tmp/dist/gcc/bin ~ ~ Usage: Configure [no- ...] [enable- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags] pick os/compiler from: BS2000-OSD BSD-aarch64 BSD-generic32 BSD-generic64 BSD-ia64 BSD-riscv64 BSD-sparc64 BSD-sparcv8 BSD-x86 BSD-x86-elf BSD-x86_64 Cygwin Cygwin-i386 Cygwin-i486 Cygwin-i586 Cygwin-i686 Cygwin-x86 Cygwin-x86_64 DJGPP MPE/iX-gcc UEFI UWIN VC-CE VC-WIN32 VC-WIN32-ARM VC-WIN32-ONECORE VC-WIN64-ARM VC-WIN64A VC-WIN64A-ONECORE VC-WIN64A-masm VC-WIN64I aix-cc aix-gcc aix64-cc aix64-gcc android-arm android-arm64 android-armeabi android-mips android-mips64 android-x86 android-x86_64 android64 android64-aarch64 android64-mips64 android64-x86_64 bsdi-elf-gcc cc darwin-i386-cc darwin-ppc-cc darwin64-arm64-cc darwin64-ppc-cc darwin64-x86_64-cc gcc haiku-x86 haiku-x86_64 hpux-ia64-cc hpux-ia64-gcc hpux-parisc-cc hpux-parisc-gcc hpux-parisc1_1-cc hpux-parisc1_1-gcc hpux64-ia64-cc hpux64-ia64-gcc hpux64-parisc2-cc hpux64-parisc2-gcc hurd-x86 ios-cross ios-xcrun ios64-cross ios64-xcrun iossimulator-xcrun iphoneos-cross irix-mips3-cc irix-mips3-gcc irix64-mips4-cc irix64-mips4-gcc linux-aarch64 linux-alpha-gcc linux-aout linux-arm64ilp32 linux-armv4 linux-c64xplus linux-elf linux-generic32 linux-generic64 linux-ia64 linux-mips32 linux-mips64 linux-ppc linux-ppc64 linux-ppc64le linux-sparcv8 linux-sparcv9 linux-x32 linux-x86 linux-x86-clang linux-x86_64 linux-x86_64-clang linux32-s390x linux64-mips64 linux64-riscv64 linux64-s390x linux64-sparcv9 mingw mingw64 nextstep nextstep3.3 sco5-cc sco5-gcc solaris-sparcv7-cc solaris-sparcv7-gcc solaris-sparcv8-cc solaris-sparcv8-gcc solaris-sparcv9-cc solaris-sparcv9-gcc solaris-x86-gcc solaris64-sparcv9-cc solaris64-sparcv9-gcc solaris64-x86_64-cc solaris64-x86_64-gcc tru64-alpha-cc tru64-alpha-gcc uClinux-dist uClinux-dist64 unixware-2.0 unixware-2.1 unixware-7 unixware-7-gcc vms-alpha vms-alpha-p32 vms-alpha-p64 vms-ia64 vms-ia64-p32 vms-ia64-p64 vos-gcc vxworks-mips vxworks-ppc405 vxworks-ppc60x vxworks-ppc750 vxworks-ppc750-debug vxworks-ppc860 vxworks-ppcgen vxworks-simlinux NOTE: If in doubt, on Unix-ish systems use './config'. Finishing build (script: build): 2022-10-12 10:42:16 Build time: 0 hours 0 minutes and 7 seconds ```
boklm commented 1 year ago

The main branch of tor-browser-build does not support linux-arm builds yet (although we've started adding the target to rbm.conf).

But there is a branch being worked on, which you can try:

05nelsonm commented 1 year ago

Thanks @boklm !

Will hold off on this issue then until it gets merged into main

05nelsonm commented 1 year ago

Added the blocked label until https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/merge_requests/492 is merged.

craigraw commented 1 year ago

Would this support linux aarch64 platforms?

05nelsonm commented 1 year ago

Would this support linux aarch64 platforms?

AFAIK, it would for linux, yes.

macOS aarch64 is already supported via the kmp-tor-binary-macosarm64 library, and available in the kmp-tor project. The naming is different because Kotlin Multiplatform calls it arm64 which is what I followed when naming the module. You can see HERE though that the tor-browser-build project is in fact building aarch64 for macOS.

05nelsonm commented 1 year ago

Ackhually, I'm seeing armhf in the main branch RBM build script HERE for the linux-arm run.

Will chat up the Matrix channel about this.

05nelsonm commented 1 year ago

@craigraw , if I opened up the PlatformInstaller class such that you could provide your own binary resources, would that be malleable enough for your project(s) such that you can provide Tor binaries for architectures that aren't currently supported by kmp-tor-binary?

craigraw commented 1 year ago

Yes, I think this would work well. The binaries I am currently using to support Linux aarch64 appear to correspond to the ones in kmp-tor-binary, albeit earlier versions of Tor, libcrypto, libevent and libssl. I'd be happy to change the packaging of these binaries to more closely match kmp-tor-binary if that helps. Being able to specify the custom binary as an alternative dependency would be ideal, so it can just be swapped out as the official build becomes available.

05nelsonm commented 1 year ago

Yes, I think this would work well. The binaries I am currently using to support Linux aarch64 appear to correspond to the ones in kmp-tor-binary, albeit earlier versions of Tor, libcrypto, libevent and libssl. I'd be happy to change the packaging of these binaries to more closely match kmp-tor-binary if that helps. Being able to specify the custom binary as an alternative dependency would be ideal, so it can just be swapped out as the official build becomes available.

Will get it done :muscle:

See #62

05nelsonm commented 1 year ago

@craigraw

kmp-tor release 4.7.13-1-1.4.0 now includes the ability to package and load your own binary resources.

Both Java and Kotlin javaFX samples have been updated as an example.

Commits you can reference:

The Java section of kmp-tor-binary README has also been updated with an example.

craigraw commented 1 year ago

Thanks @05nelsonm. I've started working on this, will add a separate issue with a problem I've run into.

05nelsonm commented 9 months ago

Closing this issue. Work for supporting aarch64 for linux-libc and linux-android (Termux and Android runtime) is complete for Jvm/Js and will roll out with kmp-tor 2.0.0.

See https://github.com/05nelsonm/kmp-tor-binary/issues/85#issuecomment-1819747564