Bug 241238 - [NEW PORT] audio/spotify-tui: Spotify for the terminal written in Rust
Summary: [NEW PORT] audio/spotify-tui: Spotify for the terminal written in Rust
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Steve Wills
URL: https://github.com/Rigellute/spotify-tui
Keywords: buildisok, feature
Depends on:
Blocks:
 
Reported: 2019-10-14 08:26 UTC by Lewis Cook
Modified: 2019-12-02 19:33 UTC (History)
1 user (show)

See Also:


Attachments
port diff (37.97 KB, patch)
2019-10-14 08:26 UTC, Lewis Cook
no flags Details | Diff
port diff (38.08 KB, patch)
2019-10-17 12:50 UTC, Lewis Cook
no flags Details | Diff
spotify-tui port diff (42.65 KB, patch)
2019-11-30 14:19 UTC, Lewis Cook
no flags Details | Diff
poudriere build log (237.88 KB, text/plain)
2019-11-30 14:33 UTC, Lewis Cook
no flags Details
spotify-tui port diff (42.62 KB, patch)
2019-12-01 12:45 UTC, Lewis Cook
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lewis Cook 2019-10-14 08:26:32 UTC
Created attachment 208293 [details]
port diff

Simple Spotify client written in rust for the terminal,
using the Spotify API providing a way to find music by
name, play tracks, etc.

QA: Successfully built in poudriere.
Comment 1 Steve Wills freebsd_committer 2019-10-16 20:40:52 UTC
I built and installed this and signed up, did all the setup, but on the step where it prompts me to "Enter the URL you were redirected to:", I enter it, then I get a timeout:

thread 'main' panicked at 'send request failed: Error(Io(Custom { kind: TimedOut, error: "timed out" }), "https://accounts.spotify.com/api/token")', src/libcore/result.rs:1084:5

Any ideas what's going wrong here?
Comment 2 Lewis Cook 2019-10-17 02:44:59 UTC
(In reply to Steve Wills from comment #1)

During the initial submission, everything compiled successfully and worked without issues. I've reason to believe there's been an upstream change to one of it's dependencies that's broken it's behaviour, causing this timeout of sorts.

What leaves me confused is if you try pulling Spotify-tui from cargo: cargo install spotify-tui, I no longer face this timeout, subsequently working as intended.

I've opened this as an issue on the repo: https://github.com/Rigellute/spotify-tui/issues/72 and provided a stacktrace. There seems to be an immediate issue with rspotify: (last function call before it throws the timeout) 

```
10: 0x13ad842 - rspotify::spotify::util::get_token::h33b74d9688b2ca7d
```

Can you try pulling in and running spotify-tui directly from cargo?
Comment 3 Lewis Cook 2019-10-17 02:51:14 UTC
As a side note: originally compiled on v0.5.0, tried again now and no longer works. I've also tried the latest release v0.6.2 and same results.  Downloading from cargo seems to get around this but doesn't fix the remaining issue.
Comment 4 Lewis Cook 2019-10-17 03:39:37 UTC
Could this potentially be a discrepancy between the ports build system and the standalone cargo package manager? What stumps me is that it builds from ports, but timesout on runtime. While on the contrary simply building from cargo, outside of the port, and there is no timeout as aforementioned. Wonder if I'm missing a cargo flag in the Makefile or something along the lines.
Comment 5 Lewis Cook 2019-10-17 12:50:38 UTC
Created attachment 208386 [details]
port diff

* Updated port to version v0.6.2, distinfo metadata and CARGO_CRATES.
* Added optional dependency for spotifyd that can be used in conjunction with spotify-tui for playback.

This does _not_ fix the underlying runtime timeout error. I'm certain it has to do with CARGO_BUILD_ARGS, as discussed previously: there's no timeout error when compiling from `cargo install spotify-tui` but _only_ when compiling the port.

I'm not as familiar with the rust toolchain nor cargo, so open to suggestions in what needs to be done and/or changed. My guess is there's a particular build flag being passed (or lack-of) to cargo that breaks functionality in the do-build stage. Cheers.
Comment 6 Lewis Cook 2019-11-30 14:19:09 UTC
Created attachment 209556 [details]
spotify-tui port diff

* Updated port DISTVERSION to latest (rm 0.10.0) including distinfo and CARGO_CRATES;
* Added python:3.6+,build and xorg to USES (needed to build xcb crate) and similarly USE_XORG for xcb;
* Added BINARY_ALIAS for python (needed during the build script of xcb crate);
* Added PORTDOCS to Makefile for documentation installation;
* Added pkg-message.in to files/ for installation message.

The remaining issue that was aforementioned in this thread has been fixed. You can now successfully authenticate with Spotify without error, and use the application as expected. Port builds in poudriere as normal and passed with portlint.
Comment 7 Lewis Cook 2019-11-30 14:33:33 UTC
Created attachment 209558 [details]
poudriere build log

* Attached poudriere build log for extra information if needed.
Comment 8 Lewis Cook 2019-12-01 12:45:55 UTC
Created attachment 209571 [details]
spotify-tui port diff

* Change Makefile in accordance to `portclippy` (thanks to 0mp@ for shedding light on this);
* Shorten PORTDOC installation to a one-liner.
Comment 9 commit-hook freebsd_committer 2019-12-02 19:30:30 UTC
A commit references this bug:

Author: swills
Date: Mon Dec  2 19:29:50 UTC 2019
New revision: 518866
URL: https://svnweb.freebsd.org/changeset/ports/518866

Log:
  audio/spotify-tui: create port

  Spotify terminal client written in rust. Play
  music directly from your terminal, find new
  artists, search for your favourite music and
  more.

  WWW: https://github.com/Rigellute/spotify-tui

  PR:		241238
  Submitted by:	Lewis Cook <vulcan@wired.sh>

Changes:
  head/audio/Makefile
  head/audio/spotify-tui/
  head/audio/spotify-tui/Makefile
  head/audio/spotify-tui/distinfo
  head/audio/spotify-tui/files/
  head/audio/spotify-tui/files/pkg-message.in
  head/audio/spotify-tui/pkg-descr
Comment 10 Steve Wills freebsd_committer 2019-12-02 19:33:22 UTC
Committed, thanks!