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

MacOS - Compilation fails when using MacPorts for v0.23.1 on Mac M1 Pro #2482

Closed
3 tasks done
usman-irale opened this issue Apr 29, 2024 · 15 comments
Closed
3 tasks done
Labels
os:macOS OS is macOS

Comments

@usman-irale
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the nightly release?

  • This issue is present in the nightly release

Describe the Bug

The compilation build process failed on macOS Sonoma 14.3
This is the main.log

Expected Behavior

No response

Additional Context

No response

Host Operating System

macOS

Operating System Version

Sonoma 14.3

Architecture

64 bit

Sunshine commit or version

0.23.1

Package

macOS - Portfile

GPU Type

n/a

GPU Model

Apple M2

GPU Driver/Mesa Version

Apple M2

Capture Method (Linux Only)

No response

Config

n/a - Sunshine never compiles

Apps

No response

Relevant log output

:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[2]: *** [tests/test_sunshine] Error 1
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_Users_usmanirale_ports_multimedia_sunshine/Sunshine/work/build'
:info:build make[1]: *** [tests/CMakeFiles/test_sunshine.dir/all] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_Users_usmanirale_ports_multimedia_sunshine/Sunshine/work/build'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_Users_usmanirale_ports_multimedia_sunshine/Sunshine/work/build'
:info:build Command failed:  cd "/opt/local/var/macports/build/_Users_usmanirale_ports_multimedia_sunshine/Sunshine/work/build" && /usr/bin/make -j10 -w all VERBOSE=ON 
:info:build Exit code: 2
:error:build Failed to build Sunshine: command execution failed
:debug:build Error code: CHILDSTATUS 73900 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec -callback portprogress::target_progress_callback build"
:debug:build     (procedure "portbuild::build_main" line 10)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_Users_usmanirale_ports_multimedia_sunshine/Sunshine/main.log for details.
@ReenigneArcher ReenigneArcher added the os:macOS OS is macOS label Apr 29, 2024
@Hazer
Copy link
Member

Hazer commented May 13, 2024

@usman-receeve from your main.log, it seems macports is trying to install as x86 and not arm, can you try installing like this and report back if anything changes?

sudo arch -arm64 port install sunshine

@ReenigneArcher
Copy link
Member

ReenigneArcher commented May 13, 2024

We also fail on "warning", so this might be what you're facing.

:info:build /opt/local/var/macports/build/_Users_usmanirale_ports_multimedia_sunshine/Sunshine/work/Sunshine-0.23.1/src/platform/macos/av_audio.m:19:124: warning: 'AVCaptureDeviceTypeBuiltInMicrophone' is deprecated: first deprecated in macOS 14.0 [-Wdeprecated-declarations]
:info:build     AVCaptureDeviceDiscoverySession *discoverySession = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInMicrophone,
:info:build                                                                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build                                                                                                                            AVCaptureDeviceTypeMicrophone
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h:575:38: note: 'AVCaptureDeviceTypeBuiltInMicrophone' has been explicitly marked deprecated here
:info:build AVF_EXPORT AVCaptureDeviceType const AVCaptureDeviceTypeBuiltInMicrophone API_DEPRECATED_WITH_REPLACEMENT("AVCaptureDeviceTypeMicrophone", macos(10.15, 14.0), ios(10.0, 17.0), macCatalyst(14.0, 17.0)) API_UNAVAILABLE(tvos, visionos) API_UNAVAILABLE(watchos);
:info:build                                      ^
:info:build /opt/local/var/macports/build/_Users_usmanirale_ports_multimedia_sunshine/Sunshine/work/Sunshine-0.23.1/src/platform/macos/av_audio.m:20:7: warning: 'AVCaptureDeviceTypeExternalUnknown' is deprecated: first deprecated in macOS 14.0 [-Wdeprecated-declarations]
:info:build       AVCaptureDeviceTypeExternalUnknown]
:info:build       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build       AVCaptureDeviceTypeExternal
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h:563:38: note: 'AVCaptureDeviceTypeExternalUnknown' has been explicitly marked deprecated here
:info:build AVF_EXPORT AVCaptureDeviceType const AVCaptureDeviceTypeExternalUnknown API_DEPRECATED_WITH_REPLACEMENT("AVCaptureDeviceTypeExternal", macos(10.15, 14.0)) API_UNAVAILABLE(ios, macCatalyst, tvos, visionos) API_UNAVAILABLE(watchos);
:info:build                                      ^
:info:build [ 43%] Building CXX object CMakeFiles/sunshine.dir/src/platform/macos/display.mm.o
:info:build 2 warnings generated.

You can try changing this line in your portfile:

configure.args -DBUILD_WERROR=ON \

to

configure.args -DBUILD_WERROR=OFF \

I can't determine why you are getting those warnings though, and we don't get it in our CI... we both are using the same version of clang.

@Hazer
Copy link
Member

Hazer commented May 13, 2024

We also fail on "warning", so this might be what you're facing.

Oh. That may help, still weird that's building on Rosetta instead of arm, from what I can tell from our logs our CI is building arm just ok, and there's no specific arch on portfile config. Even if the builds succeed, it shouldn't build for x86_64. Seems like an env issue to me.

I can't determine why you are getting those warnings though, and we don't get it in our CI... we both are using the same version of clang.

@ReenigneArcher We are getting them too, it has to do with macOS 14+ framework, just kinda hidden on the CI, line 7000 or something of the "Install Sunshine" logs, but for some reason, not found in "build logs". I'll open a PR later to tackle those warnings, they are not an issue yet, but will be.

@ReenigneArcher
Copy link
Member

I've seen something similar to the main issue here, I think on discord.

I think that user had migrated their homebrew install from an x86_64 mac to an arm mac, and it was messing with things.

@ArcusMG
Copy link

ArcusMG commented May 31, 2024

I'm having an issue compiling using Homebrew on a M1 MacBook Pro. Should I start a new issue or add it here?

I've included the make file with the relevant error. It's complaining that:
"symbol(s) not found for architecture arm64"

But when I check homebrew config, it says it's using arm architecture.

If I need to start a new issue, I can definitely do that.
02.make.txt

@BarryDeng
Copy link

I'm having an issue compiling using Homebrew on a M1 MacBook Pro. Should I start a new issue or add it here?

I've included the make file with the relevant error. It's complaining that: "symbol(s) not found for architecture arm64"

But when I check homebrew config, it says it's using arm architecture.

If I need to start a new issue, I can definitely do that. 02.make.txt

Same logs as yours. It seems that x86_64 Homebrew had messed up the openssl library search path in my m1 mac.

$ file /usr/local/opt/openssl/lib/libcrypto.dylib
/usr/local/opt/openssl/lib/libcrypto.dylib: Mach-O 64-bit dynamically linked shared library x86_64

I solved the issue by unlinking the x86_64 openssl library, and maybe you can link the library back after the compilation.

$ arch -x86_64 zsh
$ brew unlink openssl

@ArcusMG
Copy link

ArcusMG commented Jun 5, 2024

I'm having an issue compiling using Homebrew on a M1 MacBook Pro. Should I start a new issue or add it here?
I've included the make file with the relevant error. It's complaining that: "symbol(s) not found for architecture arm64"
But when I check homebrew config, it says it's using arm architecture.
If I need to start a new issue, I can definitely do that. 02.make.txt

Same logs as yours. It seems that x86_64 Homebrew had messed up the openssl library search path in my m1 mac.

$ file /usr/local/opt/openssl/lib/libcrypto.dylib
/usr/local/opt/openssl/lib/libcrypto.dylib: Mach-O 64-bit dynamically linked shared library x86_64

I solved the issue by unlinking the x86_64 openssl library, and maybe you can link the library back after the compilation.

$ arch -x86_64 zsh
$ brew unlink openssl

I really appreciate the reply. Sadly, it doesn't look like that worked for me. I guess Homebrew is more messed up on this computer that I realized. This isn't my normal computer, I won't have access to that for a month or so. Guess I'll have to try again later.

@ReenigneArcher
Copy link
Member

ReenigneArcher commented Jun 16, 2024

You shouldn't need to do this when using the brew formula, but this might help.

https://docs.lizardbyte.dev/projects/sunshine/en/latest/building/macos.html#homebrew

I have an idea to solve this though, through cmake.

@ReenigneArcher
Copy link
Member

My fix made everything worse, lol: #2707

🤷‍♂️

@Dreamail
Copy link

same issues on Apple Silicon M1, macOS 14.5 (23F79)

@Hazer
Copy link
Member

Hazer commented Jul 25, 2024

This has mostly to do with Rosetta shenanigans. With that said, I really have no idea for macports, but for brew I want to try something.

I was wondering if finding the path of the brew dependency from inside brew, then forwarding it as an environment var to the compiler, yields better results, or even brew can't find the right one during install. If even brew can't find, I'm afraid it is a Rosetta/brew/ports issue and we can't do much.

@ReenigneArcher so technically speaking, I'm thinking in doing something like I do here:

icu4c_lib_path = Formula["icu4c"].opt_lib.to_s
ENV.append "LDFLAGS", "-L#{icu4c_lib_path}"
ENV["LIBRARY_PATH"] = icu4c_lib_path
ohai "Linking against ICU libraries at: #{icu4c_lib_path}"

And giving this path to the cmake, and maybe use it like you did in #2707, but ONLY with the path brew gave us, instead of having both potential paths there.

find_package(OpenSSL REQUIRED HINTS ${BREW_OPENSSL_PATH})

@ReenigneArcher
Copy link
Member

Sounds good.

@Dreamail
Copy link

In fact, I fix this issue by unlinking the x86 openssl library.

@Pheggas
Copy link

Pheggas commented Sep 13, 2024

Been forwarded here from other issue. Could I ask what is wrong about my particular setup? Pasting logs from make as well.
02 - kópia.txt

@ReenigneArcher
Copy link
Member

Closing in favor of a consolidated issue: #3180

Please add any pertinent information to that issue.

@ReenigneArcher ReenigneArcher closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os:macOS OS is macOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants