[GH-ISSUE #1025] No longer compiles (stable, beta and nightly) #454

Open
opened 2026-02-28 14:49:16 +03:00 by kerem · 4 comments
Owner

Originally created by @mucinoab on GitHub (Sep 24, 2022).
Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/1025

I think is due the the changes in the memory layout of SocketAddrV4 ( Rust-1.64, compatibility-notes).

Updating some of our dependencies should fix it.

image

❯ rustc --version --verbose

rustc 1.64.0 (a55dd71d5 2022-09-19)
binary: rustc
commit-hash: a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52
commit-date: 2022-09-19
host: x86_64-unknown-linux-gnu
release: 1.64.0
LLVM version: 14.0.6

Originally created by @mucinoab on GitHub (Sep 24, 2022). Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/1025 I think is due the the changes in the memory layout of `SocketAddrV4` ( [Rust-1.64, compatibility-notes](https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#compatibility-notes)). Updating some of our dependencies should fix it. ![image](https://user-images.githubusercontent.com/28630268/192110553-61cbfb66-c744-40d0-93d1-414268f03430.png) `❯ rustc --version --verbose` > rustc 1.64.0 (a55dd71d5 2022-09-19) > binary: rustc > commit-hash: a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52 > commit-date: 2022-09-19 > host: x86_64-unknown-linux-gnu > release: 1.64.0 > LLVM version: 14.0.6
Author
Owner

@siris commented on GitHub (Nov 5, 2022):

I have confirmed this is also impacting spotify-tui compilations with Rust 1.65.0 (as expected) that was just released:

cargo build
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
   --> /home/ss/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.12/src/sockaddr.rs:176:9
    |
176 |         mem::transmute::<SocketAddrV4, sockaddr_in>(v4);
    |
    |
    = note: source type: `SocketAddrV4` (48 bits)
    = note: target type: `sockaddr_in` (128 bits)

This fix is quite simple: the socket2 crate just needs to be updated:

cargo update -p socket2
    Updating crates.io index
    Updating socket2 v0.3.12 -> v0.3.19

Once that is done I have confirmed cargo build work fine the latest HEAD commit of spotify-tui:

cargo build
  Downloaded socket2 v0.3.19
  Downloaded 1 crate (33.8 KB) in 0.33s
   Compiling spotify-tui v0.25.0 (/home/ss/Repos/spotify-tui)
    Finished dev [unoptimized + debuginfo] target(s) in 20.26s

To further confirm running a cargo install --path . on the latest HEAD commit also works:

cargo install --path .
 Installing spotify-tui v0.25.0 (/home/ss/Repos/spotify-tui)
  Installing /home/ss/.cargo/bin/spt
   Installed package `spotify-tui v0.25.0 (/home/ss/Repos/spotify-tui)` (executable `spt`)

spt --version
spotify-tui 0.25.0

A quick PR with this Cargo.lock update along with a new patch release should fix this fully for Rust 1.64.0 and beyond.

<!-- gh-comment-id:1304639202 --> @siris commented on GitHub (Nov 5, 2022): I have confirmed this is also impacting spotify-tui compilations with Rust 1.65.0 (as expected) that was just released: ``` cargo build error[E0512]: cannot transmute between types of different sizes, or dependently-sized types --> /home/ss/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.12/src/sockaddr.rs:176:9 | 176 | mem::transmute::<SocketAddrV4, sockaddr_in>(v4); | | = note: source type: `SocketAddrV4` (48 bits) = note: target type: `sockaddr_in` (128 bits) ``` This fix is quite simple: the `socket2` crate just needs to be updated: ``` cargo update -p socket2 Updating crates.io index Updating socket2 v0.3.12 -> v0.3.19 ``` Once that is done I have confirmed `cargo build` work fine the latest HEAD commit of spotify-tui: ``` cargo build Downloaded socket2 v0.3.19 Downloaded 1 crate (33.8 KB) in 0.33s Compiling spotify-tui v0.25.0 (/home/ss/Repos/spotify-tui) Finished dev [unoptimized + debuginfo] target(s) in 20.26s ``` To further confirm running a `cargo install --path .` on the latest HEAD commit also works: ``` cargo install --path . Installing spotify-tui v0.25.0 (/home/ss/Repos/spotify-tui) Installing /home/ss/.cargo/bin/spt Installed package `spotify-tui v0.25.0 (/home/ss/Repos/spotify-tui)` (executable `spt`) spt --version spotify-tui 0.25.0 ``` A quick PR with this `Cargo.lock` update along with a new patch release should fix this fully for Rust 1.64.0 and beyond.
Author
Owner

@siris commented on GitHub (Nov 5, 2022):

@Rigellute this is a pretty critical issue as compilations of spotify-tui are completely broken on Rust 1.64.0 and beyond. This breaks any Linux distro or user trying to compile it as part of package management systems or directly from git.

I have tested and verified the fix above and it looks like an automated Cargo.lock PR #990 already is opened with the required fix.

When possible can that PR be merged and a new patch Crate version be released of spotify-tui (v0.25.1) to resolve this?

<!-- gh-comment-id:1304640247 --> @siris commented on GitHub (Nov 5, 2022): @Rigellute this is a pretty critical issue as compilations of spotify-tui are completely broken on Rust 1.64.0 and beyond. This breaks any Linux distro or user trying to compile it as part of package management systems or directly from git. I have tested and verified the fix above and it looks like an automated Cargo.lock PR #990 already is opened with the required fix. When possible can that PR be merged and a new patch Crate version be released of spotify-tui (v0.25.1) to resolve this?
Author
Owner

@siris commented on GitHub (Nov 5, 2022):

Reference Funtoo Linux Bug tracking this: https://bugs.funtoo.org/browse/FL-10687

<!-- gh-comment-id:1304641328 --> @siris commented on GitHub (Nov 5, 2022): Reference Funtoo Linux Bug tracking this: https://bugs.funtoo.org/browse/FL-10687
Author
Owner

@siris commented on GitHub (Nov 21, 2022):

@Rigellute bump on this issue. Is there any possibility of someone reviewing PR #990, getting it merged and doing a quick patch version release of spotify-tui so it can successfully compile with Rust 1.64.0 and beyond?

<!-- gh-comment-id:1322766569 --> @siris commented on GitHub (Nov 21, 2022): @Rigellute bump on this issue. Is there any possibility of someone reviewing PR #990, getting it merged and doing a quick patch version release of `spotify-tui` so it can successfully compile with Rust 1.64.0 and beyond?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-tui#454
No description provided.