mirror of
https://github.com/aome510/spotify-player.git
synced 2026-04-26 01:15:55 +03:00
[GH-ISSUE #64] Release Binaries #953
Labels
No labels
bug
documentation
enhancement
good first issue
help wanted
pull-request
question
third-party
third-party
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-player#953
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @braheezy on GitHub (Jul 24, 2022).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/64
Originally assigned to: @aome510 on GitHub.
The current install for this program (if using Cargo) looks something like:
openssl,alsa-lib,libdbus)spotify_playerusing Cargo~/.cargo/binto$PATHThis process may be long for users that have never used Rust before (20 min? Unacceptable! 😁). I thought I'd look into how things might be improved.
I found out the binary in the Docker image you provide "just works" and doesn't need all the crates installed. The first easy step could be to add that binary as a Release artifact. But...I know 100% statically linked binaries are a thing in languages like Go. Could things be even easier here?
I found this statement online:
And that's confirmed with the binary obtained from the Docker image:
With a few edits to the
Dockerfileandspotify_player/Config.toml, a 100% statically-linked binary is possible:Cool. As a test, I dropped the binary in a vanilla Ubuntu container to see if it would run:
Even cooler!
Summary of changes:
Dockerfile:musllibrary support to build containerrustupto enable building formusltargetsmusllibraries are used during the buildConfig.tomlI don't know anything about Rust or single line of your program but what you made is pretty sweet. Making it dead-simple to install can help more people enjoy it! I'd love to help with these type of Packaging/Release/Distribution challenges.
@aome510 commented on GitHub (Jul 24, 2022):
Thanks @braheezy for an amazing finding.
Adding binaries to release was mentioned a few times, I did look into this briefly before. However, as you already mention, it's not fully statically linked, so things may not work.
Dynamically link the binary provided in the docker image is simpler than dynamically linking the actual application because by default, the binary docker image doesn't include all the features (
streaming,image,media-control, etc). With docker version,libcandopensslcan be worked around to use the static link counterparts. I'm not too sure about the state of other dependencies when enabling all the default features.That said, it's still better to provide any kinds of "just work, easy-to-install" binaries and not require people to install Rust/cargo to install the applications. I'll take a deeper look into how to improve these things. Will keep you updated.
Anyway, really appreciate your effort put into this 🙇.
@braheezy commented on GitHub (Jul 24, 2022):
Ahh. This is my lack of Rust showing. I see the language has all that built-in support for conditionally compiling. That might explain your
--no-default-featuresflag in the Dockerfile(?). I might explore with building all features.Exactly it's all about having multiple choices. I've been taking inspiration from how bat provides targets. I was delighted to find out it was also a Rust project. I got some of the
muslideas from there.@braheezy commented on GitHub (Jul 29, 2022):
I think a 100% static binary is off the table.
A few functions ultimately depend on dynamic linking because of the nature of what the functions do. This post sums it up.
Functions:
The main warning during build:
Any code rewrites to support this are surely not worth it.
@aome510 commented on GitHub (Jul 29, 2022):
Hey @braheezy,
That's sad to hear :<. I planned to play around with
muslafter release v0.9.4. Thanks for the investigation, it did save me time then =).Also, FYI, I added a
CDworkflow that will publish binaries whenever I release new version. You can find the prebuilt binaries in the release page (e.g v0.9.4). Please lmk if those binaries don't work. I only tested briefly on my Ubuntu. Note that you still need to install the dynamic dependencies (openssl, alsa-lib, libdbus, etc).In the meantime, I'll close this issue for now. Feel free to reopen if you encounter any issues.