[GH-ISSUE #1027] AUR build error #457

Closed
opened 2026-02-28 14:49:17 +03:00 by kerem · 10 comments
Owner

Originally created by @TH3-S4LM0N on GitHub (Sep 26, 2022).
Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/1027

I installed spotify-tui from the aur with yay. During the compile, this error occured:

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
   --> /home/salmon/.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)

For more information about this error, try `rustc --explain E0512`.
error: could not compile `socket2` due to previous error

Searched for "transmutate" type keywords, didn't see any issues, my bad if this is a dupe.

Edit: 3 months later I realized I put sporify-tui

Originally created by @TH3-S4LM0N on GitHub (Sep 26, 2022). Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/1027 I installed `spotify-tui` from the aur with `yay`. During the compile, this error occured: ``` error[E0512]: cannot transmute between types of different sizes, or dependently-sized types --> /home/salmon/.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) For more information about this error, try `rustc --explain E0512`. error: could not compile `socket2` due to previous error ``` Searched for "transmutate" type keywords, didn't see any issues, my bad if this is a dupe. Edit: 3 months later I realized I put `sporify-tui`
kerem closed this issue 2026-02-28 14:49:17 +03:00
Author
Owner

@loremol commented on GitHub (Sep 26, 2022):

This happens also to me.

<!-- gh-comment-id:1257811186 --> @loremol commented on GitHub (Sep 26, 2022): This happens also to me.
Author
Owner

@w1sq commented on GitHub (Sep 26, 2022):

I also got this issue

<!-- gh-comment-id:1257815951 --> @w1sq commented on GitHub (Sep 26, 2022): I also got this issue
Author
Owner

@lalovzg commented on GitHub (Sep 27, 2022):

Just wanted to add into this issue:

Rust in its version 1.64.0 made changes to Ipv4Addr, Ipv6Addr, SocketAddrV4 and SocketAddrV6. Also, when using std::mem::transmute it results in invalid memory accesses.
Rust 1.64.0 Compatibility Notes

With all of these, the newest version of Rust broke some crates, and now spotify-tui has problems with memory and different bit sizes and stuff.
So they recommend doing cargo update to mitigate for now, and it works as a workaround (adding the cargo update somewhere before it reads the Cargo.lock and Cargo.toml files and .patches.

I had to manually do the editing, building and compiling from "source" (AUR in Arch Linux).

Also, after running makepkg si with the cargo update command already in place, it updates the files but after that it is required to download updated versions of some of the dependencies/creates and 1 or 2 required http and also, obviously for all the update, network connection is required so the --frozen option had to be temporary removed.

For me, it built succesfully after that even using this PKGBUILD.

<!-- gh-comment-id:1259853785 --> @lalovzg commented on GitHub (Sep 27, 2022): Just wanted to add into this issue: Rust in its version 1.64.0 made changes to Ipv4Addr, Ipv6Addr, SocketAddrV4 and SocketAddrV6. Also, when using `std::mem::transmute` it results in invalid memory accesses. [Rust 1.64.0 Compatibility Notes](https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#compatibility-notes) With all of these, the newest version of Rust broke some *crates*, and now spotify-tui has problems with memory and different bit sizes and stuff. So they recommend doing `cargo update` to mitigate for now, and it works as a workaround (adding the cargo update somewhere before it reads the *Cargo.lock* and *Cargo.toml* files and *.patches*. I had to manually do the editing, building and compiling from ["source"](https://aur.archlinux.org/packages/spotify-tui) (AUR in Arch Linux). Also, after running `makepkg si` with the cargo update command already in place, it updates the files but after that it is required to download updated versions of some of the dependencies/creates and 1 or 2 required http and also, obviously for all the update, network connection is required so the `--frozen` option had to be temporary removed. For me, it built succesfully after that even using this PKGBUILD.
Author
Owner

@nurhaziq97 commented on GitHub (Sep 28, 2022):

https://github.com/Rigellute/spotify-tui/issues/1027#issuecomment-1259853785 suggested workaround work for me. Thank you

<!-- gh-comment-id:1260275614 --> @nurhaziq97 commented on GitHub (Sep 28, 2022): https://github.com/Rigellute/spotify-tui/issues/1027#issuecomment-1259853785 suggested workaround work for me. Thank you
Author
Owner

@K-wachira commented on GitHub (Oct 3, 2022):

I had to manually do the editing, building, and compiling

Hi, I have little to no knowledge when it comes to rust,
What files are you editing or updating before doing the build? I am stuck there.

I tried doing the cargo update, but I do not have Cargo.toml on spotify-tui root folder.
I extracted the rspotify-0.10.0 and ran cargo update in that directory but still got the error when building.

<!-- gh-comment-id:1265695678 --> @K-wachira commented on GitHub (Oct 3, 2022): > I had to manually do the editing, building, and compiling Hi, I have little to no knowledge when it comes to rust, What files are you editing or updating before doing the build? I am stuck there. I tried doing the `cargo update`, but I do not have `Cargo.toml ` on spotify-tui root folder. I extracted the ` rspotify-0.10.0` and ran `cargo update` in that directory but still got the error when building.
Author
Owner

@nurhaziq97 commented on GitHub (Oct 4, 2022):

For me, I just clone the [AUR}(https://aur.archlinux.org/packages/spotify-tui) git. Then, I edit the PKGBUILD file on line 38-46 into this.

build() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo update
  cargo build  --release
  ./target/release/spt --completions bash > target/release/spt-completion.bash
  ./target/release/spt --completions zsh > target/release/spt-completion.zsh
  ./target/release/spt --completions fish > target/release/spt-completion.fish
}

I don't know if this is the correct approach.

<!-- gh-comment-id:1266557124 --> @nurhaziq97 commented on GitHub (Oct 4, 2022): For me, I just clone the [AUR}(https://aur.archlinux.org/packages/spotify-tui) git. Then, I edit the PKGBUILD file on line 38-46 into this. ``` build() { cd "$pkgname-$pkgver" export RUSTUP_TOOLCHAIN=stable export CARGO_TARGET_DIR=target cargo update cargo build --release ./target/release/spt --completions bash > target/release/spt-completion.bash ./target/release/spt --completions zsh > target/release/spt-completion.zsh ./target/release/spt --completions fish > target/release/spt-completion.fish } ``` I don't know if this is the correct approach.
Author
Owner

@K-wachira commented on GitHub (Oct 6, 2022):

Thanks, this worked for me too. :)

<!-- gh-comment-id:1270474338 --> @K-wachira commented on GitHub (Oct 6, 2022): Thanks, this worked for me too. :)
Author
Owner

@Gianfra1002 commented on GitHub (Oct 17, 2022):

For me, I just clone the [AUR}(https://aur.archlinux.org/packages/spotify-tui) git. Then, I edit the PKGBUILD file on line 38-46 into this.

build() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo update
  cargo build  --release
  ./target/release/spt --completions bash > target/release/spt-completion.bash
  ./target/release/spt --completions zsh > target/release/spt-completion.zsh
  ./target/release/spt --completions fish > target/release/spt-completion.fish
}

I don't know if this is the correct approach.

That worked, thank you so much!

<!-- gh-comment-id:1281525724 --> @Gianfra1002 commented on GitHub (Oct 17, 2022): > For me, I just clone the [AUR}(https://aur.archlinux.org/packages/spotify-tui) git. Then, I edit the PKGBUILD file on line 38-46 into this. > > ``` > build() { > cd "$pkgname-$pkgver" > export RUSTUP_TOOLCHAIN=stable > export CARGO_TARGET_DIR=target > cargo update > cargo build --release > ./target/release/spt --completions bash > target/release/spt-completion.bash > ./target/release/spt --completions zsh > target/release/spt-completion.zsh > ./target/release/spt --completions fish > target/release/spt-completion.fish > } > ``` > > I don't know if this is the correct approach. That worked, thank you so much!
Author
Owner

@0xFAC0 commented on GitHub (Dec 1, 2022):

For me, I just clone the [AUR}(https://aur.archlinux.org/packages/spotify-tui) git. Then, I edit the PKGBUILD file on line 38-46 into this.

build() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo update
  cargo build  --release
  ./target/release/spt --completions bash > target/release/spt-completion.bash
  ./target/release/spt --completions zsh > target/release/spt-completion.zsh
  ./target/release/spt --completions fish > target/release/spt-completion.fish
}

I don't know if this is the correct approach.

Also fixed the issue on a nearly fresh arch install.

<!-- gh-comment-id:1333515417 --> @0xFAC0 commented on GitHub (Dec 1, 2022): > For me, I just clone the [AUR}(https://aur.archlinux.org/packages/spotify-tui) git. Then, I edit the PKGBUILD file on line 38-46 into this. > > ``` > build() { > cd "$pkgname-$pkgver" > export RUSTUP_TOOLCHAIN=stable > export CARGO_TARGET_DIR=target > cargo update > cargo build --release > ./target/release/spt --completions bash > target/release/spt-completion.bash > ./target/release/spt --completions zsh > target/release/spt-completion.zsh > ./target/release/spt --completions fish > target/release/spt-completion.fish > } > ``` > > I don't know if this is the correct approach. Also fixed the issue on a nearly fresh arch install.
Author
Owner

@TH3-S4LM0N commented on GitHub (Dec 27, 2022):

Came back and it is building now so no reason for this to stay open.

<!-- gh-comment-id:1365749872 --> @TH3-S4LM0N commented on GitHub (Dec 27, 2022): Came back and it is building now so no reason for this to stay open.
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#457
No description provided.