ProcursusTeam / Procursus

Modern *OS Bootstrap
https://apt.procurs.us
BSD Zero Clause License
873 stars 128 forks source link

Cargo won't compile project: Error loading target specification: failed to get iphoneos SDK path: No such file or directory (os error 2). #1219

Closed arinc9 closed 2 years ago

arinc9 commented 2 years ago

I'm trying to compile a rust project on my iPhone X on iOS 13.7 running procursus bootstrap with OdysseyRa1n. build-essential is installed. I can see the SDK at /usr/share/SDKs/iPhoneOS.sdk

I get this error which I can't figure out where cargo is looking for the iPhoneOS SDK.

# root @ arinc9-iPhone in ~/boringtun on git:090b805 o [15:20:14]
$ TEMPDIR=/var/root cargo build --bin boringtun --release
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -C llvm-args=-slp-recursion-max-depth=1024 --emit asm --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
  --- stderr
  error: Error loading target specification: failed to get iphoneos SDK path: No such file or directory (os error 2). Use `--print target-list` for a list of built-in targets
TheRealKeto commented 2 years ago

You might want to look into specifying SDKROOT; point it to the iOS SDK, and (in most cases) things should work.

arinc9 commented 2 years ago

That did it! I added export SDKROOT=/usr/share/SDKs/iPhoneOS.sdk to my .zshrc. Thanks a ton!