Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GithubActions] add an aarch64-apple-darwin build to releases #44

Closed
gllmAR opened this issue Dec 9, 2023 · 8 comments
Closed

[GithubActions] add an aarch64-apple-darwin build to releases #44

gllmAR opened this issue Dec 9, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@gllmAR
Copy link

gllmAR commented Dec 9, 2023

Running chmod +x on lan-mouse-mac binary results in an error due to missing libadwaita-1.0.dylib.

brew install libadwaita didn't resolve the issue.

error log

./lan-mouse-mac ; exit;
dyld[64640]: Library not loaded: /usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib
  Referenced from: <36688367-70BB-368D-A4AE-2B6CCD7E5D4A> /Users/gllm/Downloads/lan-mouse-mac
  Reason: tried: '/usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib' (no such file), '/usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib' (no such file), '/usr/local/lib/libadwaita-1.0.dylib' (no such file), '/usr/lib/libadwaita-1.0.dylib' (no such file, not in dyld cache)
zsh: abort      /Users/gllm/Downloads/lan-mouse-mac

Temporary Solution

when I compiled the source code after installing libadwaita via brew, I was able to run the locally compiled binary successfully.

This leads me to believe that the issue might be specific to the pre-compiled binary.

@feschber
Copy link
Owner

feschber commented Dec 10, 2023

Could you give me the output of

ls /usr/local/lib | grep libadwaita

?

And did you try executing the downloaded lan-mouse-mac after compiling from source?
For me the provided binary works but I can only test on bigsur amd64 at the moment after having compiled everything.

The dependencies I installed are

brew install gtk4
brew install libadwaita

@gllmAR
Copy link
Author

gllmAR commented Dec 11, 2023

the output of ls /usr/local/lib | grep libadwaita result nothing

output of ls /usr/local/lib show some lib but no libadwaita

libe131.1.dylib		libe131.la		libndi_licenses.txt
libe131.a		libndi.4.dylib
libe131.dylib		libndi.dylib

a system wide search with find / -name 'libadwaita*' 2>/dev/null result these finds ( I hidden some since there was a bunch of less meaningfull result)

/System/Volumes/Data/opt/homebrew/include/libadwaita-1
/System/Volumes/Data/opt/homebrew/var/homebrew/linked/libadwaita
/System/Volumes/Data/opt/homebrew/lib/pkgconfig/libadwaita-1.pc
/System/Volumes/Data/opt/homebrew/lib/libadwaita-1.dylib
/System/Volumes/Data/opt/homebrew/lib/libadwaita-1.0.dylib
/System/Volumes/Data/opt/homebrew/opt/libadwaita
/System/Volumes/Data/opt/homebrew/Cellar/libadwaita
/System/Volumes/Data/opt/homebrew/Cellar/libadwaita/1.4.2/.brew/libadwaita.rb
/System/Volumes/Data/opt/homebrew/Cellar/libadwaita/1.4.2/include/libadwaita-1
/System/Volumes/Data/opt/homebrew/Cellar/libadwaita/1.4.2/lib/pkgconfig/libadwaita-1.pc
/System/Volumes/Data/opt/homebrew/Cellar/libadwaita/1.4.2/lib/libadwaita-1.dylib
/System/Volumes/Data/opt/homebrew/Cellar/libadwaita/1.4.2/lib/libadwaita-1.0.dylib
[...]
/opt/homebrew/include/libadwaita-1
/opt/homebrew/var/homebrew/linked/libadwaita
/opt/homebrew/lib/pkgconfig/libadwaita-1.pc
/opt/homebrew/lib/libadwaita-1.dylib
/opt/homebrew/lib/libadwaita-1.0.dylib
/opt/homebrew/opt/libadwaita
/opt/homebrew/Cellar/libadwaita
[...]

And did you try executing the downloaded lan-mouse-mac after compiling from source?

yes i did but it was still not working (same error message)

dyld[93302]: Library not loaded: /usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib
  Referenced from: <36688367-70BB-368D-A4AE-2B6CCD7E5D4A> /Users/gllm/Downloads/lan-mouse-mac
  Reason: tried: '/usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib' (no such file), '/usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib' (no such file), '/usr/local/lib/libadwaita-1.0.dylib' (no such file), '/usr/lib/libadwaita-1.0.dylib' (no such file, not in dyld cache)
zsh: abort      /Users/gllm/Downloads/lan-mouse-mac

as a temporary workaround, I create a symbolic link from the libadwaita to it's expected place

mkdir -p /usr/local/opt/libadwaita/lib
ln -s /opt/homebrew/lib/libadwaita-1.0.dylib /usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib

Running the release get me the following error message indicating that I try to run it on the wrong architecture (m1) which is progress but probably another issue.

dyld[95118]: Library not loaded: /usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib
  Referenced from: <36688367-70BB-368D-A4AE-2B6CCD7E5D4A>  lan-mouse-mac
  Reason: tried: '/usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib' (no such file), '/usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libadwaita-1.0.dylib' (no such file), '/usr/lib/libadwaita-1.0.dylib' (no such file, not in dyld cache), '/opt/homebrew/Cellar/libadwaita/1.4.2/lib/libadwaita-1.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/libadwaita/1.4.2/lib/libadwaita-1.0.dylib' (no such file), '/opt/homebrew/Cellar/libadwaita/1.4.2/lib/libadwaita-1.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libadwaita-1.0.dylib' (no such file), '/usr/lib/libadwaita-1.0.dylib' (no such file, not in dyld cache)
zsh: abort    lan-mouse-mac

@feschber
Copy link
Owner

It seems like on M1 / Apple Silicon the libraries are installed in /opt/homebrew/lib instead of /usr/local/lib (as is the case with intel macs).

The binary uploaded for the releases is compiled for Intel Macs so it would be expected that it does not work. You would need to run it via rosetta (2?) in this case.

I can not personally test this right now but from what I've read it would be something along the lines of

arch -x86_64 lan-mouse-mac

I only briefly got a chance to test on an actual M1 mac and had some rendering issues with libadwaita (only a black box was displayed instead of the actual window). For that reason I did not want to publish a binary for M1 Macs yet.

You mentioned that you got it to work when compiling from source: Did you run into the same issue or did the window get displayed correctly?

If it works on your end, I would update the GitHub-Actions runner to produce a lan-mouse-mac-arm64 for Apple Silicon.

@gllmAR gllmAR changed the title Issue with Missing libadwaita-1.0.dylib on macOS 13.5 for lan-mouse-mac Release 0.4 Issue with Missing libadwaita-1.0.dylib on macOS 13.5 for lan-mouse-mac Release 0.4 [mac-aarch64 specific] Dec 11, 2023
@gllmAR
Copy link
Author

gllmAR commented Dec 11, 2023

running arch -x86_64 lan-mouse-mac seem's to indicate that executable can't bind to arm64 libs installed with brew...

dyld[8526]: Library not loaded: /usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib
  Referenced from: <36688367-70BB-368D-A4AE-2B6CCD7E5D4A> /Users/gllm/Downloads/lan-mouse-mac
  Reason: tried: '/usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib' (no such file), '/usr/local/opt/libadwaita/lib/libadwaita-1.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libadwaita-1.0.dylib' (no such file), '/usr/lib/libadwaita-1.0.dylib' (no such file, not in dyld cache), '/opt/homebrew/Cellar/libadwaita/1.4.2/lib/libadwaita-1.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/libadwaita/1.4.2/lib/libadwaita-1.0.dylib' (no such file), '/opt/homebrew/Cellar/libadwaita/1.4.2/lib/libadwaita-1.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libadwaita-1.0.dylib' (no such file), '/usr/lib/libadwaita-1.0.dylib' (no such file, not in dyld cache)
zsh: abort      arch -x86_64 ~/Downloads/lan-mouse-mac

running software from source result in proper display with no visible artifact on m1 hardware 👍

lan-mouse-m1mac

@feschber
Copy link
Owner

Thats good news! I will update the release to include an Apple Silicon build then.
The issue above might be because of the symlink you created (it seems to be trying to load that library which will of course not work).

In order to install the correct x86_64 libraries you might need to install & run homebrew under rosetta as well.
But I guess there is no reason to do that if the native version works ;)

@feschber
Copy link
Owner

Small update: The m1 hosted runners don't seem to be free of charge yet, so I need to setup a cross-compilation toolchain (still figuring out how to setup pkg-config for that).
Hopefully wont take too long :)

@feschber feschber changed the title Issue with Missing libadwaita-1.0.dylib on macOS 13.5 for lan-mouse-mac Release 0.4 [mac-aarch64 specific] [GithubActions] add an aarch64-apple-darwin build to releases Dec 19, 2023
@feschber feschber added the enhancement New feature or request label Dec 19, 2023
@feschber
Copy link
Owner

closed in #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants