spotify-adblock icon indicating copy to clipboard operation
spotify-adblock copied to clipboard

Build fails on Kubuntu 21.04

Open Merrit opened this issue 3 years ago • 4 comments

Build failure:

Details

cargo build --profile release

cargo build --release Updating crates.io index Downloaded aho-corasick v0.7.18 Downloaded toml v0.5.8 Downloaded proc-macro2 v1.0.28 Downloaded syn v1.0.75 Downloaded quote v1.0.9 Downloaded regex-syntax v0.6.25 Downloaded serde_derive v1.0.128 Downloaded serde v1.0.128 Downloaded unicode-xid v0.2.2 Downloaded memchr v2.4.1 Downloaded regex v1.5.4 Downloaded libc v0.2.100 Downloaded lazy_static v1.4.0 Downloaded 13 crates (1.7 MB) in 0.65s Compiling proc-macro2 v1.0.28 Compiling unicode-xid v0.2.2 Compiling syn v1.0.75 Compiling serde_derive v1.0.128 Compiling memchr v2.4.1 Compiling serde v1.0.128 Compiling libc v0.2.100 Compiling regex-syntax v0.6.25 Compiling lazy_static v1.4.0 error: linker cc not found | = note: No such file or directory (os error 2)

error: aborting due to previous error

error: could not compile memchr

To learn more, run the command again with --verbose. warning: build failed, waiting for other jobs to finish... error: linker cc not found | = note: No such file or directory (os error 2)

error: aborting due to previous error

error: linker cc not found | = note: No such file or directory (os error 2)

error: aborting due to previous error

error: linker cc not found | = note: No such file or directory (os error 2)

error: aborting due to previous error

error: linker cc not found | = note: No such file or directory (os error 2)

error: aborting due to previous error

error: linker cc not found | = note: No such file or directory (os error 2)

error: aborting due to previous error

error: build failed make: *** [Makefile:14: target/release/libspotifyadblock.so] Error 101

The Rust install process doesn't mention it, but sudo apt install build-essential is needed to get it to work. Might be worth a mention in the readme?

Thanks for the excellent app :heart:

Merrit avatar Aug 22 '21 17:08 Merrit

I agree that it's a good idea to mention this in order to preempt future issues, but I'm not sure what the best way to do it would be. I don't want to include installation instructions for every conceivable distribution (i.e. apt install build-essential, pacman -S base-devel, eopkg it -c system.devel etc.), but just telling people to install a linker might not be enough.

I think just adding the gcc toolchain to the prerequisites might be the simplest solution, even though I don't know if that's actually the only linker that works. Sadly there doesn't seem to be any official Rust documentation that could be linked to, which explains this dependency and how best to satisfy it.

abba23 avatar Sep 03 '21 10:09 abba23

I guess ideally this wouldn't be an issue for this repo, but rather the Rust install instructions should likely be amended to mention this since it seems to just be a requirement for Rust in general.

I am not very familiar with Rust, but it looks like they already have an open issue for this.

Merrit avatar Sep 03 '21 13:09 Merrit

(Pop_OS and Ubuntu)

Once you have installed the package it throws this error at you, cargo directory missing, tried to find a few solutions but they don't work, i think this might be Pop_OS specific...

user@pop-os:/spotify-adblock$ sudo make install
# cargo build --profile release
cargo build --release
make: cargo: No such file or directory

ttagoe avatar Oct 29 '21 18:10 ttagoe

@Glitch375 Please make sure that Cargo is installed. It's (now) mentioned in the build prerequisites.

abba23 avatar Oct 30 '21 19:10 abba23