lightningdevkit / ldk-c-bindings

Main LDK C Bindings on which other bindings are built
Other
13 stars 14 forks source link

Fails to build on macos x86 #37

Closed galderz closed 3 years ago

galderz commented 3 years ago

I'm trying to build this on macos x86 but fails with:

./genbindings.sh /opt/rust-lightning-matt true
...
+ '[' '-ffile-prefix-map=/Users/g/.cargo= -frandom-seed=42 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=10.9 --target=aarch64-apple-darwin -mcpu=apple-a14' '!=' '' ']'
+ RUSTFLAGS='--remap-path-prefix /opt/rust-lightning-matt=rust-lightning --remap-path-prefix /opt/ldk-c-bindings=ldk-c-bindings --remap-path-prefix /Users/g/.cargo= -C target-cpu=apple-a14'
+ cargo build --target aarch64-apple-darwin
   Compiling cc v1.0.69
   Compiling autocfg v1.0.1
   Compiling bitcoin_hashes v0.9.7
   Compiling bech32 v0.7.3
error[E0463]: can't find crate for `std`
  |
  = note: the `aarch64-apple-darwin` target may not be installed
  = help: consider downloading the target with `rustup target add aarch64-apple-darwin`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `bech32`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
  |
  = note: the `aarch64-apple-darwin` target may not be installed
  = help: consider downloading the target with `rustup target add aarch64-apple-darwin`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: build failed

See full output

TheBlueMatt commented 3 years ago

By default, when we detect we're on OSX, we try to build an M1 binary as well. If you run the suggested rustup target add aarch64-apple-darwin that should work and you shouldn't have issues.

galderz commented 3 years ago

Hmmm, but my machine is not an M1... I'll try

galderz commented 3 years ago

That worked, thx!