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

Improve MacOS packaging #186

Closed
ReenigneArcher opened this issue Jun 12, 2022 · 47 comments · Fixed by #2222
Closed

Improve MacOS packaging #186

ReenigneArcher opened this issue Jun 12, 2022 · 47 comments · Fixed by #2222
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed os:macOS OS is macOS

Comments

@ReenigneArcher
Copy link
Member

ReenigneArcher commented Jun 12, 2022

Describe the Bug

The dmg packages are not use-able currently and therefore will not be included in release assets until this is resolved.

Known issues:

  • missing libraries (will update this later with more information)
    • libopus.0.dylib (see below)
  • bundle doesn't point to anything, CPACK_BUNDLE_STARTUP_COMMAND is not set
dyld[1028]: Library not loaded: /usr/local/opt/opus/lib/libopus.0.dylib
  Referenced from: /Users/reenignearcher/Downloads/sunshine-macos/Sunshine/usr/local/Sunshine.app/Contents/MacOS/sunshine-0.13.0
  Reason: tried: '/usr/local/opt/opus/lib/libopus.0.dylib' (no such file), '/usr/local/lib/libopus.0.dylib' (no such file), '/usr/lib/libopus.0.dylib' (no such file)
zsh: abort      ./sunshine

Expected Behavior

No response

Additional Context

We could set CPACK_BUNDLE_STARTUP_COMMAND similar to this project: https://github.com/MegaGlest/megaglest-source/blob/1e4441e0996c2045f29998a3fd9b2b7a6c2ad441/mk/macos/CMakeLists.txt#L43

The command points to this file: https://github.com/MegaGlest/megaglest-source/blob/develop/mk/macos/bundle_resources/MegaGlest.sh

Sunshine Host Operating System and Version

MacOS

Architecture

Sunshine Version

0.14.0

GPU Type

GPU Model

GPU Driver/Mesa Version

Capture Method (Linux Only)

@ReenigneArcher ReenigneArcher added bug Something isn't working help wanted Extra attention is needed pkg:dmg os:macOS OS is macOS labels Jun 12, 2022
@ReenigneArcher
Copy link
Member Author

ReenigneArcher commented Jun 16, 2022

Can create a pkg and/or dmg using macports, but still missing the same libraries. Can also create a multipackage; however resulting pkg is ~400mb, which in my opinion is excessively large.

@Dizzo786
Copy link

Can create a pkg and/or dmg using macports, but still missing the same libraries. Can also create a multipackage; however resulting pkg is ~400mb, which in my opinion is excessively large.

@ReenigneArcher Is it possible to share a link to the 400mb multipackage? I'm on a Monterey 12.5.1 where I cannot install Xcode and MacPorts.

@ReenigneArcher
Copy link
Member Author

Sorry, but I think those builds are expired.

@Dizzo786
Copy link

I can file a bug as well for this. Im getting Error: Port Sunshine not found when I follow the installation instruction for macOS. Im on Monterey 12.5.1, MacPorts 2.7.2 and XCode 13.4.1

@ReenigneArcher
Copy link
Member Author

ReenigneArcher commented Aug 26, 2022

I can file a bug as well for this. Im getting Error: Port Sunshine not found when I follow the installation instruction for macOS. Im on Monterey 12.5.1, MacPorts 2.7.2 and XCode 13.4.1

I found a small typo in the instructions. If you copied and pasted the commands it would have shown an error prior to the error you showed.

I've updated the docs here: https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/installation.html#portfile

Those instructions should work as I just tested them.

If those still don't work, then please share the output of these commands.
cat /opt/local/etc/macports/sources.conf
ls ~/ports/multimedia/sunshine/

@Dizzo786
Copy link

I found a small typo in the instructions. If you copied and pasted the commands it would have shown an error prior to the error you showed.

I've updated the docs here: https://lizardbyte--330.org.readthedocs.build/projects/sunshine/en/330/about/installation.html#portfile

Those instructions should work as I just tested them.

If those still don't work, then please share the output of these commands. cat /opt/local/etc/macports/sources.conf ls ~/ports/multimedia/sunshine/

I was able to make it work and it paired great from mac to mac using Moonlight PC.

Link you shared has a typo. This line file://Users/<username>/ports should be file:////Users/<username>/ports.

Would it be possible to share the script to generate multipackage standalone pkg. I want to run sunshine on a mac where I can't install XCode.

@ReenigneArcher
Copy link
Member Author

Link you shared has a typo.

Looks like we're both wrong... it should be file:///...

https://guide.macports.org/#development.local-repositories.

Would it be possible to share the script to generate multipackage standalone pkg.

I just used macports to create the package. If you already have macports installed and the sunshine port installed, it's quite easy. See here: https://guide.macports.org/#using.binaries.binary-packages

@kid-syre
Copy link

Hi there I'm trying to install Sunshine on a mac running El capitan but I get the Port sunshine not found error every time I try to install.

@ReenigneArcher
Copy link
Member Author

El Capitan is not supported. Upgrade your OS.

@iMonZ
Copy link

iMonZ commented Sep 11, 2023

Any news here?

I get this while starting:

dyld[42802]: Library not loaded: /usr/local/opt/boost/lib/libboost_locale-mt.dylib
Referenced from: /usr/local/bin/sunshine-0.20.0
Reason: tried: '/usr/local/opt/boost/lib/libboost_locale-mt.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/boost/lib/libboost_locale-mt.dylib' (no such file), '/usr/local/opt/boost/lib/libboost_locale-mt.dylib' (no such file), '/usr/local/lib/libboost_locale-mt.dylib' (no such file), '/usr/lib/libboost_locale-mt.dylib' (no such file, not in dyld cache)
fish: Job 1, 'sunshine' terminated by signal SIGABRT (Abort)

@rzwitserloot
Copy link

Mac builds are x64 only right now, which probably means its not usable on ARM macs due to library incompatibility issues.

A manual to get as far as I got:

  • Download dmg from the releases page ( https://github.com/LizardByte/Sunshine/releases/download/v0.20.0/sunshine.dmg ).
  • Command-line browse to /Volumes/Sunshine/usr/bin
  • un ./sunshine-0.20.0 - this won't be allowed. But, now you can go to the security/privacy system settings where sunshine is now listed as something that was blocked. Allow it.
  • Run it again. Can't find libopus. Install it. I decided to just create a softlink from the place it says it looks to where it actually is:
brew install opus
sudo mkdir -p /usr/local/opt/opus/lib
sudo ln -s /opt/homebrew/Cellar/opus/1.4/lib/libopus.0.dylib /usr/local/opt/opus/lib
  • Run it again. This time:
dyld[12498]: Library not loaded: '/usr/local/opt/opus/lib/libopus.0.dylib'
  Referenced from: '/Volumes/Sunshine/usr/bin/sunshine-0.20.0'
  Reason: tried: '/usr/local/opt/opus/lib/libopus.0.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))), '/usr/local/lib/libopus.0.dylib' (no such file), '/usr/lib/libopus.0.dylib' (no such file), '/opt/homebrew/Cellar/opus/1.4/lib/libopus.0.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))), '/usr/local/lib/libopus.0.dylib' (no such file), '/usr/lib/libopus.0.dylib' (no such file)

i.e. the mac is willing to emulate the x64 build, but is not willing to mix architectures.

There is a very promising link in this ticket, by @ReenigneArcher - https://lizardbyte--330.org.readthedocs.build/projects/sunshine/en/330/about/installation.html#portfile - but that link no longer works, unfortunately.

@ReenigneArcher
Copy link
Member Author

Just use the portfile and be done with it.

https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/installation.html#portfile

@vukael39
Copy link

vukael39 commented Oct 3, 2023

Hi @ReenigneArcher, I follow your guide to use macport and portfile. Tried v0.20.0, v0.19.1, and your suggestion build in (#1348 (comment)). That build has no boost180 Macports issue, but still not usable on ARM macs due to library incompatibility issues.

dyld[8266]: Library not loaded: /opt/local/lib/libopus.0.dylib
Referenced from: <0C19FBAA-29B7-3EB4-BDE3-B7446FF26290> /opt/local/bin/sunshine-0.18.3
Reason: tried: '/opt/local/lib/libopus.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/libopus.0.dylib' (no such file), '/opt/local/lib/libopus.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libopus.0.dylib' (no such file), '/usr/lib/libopus.0.dylib' (no such file, not in dyld cache)
[1] 8266 abort sunshine

@ReenigneArcher
Copy link
Member Author

Try nightly portfile

@iMonZ
Copy link

iMonZ commented Oct 3, 2023

Try nightly portfile

Maybe it’s a great idea to switch to Homebrew.
Postfile isn’t up to date anymore and I a pain to use in modern macOS Systems.
Took me nearly an hour to figure out how to install it or set it up.
While Homebrew installation itself works much more user friendly

@vukael39
Copy link

vukael39 commented Oct 3, 2023

Try nightly portfile

Thanks, I'll try that.

Try nightly portfile

Maybe it’s a great idea to switch to Homebrew. Postfile isn’t up to date anymore and I a pain to use in modern macOS Systems. Took me nearly an hour to figure out how to install it or set it up. While Homebrew works out of the box.

Did you use homebrew to solve problem?

Thank u both!

@iMonZ
Copy link

iMonZ commented Oct 3, 2023

Why does Sunshine need Xorg libraries to compile?
Isn't this completely legacy and unnecessary?

@tqoo

This comment was marked as off-topic.

@iMonZ

This comment was marked as outdated.

@ReenigneArcher
Copy link
Member Author

Postfile isn’t up to date anymore

Yes it is... we build it on every single PR and push event, so often multiple times a day.

https://github.com/LizardByte/Sunshine/blob/nightly/packaging/macos/Portfile

That is NOT the portfile to use... that one is used to generate the portfile that we publish.

Links to downloads can be found on the website. https://app.lizardbyte.dev/Sunshine/

@iMonZ
Copy link

iMonZ commented Oct 3, 2023

Postfile isn’t up to date anymore

Yes it is... we build it on every single PR and push event, so often multiple times a day.

https://github.com/LizardByte/Sunshine/blob/nightly/packaging/macos/Portfile

That is NOT the portfile to use... that one is used to generate the portfile that we publish.

Links to downloads can be found on the website. https://app.lizardbyte.dev/Sunshine/

Maybe it's a good idea to replace the release files for macOS from an DMG to a pkg installer
DMG are only for .app files with an GUI which Sunshine isn't

@ReenigneArcher
Copy link
Member Author

A PR would be welcomed as long as it addresses the linking issues. dmg and pkg will have the same linking problems.

#1141

Also, I think pkg and/or dmg will not be compatible with arm architecture. GitHub only gives us access to x86_64 runners so we can't compile on arm.

Setting up Sunshine for cross compilation is probably a completely separate topic.

@vukael39
Copy link

vukael39 commented Oct 3, 2023

Try nightly portfile

Nightly portfile worked and finish installation. Then I run sunshine command to load, another issue appear.

[2023:10:04:04:52:51]: Info: Sunshine version: 0.20.0
[2023:10:04:04:52:51]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2023:10:04:04:52:51]: Info: Trying encoder [videotoolbox]
[2023:10:04:04:52:51]: Info: SDR color coding [Rec. 601]
[2023:10:04:04:52:51]: Info: Color depth: 8-bit
[2023:10:04:04:52:51]: Info: Color range: [JPEG]
[2023:10:04:04:52:52]: Info: [h264_videotoolbox @ 0x132f09d70] This device does not support the AllowOpenGop option. Value ignored.
[1]    79603 segmentation fault  sudo sunshine

Could you give me a link if the issue is already mentioned? Thank you for your support.

@ReenigneArcher
Copy link
Member Author

Another dev just mentioned they have fixed these issues. I'm sure they'll put up a PR soon.

@iMonZ
Copy link

iMonZ commented Oct 3, 2023

Try nightly portfile

Nightly portfile worked and finish installation. Then I run sunshine command to load, another issue appear.

[2023:10:04:04:52:51]: Info: Sunshine version: 0.20.0
[2023:10:04:04:52:51]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2023:10:04:04:52:51]: Info: Trying encoder [videotoolbox]
[2023:10:04:04:52:51]: Info: SDR color coding [Rec. 601]
[2023:10:04:04:52:51]: Info: Color depth: 8-bit
[2023:10:04:04:52:51]: Info: Color range: [JPEG]
[2023:10:04:04:52:52]: Info: [h264_videotoolbox @ 0x132f09d70] This device does not support the AllowOpenGop option. Value ignored.
[1]    79603 segmentation fault  sudo sunshine

Could you give me a link if the issue is already mentioned? Thank you for your support.

h264_videotoolbox doesnt sound right. We need hevc instead of h264 on macOS

@iMonZ
Copy link

iMonZ commented Oct 3, 2023

A PR would be welcomed as long as it addresses the linking issues. dmg and pkg will have the same linking problems.

#1141

Also, I think pkg and/or dmg will not be compatible with arm architecture. GitHub only gives us access to x86_64 runners so we can't compile on arm.

Setting up Sunshine for cross compilation is probably a completely separate topic.

https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/

@ReenigneArcher
Copy link
Member Author

Are you going to pay the bill?

@vukael39
Copy link

vukael39 commented Oct 3, 2023

Another dev just mentioned they have fixed these issues. I'm sure they'll put up a PR soon.

PR is pull request? So I need to wait for new update nightly portfile right? Thank you.

@iMonZ
Copy link

iMonZ commented Oct 3, 2023

Are you going to pay the bill?

So cross compilation is the way we need to go?

@vukael39
Copy link

vukael39 commented Oct 4, 2023

Finally, I can successful running sunshine pretty well. I downloaded v0.19.1 Portfile and edit boost.version to 1.81. Thanks @ReenigneArcher for your support.

@iMonZ
Copy link

iMonZ commented Oct 16, 2023

Has anyone got a working Homebrew formula?

@ReenigneArcher
Copy link
Member Author

@iMonZ compiling yourself is not too difficult, probably your easiest path forward. https://docs.lizardbyte.dev/projects/sunshine/en/latest/building/build.html

@rolfen
Copy link

rolfen commented Dec 27, 2023

Can create a pkg and/or dmg using macports, but still missing the same libraries. Can also create a multipackage; however resulting pkg is ~400mb, which in my opinion is excessively large.

macports downloads about 900 megabytes of "distfiles" (then it fails to build).

So a ~400mb dmg would be an improvement.

@iMonZ compiling yourself is not too difficult, probably your easiest path forward. https://docs.lizardbyte.dev/projects/sunshine/en/latest/building/build.html

Thanks. Broken packages should be removed from distribution and/or installation documentation should be amended.

@ReenigneArcher
Copy link
Member Author

@rolfen We build EVERY pull request in Macports before merging, so I have no idea what everyone's issue with it is.

@Vertux

This comment was marked as off-topic.

@r-glebov

This comment was marked as off-topic.

@ReenigneArcher

This comment was marked as off-topic.

@r-glebov

This comment was marked as off-topic.

@ReenigneArcher

This comment was marked as off-topic.

@r-glebov

This comment was marked as off-topic.

@iMonZ

This comment was marked as off-topic.

@Geczy

This comment was marked as off-topic.

@r-glebov

This comment was marked as off-topic.

@iMonZ

This comment was marked as off-topic.

@ReenigneArcher
Copy link
Member Author

This is not a support thread. Please keep the discussion around the macOS dmg package.

@fredsvanelli

This comment was marked as off-topic.

@LizardByte LizardByte locked as off-topic and limited conversation to collaborators Mar 4, 2024
@ReenigneArcher
Copy link
Member Author

dmg is being dropped as part of #2222 in favor of homebrew

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed os:macOS OS is macOS
Projects
None yet