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

ncspot-0.9.5 build failure #714

Closed
0323pin opened this issue Jan 19, 2022 · 9 comments
Closed

ncspot-0.9.5 build failure #714

0323pin opened this issue Jan 19, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@0323pin
Copy link
Contributor

0323pin commented Jan 19, 2022

Hi,

NetBSD package maintainer here. The new release (0.9.5) fails to build on NetBSD-current (9.99.93) using rust-1.57.0 with the following error.


   Compiling ncspot v0.9.5 (/usr/pkgsrc/wip/ncspot/work/ncspot-0.9.5)
error: there is no argument named `content_len`
  --> src/ui/listview.rs:88:34
   |
88 |         log::info!("content len: {content_len}");
   |                                  ^^^^^^^^^^^^^

error: there is no argument named `loaded`
   --> src/ui/listview.rs:100:35
    |
100 |         log::info!("can paginate: {loaded}");
    |                                   ^^^^^^^^

warning: unused import: `InsertSource`
 --> src/commands.rs:6:31
  |
6 |     parse, Command, GotoMode, InsertSource, JumpMode, MoveAmount, MoveMode, SeekDirection,
  |                               ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `error`
 --> src/queue.rs:4:18
  |
4 | use log::{debug, error, info};
  |                  ^^^^^

warning: unused import: `spotify_url::SpotifyUrl`
  --> src/ui/listview.rs:32:31
   |
32 | use crate::{spotify::UriType, spotify_url::SpotifyUrl};
   |                               ^^^^^^^^^^^^^^^^^^^^^^^

warning: `ncspot` (bin "ncspot") generated 3 warnings
error: could not compile `ncspot` due to 2 previous errors; 3 warnings emitted
*** Error code 101

Any possibility to fix this?

@0323pin 0323pin added the bug Something isn't working label Jan 19, 2022
@hrkfdn
Copy link
Owner

hrkfdn commented Jan 19, 2022

Hi there, you need the latest Rust version for this (1.58.0) which supports captured identifiers: https://blog.rust-lang.org/2022/01/13/Rust-1.58.0.html#captured-identifiers-in-format-strings

@0323pin
Copy link
Contributor Author

0323pin commented Jan 19, 2022

@hrkfdn Thank you for the quick reply.
This will have to wait than, we usually keep rust one version behind as it causes trouble with other things. like libresvg.
NetBSD is still on v1.56.1 but, I usually run +1, so I have 1.57.0 on my system.

1.57.0 should hit main this week and I'll move to 1.58.0 but, I can not merge because it will give the users a broken package.
I will add a note that we are keeping 0.9.4 for now.

@0323pin
Copy link
Contributor Author

0323pin commented Jan 19, 2022

Let's close this as there's a logical explanation.

@0323pin 0323pin closed this as completed Jan 19, 2022
@hrkfdn
Copy link
Owner

hrkfdn commented Jan 19, 2022 via email

@0323pin
Copy link
Contributor Author

0323pin commented Jan 19, 2022

That would be fine if you like, else we keep 0.9.4 until we have rust 1.58.0 which would be end of February beginning of March.
I already have a patch to disable all win32 features since there are users that refuse to have ncurses and want to use termion.

But, yeah I can push another patch.

@hrkfdn
Copy link
Owner

hrkfdn commented Jan 19, 2022

@0323pin Here's a diff in case you still want to build it with older Rust versions

diff --git a/src/ui/listview.rs b/src/ui/listview.rs
index 17fead7..e6c72b6 100644
--- a/src/ui/listview.rs
+++ b/src/ui/listview.rs
@@ -85,7 +85,7 @@ impl<I: ListItem> ListView<I> {
 
     pub fn content_height_with_paginator(&self) -> usize {
         let content_len = self.content.read().unwrap().len();
-        log::info!("content len: {content_len}");
+        log::info!("content len: {}", content_len);
 
         // add 1 more row for paginator if we can paginate
         if self.can_paginate() {
@@ -97,7 +97,7 @@ impl<I: ListItem> ListView<I> {
 
     fn can_paginate(&self) -> bool {
         let loaded = self.get_pagination().loaded_content();
-        log::info!("can paginate: {loaded}");
+        log::info!("can paginate: {}", loaded);
         self.get_pagination().max_content().unwrap_or(0) > self.get_pagination().loaded_content()
     }

@0323pin
Copy link
Contributor Author

0323pin commented Jan 19, 2022

@hrkfdn I've just kick-started a build with this. Thanks!

@0323pin
Copy link
Contributor Author

0323pin commented Jan 19, 2022

@hrkfdn Merged, https://mail-index.netbsd.org/pkgsrc-changes/2022/01/19/msg247190.html
Thanks!

You are probably aware of these warnings, they have been there most of the time but, leaving them here anyway,

   Compiling ncspot v0.9.5 (/usr/pkgsrc/wip/ncspot/work/ncspot-0.9.5)
warning: unused import: `InsertSource`
 --> src/commands.rs:6:31
  |
6 |     parse, Command, GotoMode, InsertSource, JumpMode, MoveAmount, MoveMode, SeekDirection,
  |                               ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `error`
 --> src/queue.rs:4:18
  |
4 | use log::{debug, error, info};
  |                  ^^^^^

warning: unused import: `spotify_url::SpotifyUrl`
  --> src/ui/listview.rs:32:31
   |
32 | use crate::{spotify::UriType, spotify_url::SpotifyUrl};
   |                               ^^^^^^^^^^^^^^^^^^^^^^^

warning: unused variable: `url`
   --> src/ui/contextmenu.rs:193:45
    |
193 |                 ContextMenuAction::ShareUrl(url) => {
    |                                             ^^^ help: if this is intentional, prefix it with an underscore: `_url`
    |
    = note: `#[warn(unused_variables)]` on by default
    

warning: unused variable: `url`
   --> src/ui/contextmenu.rs:155:21
    |
155 |         if let Some(url) = item.share_url() {
    |                     ^^^ help: if this is intentional, prefix it with an underscore: `_url`

warning: unused variable: `url`
   --> src/ui/contextmenu.rs:159:21
    |
159 |         if let Some(url) = item.album(queue.clone()).and_then(|a| a.share_url()) {
    |                     ^^^ help: if this is intentional, prefix it with an underscore: `_url`

warning: unused variable: `url`
   --> src/ui/listview.rs:417:29
    |
417 |                 if let Some(url) = url {
    |                             ^^^ help: if this is intentional, prefix it with an underscore: `_url`

warning: associated function is never used: `cover_url`
  --> src/model/playable.rs:36:12
   |
36 |     pub fn cover_url(&self) -> Option<String> {
   |            ^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: variant is never constructed: `ShareUrl`
  --> src/ui/contextmenu.rs:40:5
   |
40 |     ShareUrl(String),
   |     ^^^^^^^^^^^^^^^^

warning: function is never used: `cache_path_for_url`
  --> src/utils.rs:23:8
   |
23 | pub fn cache_path_for_url(url: String) -> std::path::PathBuf {
   |        ^^^^^^^^^^^^^^^^^^

warning: function is never used: `download`
  --> src/utils.rs:29:8
   |
29 | pub fn download(url: String, path: std::path::PathBuf) -> Result<(), std::io::Error> {
   |        ^^^^^^^^

warning: `ncspot` (bin "ncspot") generated 11 warnings
    Finished release [optimized] target(s) in 56m 09s

@hrkfdn
Copy link
Owner

hrkfdn commented Jan 20, 2022

@0323pin Yeah, those are due to deactivated features. They could probably be removed with feature gates, but it'd really hinder readability. In any case they're not problematic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants