Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raspberry arm64 error could not compile fil-sapling-crypto. #104

Closed
sorker opened this issue Jun 11, 2020 · 3 comments
Closed

raspberry arm64 error could not compile fil-sapling-crypto. #104

sorker opened this issue Jun 11, 2020 · 3 comments

Comments

@sorker
Copy link

sorker commented Jun 11, 2020

i use docker, i can't reslove it worry.
this is Dockerfile
`

FROM golang:1.13-buster
MAINTAINER ldoublewood <ldoublewood@gmail.com>

ENV SRC_DIR /lotus

ENV RUSTFLAGS "-C target-cpu=native -g"
ENV FFI_BUILD_FROM_SOURCE 1

RUN apt-get update 
RUN apt-get install -y
RUN apt-get install -y ca-certificates llvm clang mesa-opencl-icd ocl-icd-opencl-dev flex bison libtool make automake autoconf tar zip gzip

RUN curl -sSf https://sh.rustup.rs | sh -s -- -y

# Get su-exec, a very minimal tool for dropping privileges,
# and tini, a very minimal init daemon for containers
ENV SUEXEC_VERSION v0.2
ENV TINI_VERSION v0.18.0
RUN set -x \
  && cd /tmp \
  && git clone https://github.com/ncopa/su-exec.git \
  && cd su-exec \
  && git checkout -q $SUEXEC_VERSION \
  && make \
  && cd /tmp \
  && wget -q -O tini https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini \
  && chmod +x tini

# Download packages first so they can be cached.
COPY go.mod go.sum $SRC_DIR/
COPY extern/ $SRC_DIR/extern/
RUN cd $SRC_DIR \
  && GOPROXY="https://goproxy.io" go mod download

COPY Makefile $SRC_DIR

# Because extern/filecoin-ffi building script need to get version number from git
COPY .git/ $SRC_DIR/.git/
COPY .gitmodules $SRC_DIR/
COPY localtime $SRC_DIR/

# jp install
RUN set -x \
  && cd /tmp \
  && git clone http://git.****.online:5030/sorke/jq.git \
  && cd jq \
  && git submodule update --init \
  && autoreconf -fi \
  && ./configure \
  && make \
  && make install

# Download dependence first
RUN cd $SRC_DIR \
  && mkdir $SRC_DIR/build \
  && . $HOME/.cargo/env \

RUN cd $SRC_DIR \
  && make clean \
  && make deps \
  && make bench


COPY . $SRC_DIR

ARG MAKE_TARGET=all
# RUN make clean deps bench

# Build the thing.
RUN cd $SRC_DIR \
  && . $HOME/.cargo/env \
  && make $MAKE_TARGET

# Now comes the actual target image, which aims to be as small as possible.
FROM busybox:1-glibc
MAINTAINER ldoublewood <ldoublewood@gmail.com>

# Get the executable binary and TLS CAs from the build container.
ENV SRC_DIR /lotus
COPY --from=0 $SRC_DIR/lotus /usr/local/bin/lotus
COPY --from=0 $SRC_DIR/lotus-* /usr/local/bin/
COPY --from=0 /tmp/su-exec/su-exec /sbin/su-exec
COPY --from=0 /tmp/tini /sbin/tini
COPY --from=0 /etc/ssl/certs /etc/ssl/certs


# This shared lib (part of glibc) doesn't seem to be included with busybox.
COPY --from=0 /lib/x86_64-linux-gnu/libdl-2.28.so /lib/libdl.so.2
COPY --from=0 /lib/x86_64-linux-gnu/libutil-2.28.so /lib/libutil.so.1
COPY --from=0 /usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0 /lib/libOpenCL.so.1
COPY --from=0 /lib/x86_64-linux-gnu/librt-2.28.so /lib/librt.so.1
COPY --from=0 /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/libgcc_s.so.1

COPY --from=0 $SRC_DIR/localtime /etc/
# WS port
EXPOSE 1234
# P2P port
EXPOSE 5678


# Create the home directory and switch to a non-privileged user.
ENV HOME_PATH /data
ENV PARAMCACHE_PATH /var/tmp/filecoin-proof-parameters

RUN mkdir -p $HOME_PATH $PARAMCACHE_PATH \
  && chown root:root $HOME_PATH $PARAMCACHE_PATH


VOLUME $HOME_PATH
VOLUME $PARAMCACHE_PATH

USER pi

# Execute the daemon subcommand by default
CMD ["/sbin/tini", "--", "lotus-seal-worker", "run"

i get error when it do 21 Step:

Compiling fil-sapling-crypto v0.6.0
error[E0433]: failed to resolve: use of undeclared type or module 'cc'
 --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/fil-sapling-crypto-0.6.0/build.rs:6:9
  |
6 |         cc::Build::new()
  |         ^^ use of undeclared type or module 'cc'

error: aborting due to previous error

For more information about this error, try `rustc --explain E0433`.
error: could not compile `fil-sapling-crypto`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
+ rm -f /tmp/tmp.y74WlF05o7
make[1]: *** [Makefile:11: .install-filcrypto] Error 101
make[1]: Leaving directory '/lotus/extern/filecoin-ffi'
make: *** [Makefile:37: build/.filecoin-install] Error 2
The command '/bin/sh -c cd $SRC_DIR   && mkdir $SRC_DIR/build   && . $HOME/.cargo/env RUN cd $SRC_DIR   && make clean   && make deps   && make bench' returned a non-zero code: 2

`

@sorker
Copy link
Author

sorker commented Jun 11, 2020

`

    + [[ -z nightly-2020-03-19 ]]
    ++ mktemp
    + __build_output_log_tmp=/tmp/tmp.y74WlF05o7
    + trap '{ rm -f $__build_output_log_tmp; }' EXIT
    + local '__rust_flags=--print native-static-libs -C target-cpu=native -g'
    + RUSTFLAGS='--print native-static-libs -C target-cpu=native -g'
    + cargo +nightly-2020-03-19 build --release
    + tee /tmp/tmp.y74WlF05o7
        Updating crates.io index
        Updating git repository `https://github.com/filecoin-project/rust-filecoin-proofs-api.git`
        Updating git repository `https://github.com/filecoin-project/rust-fil-proofs`
     Downloading crates ...
      Downloaded ffi-toolkit v0.4.0
      Downloaded block-modes v0.3.3
      Downloaded tar v0.4.26
      Downloaded regex v1.3.6
      Downloaded toml v0.5.6
      Downloaded rand_chacha v0.2.2
      Downloaded log v0.4.8
      Downloaded rayon v1.3.0
      Downloaded tempfile v3.1.0
      Downloaded flate2 v1.0.14
      Downloaded humansize v1.1.0
      Downloaded blake2b_simd v0.5.10
      Downloaded serde_json v1.0.51
      Downloaded itertools v0.9.0
      Downloaded rand_xorshift v0.2.0
      Downloaded lazy_static v1.4.0
      Downloaded reqwest v0.9.24
      Downloaded fs2 v0.4.3
      Downloaded typenum v1.11.2
      Downloaded once_cell v1.3.1
      Downloaded opaque-debug v0.2.3
      Downloaded raw-cpuid v7.0.3
      Downloaded block-buffer v0.7.3
      Downloaded bincode v1.2.1
      Downloaded thiserror v1.0.14
      Downloaded pretty_assertions v0.6.1
      Downloaded tee v0.1.0
      Downloaded config v0.9.3
      Downloaded merkletree v0.19.0
      Downloaded phase21 v0.6.0
      Downloaded fff v0.2.1
      Downloaded drop_struct_macro_derive v0.4.0
      Downloaded byteorder v1.3.4
      Downloaded fake-simd v0.1.2
      Downloaded digest v0.8.1
      Downloaded num_cpus v1.12.0
      Downloaded num-traits v0.2.11
      Downloaded hex v0.4.2
      Downloaded colored v1.9.3
      Downloaded structopt v0.3.12
      Downloaded sha2ni v0.8.3
      Downloaded os_pipe v0.9.1
      Downloaded serde_cbor v0.10.2
      Downloaded env_proxy v0.3.1
      Downloaded generic-array v0.13.2
      Downloaded simplelog v0.7.5
      Downloaded memmap v0.7.0
      Downloaded fil_logger v0.1.0
      Downloaded bitintr v0.3.0
      Downloaded os_type v2.2.0
      Downloaded blake2s_simd v0.5.10
      Downloaded num-bigint v0.2.6
      Downloaded aes v0.3.2
      Downloaded anyhow v1.0.28
      Downloaded fil-sapling-crypto v0.6.0
      Downloaded dialoguer v0.6.2
      Downloaded bellperson v0.8.0
      Downloaded rand v0.7.3
      Downloaded bitvec v0.17.4
      Downloaded cbindgen v0.10.0
      Downloaded neptune v0.7.1
      Downloaded serde v1.0.106
      Downloaded paired v0.19.1
      Downloaded chrono v0.4.11
      Downloaded bls-signatures v0.6.0
      Downloaded clap v2.33.0
      Downloaded libc v0.2.68
      Downloaded either v1.5.3
      Downloaded tempdir v0.3.7
      Downloaded mime_guess v2.0.3
      Downloaded num-integer v0.1.42
      Downloaded spin v0.5.2
      Downloaded generic-array v0.12.3
      Downloaded proc-macro2 v0.4.30
      Downloaded arrayvec v0.5.1
      Downloaded cookie v0.12.0
      Downloaded fff_derive v0.2.1
      Downloaded ahash v0.3.4
      Downloaded native-tls v0.2.4
      Downloaded arrayref v0.3.6
      Downloaded autocfg v1.0.0
      Downloaded futures-cpupool v0.1.8
      Downloaded constant_time_eq v0.1.5
      Downloaded bit-vec v0.6.1
      Downloaded pbr v1.0.2
      Downloaded syn v0.15.44
      Downloaded term v0.6.1
      Downloaded tokio v0.1.22
      Downloaded tokio-io v0.1.13
      Downloaded remove_dir_all v0.5.2
      Downloaded cfg-if v0.1.10
      Downloaded hyper v0.12.35
      Downloaded hkdf v0.8.0
      Downloaded ppv-lite86 v0.2.6
      Downloaded rand_core v0.5.1
      Downloaded http v0.1.21
      Downloaded console v0.11.2
      Downloaded aes-soft v0.3.3
      Downloaded hyper-tls v0.3.2
      Downloaded bytes v0.4.12
      Downloaded serde_derive v1.0.106
      Downloaded url v1.7.2
      Downloaded miniz_oxide v0.3.6
      Downloaded quote v0.6.13
      Downloaded rustc_version v0.2.3
      Downloaded block-cipher-trait v0.6.2
      Downloaded aho-corasick v0.7.10
      Downloaded rayon-core v1.7.0
      Downloaded getrandom v0.1.14
      Downloaded serde_urlencoded v0.5.5
      Downloaded ansi_term v0.11.0
      Downloaded cookie_store v0.7.0
      Downloaded yaml-rust v0.4.3
      Downloaded ryu v1.0.3
      Downloaded tokio-executor v0.1.10
      Downloaded tokio-threadpool v0.1.18
      Downloaded byte-tools v0.3.1
      Downloaded toml v0.4.10
      Downloaded time v0.1.42
      Downloaded cc v1.0.50
      Downloaded block-padding v0.1.5
      Downloaded mime v0.3.16
      Downloaded base64 v0.10.1
      Downloaded positioned-io v0.2.2
      Downloaded groupy v0.3.1
      Downloaded bitflags v1.2.1
      Downloaded uuid v0.7.4
      Downloaded crc32fast v1.2.0
      Downloaded proc-macro2 v1.0.10
      Downloaded filetime v0.2.9
      Downloaded half v1.5.0
      Downloaded itoa v0.4.5
      Downloaded crossbeam v0.7.3
      Downloaded rust-ini v0.13.0
      Downloaded thread_local v1.0.1
      Downloaded memchr v2.3.3
      Downloaded atty v0.2.14
      Downloaded thiserror-impl v1.0.14
      Downloaded xattr v0.2.2
      Downloaded quote v1.0.3
      Downloaded radium v0.3.0
      Downloaded structopt-derive v0.4.5
      Downloaded tokio-timer v0.2.13
      Downloaded crossbeam-deque v0.7.3
      Downloaded serde-hjson v0.8.2
      Downloaded flexi_logger v0.14.8
      Downloaded difference v2.0.0
      Downloaded nom v4.2.3
      Downloaded encoding_rs v0.8.22
      Downloaded regex-syntax v0.6.17
      Downloaded futures v0.1.29
      Downloaded syn v1.0.17
      Downloaded fil-ocl v0.19.4
      Downloaded glob v0.3.0
      Downloaded maybe-uninit v2.0.0
      Downloaded hmac v0.7.1
      Downloaded unicode-xid v0.2.0
      Downloaded crossbeam-epoch v0.8.2
      Downloaded neptune-triton v0.2.2
      Downloaded try_from v0.3.2
      Downloaded slab v0.4.2
      Downloaded tokio-reactor v0.1.12
      Downloaded want v0.2.0
      Downloaded matches v0.1.8
      Downloaded crossbeam-channel v0.4.2
      Downloaded vec_map v0.8.1
      Downloaded termios v0.3.2
      Downloaded textwrap v0.11.0
      Downloaded crossbeam-utils v0.7.2
      Downloaded strsim v0.8.0
      Downloaded failure v0.1.7
      Downloaded adler32 v1.0.4
      Downloaded h2 v0.1.26
      Downloaded net2 v0.2.33
      Downloaded fnv v1.0.6
      Downloaded tokio-buf v0.1.1
      Downloaded tokio-tcp v0.1.4
      Downloaded publicsuffix v1.5.4
      Downloaded httparse v1.3.4
      Downloaded terminal_size v0.1.12
      Downloaded http-body v0.1.0
      Downloaded percent-encoding v1.0.1
      Downloaded unicode-width v0.1.7
      Downloaded crossbeam-queue v0.2.1
      Downloaded unicode-xid v0.1.0
      Downloaded byteorder v0.5.3
      Downloaded rand v0.6.5
      Downloaded lazy_static v0.2.11
      Downloaded iovec v0.1.4
      Downloaded openssl-sys v0.9.55
      Downloaded rand v0.4.6
      Downloaded const-random v0.1.8
      Downloaded openssl-probe v0.1.2
      Downloaded mio v0.6.21
      Downloaded num-traits v0.1.43
      Downloaded dirs v2.0.2
      Downloaded dtoa v0.4.5
      Downloaded openssl v0.10.29
      Downloaded idna v0.1.5
      Downloaded heck v0.3.1
      Downloaded proc-macro-error v0.4.12
      Downloaded version_check v0.1.5
      Downloaded unicase v2.6.0
      Downloaded tokio-current-thread v0.1.7
      Downloaded linked-hash-map v0.5.2
      Downloaded semver v0.9.0
      Downloaded serde v0.8.23
      Downloaded linked-hash-map v0.3.0
      Downloaded yansi v0.5.0
      Downloaded crypto-mac v0.7.0
      Downloaded memoffset v0.5.4
      Downloaded url v2.1.1
      Downloaded unicode-normalization v0.1.12
      Downloaded error-chain v0.12.2
      Downloaded idna v0.2.0
      Downloaded parking_lot v0.9.0
      Downloaded try-lock v0.2.2
      Downloaded tokio-sync v0.1.8
      Downloaded indexmap v1.3.2
      Downloaded rand_isaac v0.1.1
      Downloaded dirs-sys v0.3.4
      Downloaded autocfg v0.1.7
      Downloaded rand_xorshift v0.1.1
      Downloaded rand_hc v0.1.0
      Downloaded rand_core v0.4.2
      Downloaded pkg-config v0.3.17
      Downloaded backtrace v0.3.46
      Downloaded rand_pcg v0.1.2
      Downloaded version_check v0.9.1
      Downloaded rand_os v0.1.3
      Downloaded openssl-src v111.8.1+1.1.1f
      Downloaded unicode-segmentation v1.6.0
      Downloaded rand_jitter v0.1.4
      Downloaded string v0.2.1
      Downloaded proc-macro-error-attr v0.4.12
      Downloaded foreign-types v0.3.2
      Downloaded qutex v0.2.3
      Downloaded fil-ocl-core v0.11.3
      Downloaded scopeguard v1.1.0
      Downloaded rand_chacha v0.1.1
      Downloaded unicode-bidi v0.3.4
      Downloaded failure_derive v0.1.7
      Downloaded nodrop v0.1.14
      Downloaded proc-macro-hack v0.5.15
      Downloaded const-random-macro v0.1.8
      Downloaded rand_core v0.3.1
      Downloaded percent-encoding v2.1.0
      Downloaded backtrace-sys v0.1.35
      Downloaded rustc_version v0.1.7
      Downloaded subtle v1.0.0
      Downloaded num-complex v0.1.43
      Downloaded foreign-types-shared v0.1.1
      Downloaded syn-mid v0.5.0
      Downloaded enum_primitive v0.1.1
      Downloaded semver-parser v0.7.0
      Downloaded parking_lot_core v0.6.2
      Downloaded lock_api v0.3.3
      Downloaded smallvec v1.2.0
      Downloaded serde_test v0.8.23
      Downloaded ocl-core-vector v0.1.0
      Downloaded rustc-demangle v0.1.16
      Downloaded cl-sys v0.4.2
      Downloaded synstructure v0.12.3
      Downloaded rustc-serialize v0.3.24
      Downloaded num v0.1.42
      Downloaded semver v0.1.20
      Downloaded smallvec v0.6.13
      Downloaded num-bigint v0.1.44
      Downloaded num-iter v0.1.40
      Downloaded num-rational v0.1.42
       Compiling libc v0.2.68
       Compiling autocfg v1.0.0
       Compiling cfg-if v0.1.10
       Compiling spin v0.5.2
       Compiling proc-macro2 v1.0.10
       Compiling unicode-xid v0.2.0
       Compiling syn v1.0.17
       Compiling cc v1.0.50
       Compiling byteorder v1.3.4
       Compiling log v0.4.8
       Compiling maybe-uninit v2.0.0
       Compiling getrandom v0.1.14
       Compiling futures v0.1.29
       Compiling scopeguard v1.1.0
       Compiling semver-parser v0.7.0
       Compiling either v1.5.3
       Compiling typenum v1.11.2
       Compiling bitflags v1.2.1
       Compiling serde v1.0.106
       Compiling version_check v0.9.1
       Compiling ppv-lite86 v0.2.6
       Compiling memchr v2.3.3
       Compiling itoa v0.4.5
       Compiling failure_derive v0.1.7
       Compiling regex-syntax v0.6.17
       Compiling rustc-serialize v0.3.24
       Compiling rustc-demangle v0.1.16
       Compiling subtle v1.0.0
       Compiling semver v0.1.20
       Compiling ryu v1.0.3
       Compiling arrayref v0.3.6
       Compiling rayon-core v1.7.0
       Compiling constant_time_eq v0.1.5
       Compiling arrayvec v0.5.1
       Compiling cl-sys v0.4.2
       Compiling autocfg v0.1.7
       Compiling matches v0.1.8
       Compiling remove_dir_all v0.5.2
       Compiling rand_core v0.4.2
       Compiling proc-macro-hack v0.5.15
       Compiling smallvec v1.2.0
       Compiling fnv v1.0.6
       Compiling byte-tools v0.3.1
       Compiling slab v0.4.2
       Compiling pkg-config v0.3.17
       Compiling opaque-debug v0.2.3
       Compiling nodrop v0.1.14
       Compiling version_check v0.1.5
       Compiling ansi_term v0.11.0
       Compiling unicode-width v0.1.7
       Compiling bit-vec v0.6.1
       Compiling serde v0.8.23
       Compiling fake-simd v0.1.2
       Compiling anyhow v1.0.28
       Compiling byteorder v0.5.3
       Compiling lazy_static v0.2.11
       Compiling fil-sapling-crypto v0.6.0
    error[E0433]: failed to resolve: use of undeclared type or module `cc`
     --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/fil-sapling-crypto-0.6.0/build.rs:6:9
      |
    6 |         cc::Build::new()
      |         ^^ use of undeclared type or module `cc`
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0433`.
    error: could not compile `fil-sapling-crypto`.
    
    To learn more, run the command again with --verbose.
    warning: build failed, waiting for other jobs to finish...
    error: build failed
    + rm -f /tmp/tmp.y74WlF05o7
    make[1]: *** [Makefile:11: .install-filcrypto] Error 101
    make[1]: Leaving directory '/lotus/extern/filecoin-ffi'
    make: *** [Makefile:37: build/.filecoin-install] Error 2
    The command '/bin/sh -c cd $SRC_DIR   && mkdir $SRC_DIR/build   && . $HOME/.cargo/env RUN cd $SRC_DIR   && make clean   && make deps   && make bench' returned a non-zero code: 2`

@sorker
Copy link
Author

sorker commented Jun 11, 2020

do in raspberry 4, system is Debian-Pi-Aarch64

@str4d
Copy link
Contributor

str4d commented Dec 20, 2023

fil-sapling-crypto is a fork of this crate; we can't help there.

Also closing because the crate has been refactored.

@str4d str4d closed this as completed Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants