transmission-remote-gui / transgui

🧲 A feature rich cross platform Transmission BitTorrent client. Faster and has more functionality than the built-in web GUI.
GNU General Public License v2.0
3.2k stars 274 forks source link

M1 macOS build? #1355

Open Willian-Zhang opened 3 years ago

Willian-Zhang commented 3 years ago

Apple m1 lines Macs are out, is there a easy way to build a m1 native app?

Operating system: macOS Big Sur 11.0.1 (20B29)

Willian-Zhang commented 3 years ago

Since there is no building guide provided for macOS, https://github.com/transmission-remote-gui/transgui/pull/1224 and https://wiki.freepascal.org/macOS_Big_Sur_changes_for_developers#ARM64.2FAArch64.2FAppleSilicon_Support might be helpful for reference.

PeterDaveHello commented 3 years ago

@Willian-Zhang I don't think we have resource to work on it yet, we'll need some help to do that.

thebitstick commented 3 years ago

XCode 12 has cross-compiling, so you can build for ARM on an x86 Mac. I'd be happy to test builds with my M1 Mac Mini.

PeterDaveHello commented 3 years ago

@thebitstick Thanks! Contributions are very welcome and needed here!

flying-sausages commented 3 years ago

And my axe! If there are clear enough setup guides I'd be happy to offer my resources, both machine and time wise

shermanikk commented 3 years ago

I've managed to rebuild a couple apps like ffmpeg, mpv, and iina for arm64 before any official builds were released so I'd be more than willing to give this a go and do a little how-to writeup. This and Dropbox are the only x86 apps left that I use on a daily basis.

kellertuer commented 3 years ago

I am completely inexperienced in such things, but if you need another tester and have a dmg or something I can surely also test it on my M1.

shermanikk commented 3 years ago

Yeah I've got an M1 MBA myself, hence the motivation to do these pre-release arm64 builds. I won't be able to really put my head into it until later today but anything I find out will be posted here.

I am completely inexperienced in such things, but if you need another tester and have a dmg or something I can surely also test it on my M1.

zepretender commented 3 years ago

I don't know how to compile a project... But I have a Mac Mini M1 now and I really miss Transmission Remote GUI :) If I can help, I'll do !

kellertuer commented 3 years ago

Well the old Transmission Remote GUI works fine on my M1 with Rosetta; just since it only respects dark mode half, it does not look nice.

zepretender commented 3 years ago

Well the old Transmission Remote GUI works fine on my M1 with Rosetta; just since it only respects dark mode half, it does not look nice.

How do you do ? Here, I can't launch it. It's "PowerPC/32bits", so it can't be launched

kellertuer commented 3 years ago

Are you using 5.18? That is 64 bit I think? Also Homebrew might work https://formulae.brew.sh/cask/transmission-remote-gui

zepretender commented 3 years ago

Are you using 5.18? That is 64 bit I think? Also Homebrew might work https://formulae.brew.sh/cask/transmission-remote-gui

Yes, I've downloaded latest release (5.18). It doesn't launch. When I use iMobie M1 App Checker, it says that this release can't be launch on a M1.

For the homebrew... I'm to newbie to understand how to do :(

valentine commented 3 years ago

@zepretender You might be encountering issues with the app not being signed. Go to your Applications folder, right-click on the app, and select Open. You'll only have to do this once.

shermanikk commented 3 years ago
Screen Shot 2021-01-19 at 6 01 46 AM

Okay, after a bunch of fiddling I have managed to successfully build transgui for aarch64. Hooray!

I even get it to launch, and it respects dark mode! Neat!

Screen Shot 2021-01-19 at 6 33 51 AM

But when I try to connect to a transmission rpc interface I get this error:

Screen Shot 2021-01-19 at 6 35 24 AM

I'm assuming this is because I wasn't supposed to edit line 787 of restranslator.pas which was giving me the compilation error:

transgui/restranslator.pas(787,24) Error: (3284) Operator is not overloaded: "Class Of TReader" and "Boolean"

so I blindly broke the if statement into two and it seemed to be happy with that, but clearly that is is not the correct solution.

begin if Sender is TReader and Assigned(TReader(Sender).Owner) then {if Assigned(TReader(Sender).Owner) then} OwnerName := TReader(Sender).Owner.GetNamePath;

this is literally my first time even looking at pascal code so I'm not quite sure what the issue is really. Assigned() is just supposed to check if there's a pointer for the given object, and return a boolean. I have a feeling this is one of those incredibly unhelpful compiler errors that is actually being caused by something else entirely, but at this point I'm stumped. Any ideas?

shermanikk commented 3 years ago

Oh and I almost forgot, for anyone else who wants to join me in the mudpit, here's what I've had to do to get to this point:

1) Build FPC from latest git source 2) Build Lazarus from trunk 3) Install openssl with homebrew 4) Add to .fpc.cfg: -Fl/opt/homebrew/Cellar/openssl@1.1/1.1.1i/lib 5) Edit transgui/synapse/source/lib/ssl_openssl_lib.pas:

@@ -113,8 +113,8 @@ const
var
{$IFNDEF MSWINDOWS}
{$IFDEF DARWIN}
-    DLLSSLName: string = 'libssl.dylib';
-    DLLUtilName: string = 'libcrypto.dylib';
+    DLLSSLName: string = 'libssl.1.1.dylib';
+    DLLUtilName: string = 'libcrypto.1.1.dylib';
{$ELSE}
{$IFDEF OS2}
{$IFDEF OS2GCC}

6) Edit setup/macosx/create_app_new.sh:


-lazdir="${1:-/Developer/lazarus/}"
+lazdir="${1:-<your laz_trunk dir>}
     if [ -z "${CI-}" ]; then
       ./install_deps.sh
    @@ -24,11 +24,11 @@ fi
     mkdir -p ../../Release/
     sed -i.bak "s/'Version %s'/'Version %s Build $build'#13#10'Compiled by: $fpc_ver, Lazarus v$lazarus_ver'/" ../../about.lfm

    -lazbuild -B ../../transgui.lpi --lazarusdir=/Developer/lazarus/ --compiler=/usr/local/bin/fpc --cpu=x86_64 --widgetset=cocoa
    +lazbuild -B ../../transgui.lpi --lazarusdir=<your laz_trunk dir> --compiler=/usr/local/bin/fpc --cpu=aarch64 --widgetset=cocoa

     # Building Intel version
    -make -j"$(sysctl -n hw.ncpu)" -C ../.. clean CPU_TARGET=x86_64 "$lazdir"
    -make -j"$(sysctl -n hw.ncpu)" -C ../.. CPU_TARGET=x86_64 "$lazdir"
    +make -j"$(sysctl -n hw.ncpu)" -C ../.. clean CPU_TARGET=aarch64 "$lazdir"
    +make -j"$(sysctl -n hw.ncpu)" -C ../.. CPU_TARGET=aarch64 "$lazdir" 
>7) Edit restranslator.pas

```@@ -784,8 +784,9 @@ var
           ResourceName: AnsiString;
           OwnerName: AnsiString;
         begin
        -  if Sender is TReader and Assigned(TReader(Sender).Owner) then
        -    OwnerName := TReader(Sender).Owner.GetNamePath;
        +  if Sender is TReader {and Assigned(TReader(Sender).Owner)} then
        +    if Assigned(TReader(Sender).Owner) then
        +      OwnerName := TReader(Sender).Owner.GetNamePath;

8) cd setup/macosx 9) bash create_appnew.sh 10) ***jeff goldblum voice* Step 10? There is no step 10!_**

shermanikk commented 3 years ago

well what do you know, it works! I figured out the duplicate object member error was totally unrelated to my braindead fix in restranslator.pas, it was actually this same issue popping up again: https://github.com/transmission-remote-gui/transgui/issues/1325 and all I had to do was use the 1329 patch provided there! After fixing that, it seems to work fine! Tested by connected to my debian linux server running transmission-daemon 3.00. It's even proxied through nginx to give it SSL and that's working fine, no issues.

Screen Shot 2021-01-28 at 11 37 07 AM Screen Shot 2021-01-28 at 11 37 48 AM

Tried everything I could think of and it all seems to be working, doesn't crash or anything either. All is well, so someone on the official end of things can basically provide a real build of this with the instructions I've provided here and minimal effort. Screen Shot 2021-01-28 at 11 39 06 AM (ignore all the errored torrents, that is a completely unrelated zfs issue that just happened. fml. )

If anyone else wants to try out this arm64 build I made, feel free, but the usual caveats that I provide zero support for this build, make no promises it won't set your dog on fire, etc. use at your own risk! transgui-macosx-arm64.zip

kellertuer commented 3 years ago

Thanks, this already looks quite great! (looking forward to finally being able to read marked lines in Dark mode). On my machine, sadly, your provided app can not be launched (the application is damaged and not be started is the error message)

shermanikk commented 3 years ago

Thanks, this already looks quite great! (looking forward to finally being able to read marked lines in Dark mode). On my machine, sadly, your provided app can not be launched (the application is damaged and not be started is the error message)

Huh, I definitely signed it with my dev account so anyone should be able to run it. What happens when you try to run "Transmission Remote GUI.app/Contents/MacOS/transgui" directly? Sorry I'm kind of new to this and don't know what I'm doing at all, I'm just a blind man feeling his way in the dark here.

kellertuer commented 3 years ago

No, sorry, I know what an unsigned application looks like and how to start it. I mean the app is broken like in: I can not open the container to access the binary you refer to.

shermanikk commented 3 years ago

No, sorry, I know what an unsigned application looks like and how to start it. I mean the app is broken like in: I can not open the container to access the binary you refer to.

That's bizarre, it definitely had the proper structure when I zipped it, and I tried downloading the zip on another machine and it unzipped fine. Either way I signed the entire .app bundle and re-uploaded the zip, so try downloading it again.

kellertuer commented 3 years ago

I still got a “signed by untrusted developer”, but that's easy and is only the first start, so that works! Nice! Finally a proper dark mode and a native app. Thanks!

shermanikk commented 3 years ago

I still got a “signed by untrusted developer”, but that's easy and is only the first start, so that works! Nice! Finally a proper dark mode and a native app. Thanks!

Awesome, I guess that zip got messed up somehow when I uploaded it or something, weird. Glad it's working for others now, if I did all that work and nobody else could benefit it'd break my poor little nerd heart. Hooray!

frankyw commented 3 years ago

Works perfectly, thanks for working on this @shermanikk!

thebitstick commented 3 years ago

Tested @shermanikk's build and it runs great. Great job!

jeromeof commented 3 years ago

Great work @shermanikk - but I oddly get an error "Unable to load OpenSSL library files: libssl.1.1.dylib and libcrypto.1.1.dylib" after giving the app permissions. It sort of runs still but cannot connect to my Transmission Daemon running over SSL

shermanikk commented 3 years ago

Great work @shermanikk - but I oddly get an error "Unable to load OpenSSL library files: libssl.1.1.dylib and libcrypto.1.1.dylib" after giving the app permissions. It sort of runs still but cannot connect to my Transmission Daemon running over SSL

Oh I guess they didn't get built-in, still new at this. All you need to do is install openssl with homebrew in /opt/homebrew. That's the location I used when building it so I'm assuming it will be looking for them there.

qinyongqiang commented 3 years ago

Great work @shermanikk - but I oddly get an error "Unable to load OpenSSL library files: libssl.1.1.dylib and libcrypto.1.1.dylib" after giving the app permissions. It sort of runs still but cannot connect to my Transmission Daemon running over SSL

Oh I guess they didn't get built-in, still new at this. All you need to do is install openssl with homebrew in /opt/homebrew. That's the location I used when building it so I'm assuming it will be looking for them there.

Thank you for your fantastic work! I also encounter the openssl issue too... I tried to compile the code from scratch but now is blocked while linking transgui... The ld complains about

(9015) Linking ./transgui
ld: warning: building for macOS 10.5 is deprecated
ld: warning: passed two min versions (10.5, 11.0.0) for platform macOS. Using 11.0.0.
ld: library not found for -lc
An error occurred while linking
Error: (9013) Error while linking
Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted

Any ideas? I used the official fpc 3.2.2 for M1 and compiled Lazarus myself. Other configurations are following your instructions.

flying-sausages commented 3 years ago

Oh I guess they didn't get built-in, still new at this. All you need to do is install openssl with homebrew in /opt/homebrew. That's the location I used when building it so I'm assuming it will be looking for them there.

Which version were you using? Mine cannot be found. This is my install of OpenSSL via brew.

~ ❯❯❯ brew info openssl
openssl@1.1: stable 1.1.1k (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/opt/homebrew/Cellar/openssl@1.1/1.1.1k (8,071 files, 18MB)
  Poured from bottle on 2021-03-29 at 19:37:47
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/openssl@1.1.rb
License: OpenSSL
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /opt/homebrew/etc/openssl@1.1/certs

and run
  /opt/homebrew/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS provides LibreSSL.

If you need to have openssl@1.1 first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
  export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.1/lib/pkgconfig"

==> Analytics
install: 748,044 (30 days), 2,616,398 (90 days), 8,792,644 (365 days)
install-on-request: 55,366 (30 days), 240,031 (90 days), 1,126,038 (365 days)
build-error: 0 (30 days)
qinyongqiang commented 3 years ago

Oh I guess they didn't get built-in, still new at this. All you need to do is install openssl with homebrew in /opt/homebrew. That's the location I used when building it so I'm assuming it will be looking for them there.

Which version were you using? Mine cannot be found. This is my install of OpenSSL via brew.

~ ❯❯❯ brew info openssl
openssl@1.1: stable 1.1.1k (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/opt/homebrew/Cellar/openssl@1.1/1.1.1k (8,071 files, 18MB)
  Poured from bottle on 2021-03-29 at 19:37:47
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/openssl@1.1.rb
License: OpenSSL
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /opt/homebrew/etc/openssl@1.1/certs

and run
  /opt/homebrew/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS provides LibreSSL.

If you need to have openssl@1.1 first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
  export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.1/lib/pkgconfig"

==> Analytics
install: 748,044 (30 days), 2,616,398 (90 days), 8,792,644 (365 days)
install-on-request: 55,366 (30 days), 240,031 (90 days), 1,126,038 (365 days)
build-error: 0 (30 days)

Seems like same to yours. (except the brew source)

$ brew info openssl
openssl@1.1: stable 1.1.1k (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/opt/homebrew/Cellar/openssl@1.1/1.1.1k (8,071 files, 18MB)
  Poured from bottle on 2021-05-21 at 14:34:05
From: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git/Formula/openssl@1.1.rb
License: OpenSSL
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /opt/homebrew/etc/openssl@1.1/certs

and run
  /opt/homebrew/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS provides LibreSSL.

If you need to have openssl@1.1 first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
  export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.1/lib/pkgconfig"

==> Analytics
install: 748,044 (30 days), 2,616,398 (90 days), 8,792,644 (365 days)
install-on-request: 55,366 (30 days), 240,031 (90 days), 1,126,038 (365 days)
build-error: 0 (30 days)
shermanikk commented 3 years ago

Oh I guess they didn't get built-in, still new at this. All you need to do is install openssl with homebrew in /opt/homebrew. That's the location I used when building it so I'm assuming it will be looking for them there.

Which version were you using? Mine cannot be found. This is my install of OpenSSL via brew.

~ ❯❯❯ brew info openssl
openssl@1.1: stable 1.1.1k (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/opt/homebrew/Cellar/openssl@1.1/1.1.1k (8,071 files, 18MB)
  Poured from bottle on 2021-03-29 at 19:37:47
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/openssl@1.1.rb
License: OpenSSL
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /opt/homebrew/etc/openssl@1.1/certs

and run
  /opt/homebrew/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS provides LibreSSL.

If you need to have openssl@1.1 first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
  export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.1/lib/pkgconfig"

==> Analytics
install: 748,044 (30 days), 2,616,398 (90 days), 8,792,644 (365 days)
install-on-request: 55,366 (30 days), 240,031 (90 days), 1,126,038 (365 days)
build-error: 0 (30 days)

Seems like same to yours. (except the brew source)

$ brew info openssl
openssl@1.1: stable 1.1.1k (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/opt/homebrew/Cellar/openssl@1.1/1.1.1k (8,071 files, 18MB)
  Poured from bottle on 2021-05-21 at 14:34:05
From: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git/Formula/openssl@1.1.rb
License: OpenSSL
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /opt/homebrew/etc/openssl@1.1/certs

and run
  /opt/homebrew/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS provides LibreSSL.

If you need to have openssl@1.1 first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
  export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.1/lib/pkgconfig"

==> Analytics
install: 748,044 (30 days), 2,616,398 (90 days), 8,792,644 (365 days)
install-on-request: 55,366 (30 days), 240,031 (90 days), 1,126,038 (365 days)
build-error: 0 (30 days)

I'm totally new to pascal as well so if anyone can help me with this too, I'd be super grateful. You'll notice in my original comment I did something stupid: I pointed directly to version 1.1.1i of the openssl libs in my .fpc.cfg file. So when homebrew updated openssl, this obviously broke. What I don't understand is I have tried every fucking way possible of recompiling starting from SCRATCH with not even fpc installed and no matter what every version of transgui I manage to build always looks for openssl in that directory. It's like my .fpc.cfg file means nothing anymore.

As a temporary workaround making a symlink of the current version to 1.1.1i in /opt/homebrew/Cellar/openssl@1.1/ does work for me, so try that. It's not fixing the core issue though which I am totally stumped by.

shermanikk commented 3 years ago

Okay, figured out something at least. I can include the dylibs with the .app directory so you don't even have to have homebrew install OpenSSL! All I needed to do was copy libcrypto.1.1.dylib and libssl.1.1.dylib into the Contents/MacOS/ directory inside the .app bundle, then run "install_name_tool -add_rpath @executable_path/. transgui" inside the same directory. I've uploaded this self-contained version, so if someone could try it on their own machine without OpenSSL installed to make sure it works for them that'd be great: https://shermanikk.net/stuff/transgui-macosx-arm64.zip

flying-sausages commented 3 years ago

https://shermanikk.net/stuff/transgui-macosx-arm64.zip

I tried opening through the right-click menu but it wouldn't budge.

image
shermanikk commented 3 years ago

https://shermanikk.net/stuff/transgui-macosx-arm64.zip

I tried opening through the right-click menu but it wouldn't budge.

image

alright now I'm stumped. if I download it through the link here via HTTPS, I get the same error as you. however, if I transfer it from my hosting via FTP using FileZilla to my Desktop folder and unzip it there, it works fine. I also compared md5 hashes between both zip files and they're identical. also, if I transfer via FTP to my Downloads folder, I also get this error. downloading via HTTPS to the Desktop doesn't work as well.

It's got to be some annoying bug with code signing verification, but at the moment I'm at a loss how to fix it.

edit: okay found a bit of a trick, run "sudo xattr -cr Transmission\ Remote\ GUI.app" and that should clear the stupid damaged flag. doing that worked in all the cases I tried. still don't know what's triggering it in the first place, but I'm just a blind man feeling in the dark here.

YaxinCheng commented 2 years ago

Hey @shermanikk , sorry for bothering you. As someone already opened a ticket #1378 about incomplete characters, it also happened to me. I went through the build process you provided, and it does not seem to be related to character encodings. So I have tried both Chinese and Japanese characters, and it appears to have a missing byte for every second character. Do you have any insights about which part might get wrong? Thank you

shermanikk commented 2 years ago

Hey @shermanikk , sorry for bothering you. As someone already opened a ticket #1378 about incomplete characters, it also happened to me. I went through the build process you provided, and it does not seem to be related to character encodings. So I have tried both Chinese and Japanese characters, and it appears to have a missing byte for every second character. Do you have any insights about which part might get wrong? Thank you

It's no problem, but I'm definitely out of my depth here. I've never really done any pascal programming, getting fpc and lazarus set up for transgui was my first exposure to it.

One thing that might be illuminating is to take a look at the actual characters being output, and compare them to the correct values on a binary level. It might be a little vs big-endian issue of some kind since before no matter the OS transmission or transgui was running on, they were all using x86-64 CPUs. That isn't true anymore and there may be some assumptions in the transgui code that aren't true anymore because of that. If there's an arm64 native version of Transmission I'll try connecting to it and see if the encoding is still screwed up.

Anyways, it's definitely an odd issue and if someone with more experience with pascal and the transgui source wants to help it would be greatly appreciated!

tcurdt commented 2 years ago

Thanks for all the great progress here.

While the build from @shermanikk starts up fine, it does still seem to have an openssl issue?

Screenshot 2021-12-03 at 16 22 44

It's also not linked - or is it linked statically?

$ otool -L Transmission\ Remote\ GUI.app/Contents/MacOS/transgui 
Transmission Remote GUI.app/Contents/MacOS/transgui:
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1770.255.0)
    /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
    /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData (compatibility version 1.0.0, current version 1044.3.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2022.20.117)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 54.0.0)
    /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1463.2.1)
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1122.11.0)
    /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 1.0.0)
shermanikk commented 2 years ago

Thanks for all the great progress here.

While the build from @shermanikk starts up fine, it does still seem to have an openssl issue?

Screenshot 2021-12-03 at 16 22 44

It's also not linked - or is it linked statically?

$ otool -L Transmission\ Remote\ GUI.app/Contents/MacOS/transgui 
Transmission Remote GUI.app/Contents/MacOS/transgui:
  /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
  /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
  /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
  /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
  /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1770.255.0)
  /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
  /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData (compatibility version 1.0.0, current version 1044.3.0)
  /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2022.20.117)
  /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 54.0.0)
  /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1463.2.1)
  /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1122.11.0)
  /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 1.0.0)

It's definitely compiled, if you look in the MacOS directory you'll see both libcrypto and libssl. Also if you do an otool -l transgui the last line is

Load command 29 cmd LC_RPATH cmdsize 32 path @executable_path/. (offset 12)

so it's just looking in it's own directory for the ssl libs. checking in activity monitor when it's open confirms that it is using them as well. I haven't seen that error you're getting before, usually the error I get when I mess up the SSL install is it complaining that it can't find the libs. Do you have homebrew installed with openssl@1.1 built?

tcurdt commented 2 years ago

It's definitely compiled, if you look in the MacOS directory you'll see both libcrypto and libssl. Also if you do an otool -l transgui the last line is

Load command 29 cmd LC_RPATH cmdsize 32 path @executable_path/. (offset 12)

so it's just looking in it's own directory for the ssl libs. checking in activity monitor when it's open confirms that it is using them as well.

I can confirm they are included:

$ find /Applications/Transmission\ Remote\ GUI.app 
/Applications/Transmission Remote GUI.app
/Applications/Transmission Remote GUI.app/Contents
/Applications/Transmission Remote GUI.app/Contents/_CodeSignature
/Applications/Transmission Remote GUI.app/Contents/_CodeSignature/CodeResources
/Applications/Transmission Remote GUI.app/Contents/MacOS
/Applications/Transmission Remote GUI.app/Contents/MacOS/libssl.1.1.dylib
/Applications/Transmission Remote GUI.app/Contents/MacOS/transgui
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.ru
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.ro
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.el
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.lv
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.cs
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.it
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.ca
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.be
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.pt_br
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.no
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.zh_tw
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.da
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.sv
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.pl
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.template
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.tr
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.es
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.fr
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.fi
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.en
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.lt
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.ko
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.de
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.hr
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.nl
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.hu
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.zh
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.uk
/Applications/Transmission Remote GUI.app/Contents/MacOS/lang/transgui.pt
/Applications/Transmission Remote GUI.app/Contents/MacOS/libcrypto.1.1.dylib
/Applications/Transmission Remote GUI.app/Contents/Resources
/Applications/Transmission Remote GUI.app/Contents/Resources/transgui.icns
/Applications/Transmission Remote GUI.app/Contents/Info.plist
/Applications/Transmission Remote GUI.app/Contents/PkgInfo

but why aren't they used then?

I haven't seen that error you're getting before, usually the error I get when I mess up the SSL install is it complaining that it can't find the libs. Do you have homebrew installed with openssl@1.1 built?

I think it was a transitive dep - but it's there

$ brew list | grep openssl
openssl@1.1
tcurdt commented 2 years ago

How do you see loaded libs in the "Activity Monitor"?

shermanikk commented 2 years ago

How do you see loaded libs in the "Activity Monitor"?

Well not loaded libs necessarily, but if you double click a process it will show you any files the program has open. The dylibs are listed there.

tcurdt commented 2 years ago

Ah, ok - I thought I missed something :)

Here are my open files:

cwd
/
txt
/Applications/Transmission Remote GUI.app/Contents/MacOS/transgui
txt
/Library/Preferences/Logging/.plist-cache.FDC81N2f
txt
/usr/lib/dyld
txt
/usr/share/icu/icudt68l.dat
txt
/System/Library/Fonts/SFNS.ttf
txt
/System/Library/Fonts/Helvetica.ttc
txt
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/SystemAppearance.car
txt
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/Aqua.car
txt
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/FauxVibrantLight.car
txt
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/VibrantLight.car
txt
/System/Library/Fonts/Menlo.ttc
txt
/private/var/db/analyticsd/events.whitelist
txt
/usr/lib/libobjc-trampolines.dylib
txt
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/FauxVibrantDark.car
txt
/System/Library/CoreServices/CoreGlyphs.bundle/Contents/Resources/Assets.car
txt
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/DarkAqua.car
txt
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/VibrantDark.car
txt
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/Assets.car
txt
/System/Library/Keyboard Layouts/AppleKeyboardLayouts.bundle/Contents/Resources/AppleKeyboardLayouts-L.dat
txt
/System/Library/Caches/com.apple.IntlDataCache.le.kbdx
txt
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Resources/Extras2.rsrc
txt
/private/var/folders/2j/qlgsy9ys335cdkc03vd8byfr0000gn/C/com.transgui/com.apple.metal/16777235_530/functions.data
txt
/System/Library/Extensions/AGXMetalG13X.bundle/Contents/Resources/ds.g13s
txt
/private/var/folders/2j/qlgsy9ys335cdkc03vd8byfr0000gn/C/com.transgui/com.apple.metal/31001/libraries.data
txt
/private/var/folders/2j/qlgsy9ys335cdkc03vd8byfr0000gn/0/com.apple.LaunchServices.dv/com.apple.LaunchServices-3027-v2.csstore
0
/dev/null
1
/dev/null
2
/dev/null
3
/System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_stdlib.metallib
4
/private/var/folders/2j/qlgsy9ys335cdkc03vd8byfr0000gn/C/com.transgui/com.apple.metal/16777235_530/functions.data
5
/private/var/folders/2j/qlgsy9ys335cdkc03vd8byfr0000gn/C/com.transgui/com.apple.metal/16777235_530/functions.list
6
/System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_filters.metallib
7
/System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_stdlib_stitchable.metallib
8
/System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_filters_stitchable.metallib
9
/Users/tcurdt/Library/Saved Application State/com.transgui.savedState/data.data
10
/private/var/folders/2j/qlgsy9ys335cdkc03vd8byfr0000gn/C/com.transgui/com.apple.metal/31001/libraries.data
11
/private/var/folders/2j/qlgsy9ys335cdkc03vd8byfr0000gn/C/com.transgui/com.apple.metal/31001/libraries.list
12
/Users/tcurdt/Library/Saved Application State/com.transgui.savedState/windows.plist
13
/Users/tcurdt/Library/Saved Application State/com.transgui.savedState/window_2.data
shermanikk commented 2 years ago

Have you tried compiling your own build of transgui using the instructions I posted? I know it's a bit of work but that's all I can think of at the moment. Wish I could be of more help but like I've said, I'm hardly a developer and this is my first experience with pascal. Literally everything I know I've posted in this thread.

tcurdt commented 2 years ago

Have you tried compiling your own build of transgui using the instructions I posted? I know it's a bit of work but that's all I can think of at the moment. Wish I could be of more help but like I've said, I'm hardly a developer and this is my first experience with pascal. Literally everything I know I've posted in this thread.

No, I didn't go down that rabbit hole just yet. I have another bot interface that also works OK. So the priority is not that high for me.

I just got the M1 and still so many projects that need fixing :-( I was hoping your build could bridge the time to an official release.

I am still a little puzzled on why your build does not work for me. It kind of looks like it should. At least I am not seeing an obvious problem.

I am wondering if it works for others.

frankyw commented 2 years ago

Works fine for me

tcurdt commented 2 years ago

Works fine for me

You were able to update the maxmind db, @frankyw? I didn't test anything else yet.

shermanikk commented 2 years ago

Have you tried compiling your own build of transgui using the instructions I posted? I know it's a bit of work but that's all I can think of at the moment. Wish I could be of more help but like I've said, I'm hardly a developer and this is my first experience with pascal. Literally everything I know I've posted in this thread.

No, I didn't go down that rabbit hole just yet. I have another bot interface that also works OK. So the priority is not that high for me.

I just got the M1 and still so many projects that need fixing :-( I was hoping your build could bridge the time to an official release.

I am still a little puzzled on why your build does not work for me. It kind of looks like it should. At least I am not seeing an obvious problem.

I am wondering if it works for others.

One thing that will make it easier to build it yourself is that you no longer need to compile FPC for aarch64 yourself, you can simply download the prebuilt version from here. I tried building transgui with it and was successful, including loading the openssl libs from homebrew.

You can try that build (using FPC 3.2.2 and Lazarus 2.3.0 trunk) I made here: transgui-macosx-arm64.zip

(Edited link to the newest build that fixes the incorrect Chinese characters issue)

ijaureguialzo commented 2 years ago

I've just tested transgui-macosx-arm64.v2.zipand it works fine for me on M1, even the GeoIP download which the previous one didn't.

ohld commented 2 years ago

I found this link to macos builds of Transmission. Downloaded the latest release and it works fine! MacBook Pro 14' M1.

https://build.transmissionbt.com/job/trunk-mac/

ijaureguialzo commented 2 years ago

I found this link to macos builds of Transmission. Downloaded the latest release and it works fine! MacBook Pro 14' M1.

https://build.transmissionbt.com/job/trunk-mac/

That's another program, not the one we are discussing here...