起こった問題
intel macで、spotify-tuiやevcxr_jupyterをinstallしようと思ったらエラーが出た。下のエラーはspotify-tuiのものだけど、evcxr_jupyterでもほぼ同じエラーがでた。
error: failed to run custom build command for `slab v0.4.9`
Caused by:
process didn't exit successfully: `/var/folders/62/0sg6zx7s1k300g9mgy_z34rc0000gn/T/cargo-installVO4DD6/release/build/slab-c6cf3c38167b30da/build-script-build` (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `proc-macro2 v1.0.85`
Caused by:
process didn't exit successfully: `/var/folders/62/0sg6zx7s1k300g9mgy_z34rc0000gn/T/cargo-installVO4DD6/release/build/proc-macro2-cafeadadbf3212d9/build-script-build` (signal: 9, SIGKILL: kill)
error: failed to run custom build command for `proc-macro2 v0.4.30`
Caused by:
process didn't exit successfully: `/var/folders/62/0sg6zx7s1k300g9mgy_z34rc0000gn/T/cargo-installVO4DD6/release/build/proc-macro2-884607e92c38728a/build-script-build` (signal: 9, SIGKILL: kill)
error: failed to run custom build command for `syn v1.0.109`
Caused by:
process didn't exit successfully: `/var/folders/62/0sg6zx7s1k300g9mgy_z34rc0000gn/T/cargo-installVO4DD6/release/build/syn-6fc95c86ff5427c2/build-script-build` (signal: 6, SIGABRT: process abort signal)
--- stderr
dyld[43888]: section __got overflows indirect symbol table
error: failed to run custom build command for `libc v0.2.155`
Caused by:
process didn't exit successfully: `/var/folders/62/0sg6zx7s1k300g9mgy_z34rc0000gn/T/cargo-installVO4DD6/release/build/libc-a009542d493b35e3/build-script-build` (signal: 6, SIGABRT: process abort signal)
--- stderr
dyld[43890]: section __got overflows indirect symbol table
error: failed to compile `spotify-tui v0.25.0`, intermediate artifacts can be found at `/var/folders/62/0sg6zx7s1k300g9mgy_z34rc0000gn/T/cargo-installVO4DD6`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
解決法
Homebrewのgccを入れていたからっぽい。
~/.cargo/config.toml
を作成して、以下を記入。
[target.x86_64-apple-darwin]
linker = "gcc-13"
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
[build]
target = "x86_64-apple-darwin"
gccのバージョン(上記だと13)は適宜変える。
これでうまくbuildが通った。