FuelLabs / fuel-indexer

🗃 The Fuel indexer is a standalone service that can be used to index various components of the Fuel blockchain.
https://docs.fuel.network/docs/indexer/
140 stars 66 forks source link

Build fails on Mac M1 #1465

Open hummusonrails opened 9 months ago

hummusonrails commented 9 months ago

Issue

Thanks for opening an issue on the Fuel Indexer project.

Prerequisites

Description

I am experiencing an issue when attempting to build with forc index build. At first, the issue was exactly the same as documented in the forum, and I followed the steps outlined in the solution on the forum to the letter by following the guide here.

Now, the issue I am experiencing is the build fails with an error that includes (among several hundred lines of output):

--- stderr

  error occurred: Failed to find tool. Is `` installed?

warning: build failed, waiting for other jobs to finish...
▹▹▹▹▸ ⏰ Building indexer...                                                                                                                                            The following warnings were emitted during compilation:

warning: secp256k1-sys@0.8.1: In file included from depend/secp256k1/src/precomputed_ecmult_gen.c:7:
warning: secp256k1-sys@0.8.1: In file included from depend/secp256k1/src/group.h:10:
warning: secp256k1-sys@0.8.1: depend/secp256k1/src/field.h:44:13: warning: unused function 'rustsecp256k1_v0_8_1_fe_normalize' [-Wunused-function]
warning: secp256k1-sys@0.8.1:    44 | static void rustsecp256k1_v0_8_1_fe_normalize(rustsecp256k1_v0_8_1_fe *r);

I am using rust version: 1.73.0 (cc66ad468 2023-10-03).

My fuel toolchain versioning is as follows:

active toolchain
-----------------
beta-4-aarch64-apple-darwin (default)
  forc : 0.45.0
    - forc-client
      - forc-deploy : 0.45.0
      - forc-run : 0.45.0
    - forc-doc : 0.45.0
    - forc-explore : 0.28.1
    - forc-fmt : 0.45.0
    - forc-index : 0.21.0
    - forc-lsp : 0.45.0
    - forc-tx : 0.45.0
    - forc-wallet : 0.3.0
  fuel-core : 0.20.4
  fuel-core-keygen : Error getting version string
  fuel-indexer : 0.21.0

fuels versions
---------------
forc : 0.45
forc-wallet : 0.45

Versions

Please list what version of indexer components you're using. Latest is currently .

ra0x3 commented 9 months ago

Thanks @hummusonrails

>>> fuelup show
Default host: aarch64-apple-darwin
fuelup home: /Users/rashad/.fuelup

installed toolchains
--------------------
latest-aarch64-apple-darwin
beta-4-aarch64-apple-darwin (default)
latest-2023-07-07-aarch64-apple-darwin
latest-2023-07-13-aarch64-apple-darwin
latest-2023-07-18-aarch64-apple-darwin
latest-2023-07-20-aarch64-apple-darwin
latest-2023-11-06-aarch64-apple-darwin

active toolchain
-----------------
beta-4-aarch64-apple-darwin (default)
  forc : 0.46.1
    - forc-client
      - forc-deploy : 0.46.1
      - forc-run : 0.46.1
    - forc-doc : 0.46.1
    - forc-explore : 0.28.1
    - forc-fmt : 0.46.1
    - forc-index : 0.23.0
    - forc-lsp : 0.46.1
    - forc-tx : 0.46.1
    - forc-wallet : 0.3.0
  fuel-core : 0.20.5
  fuel-core-keygen : Error getting version string
  fuel-indexer : 0.23.0

fuels versions
---------------
forc : 0.45
forc-wallet : 0.45
ra0x3 commented 9 months ago

@hummusonrails Just checking in here :)

hummusonrails commented 9 months ago

Thanks @ra0x3! I was away from my computer past week or so. I'll give it a go later today or tomorrow and report back!

hummusonrails commented 9 months ago

I've updated to the latest versions and still it is unable to build.

My versions:

installed toolchains
--------------------
beta-3-aarch64-apple-darwin
latest-aarch64-apple-darwin
beta-4-aarch64-apple-darwin (default)

active toolchain
-----------------
beta-4-aarch64-apple-darwin (default)
  forc : 0.46.1
    - forc-client
      - forc-deploy : 0.46.1
      - forc-run : 0.46.1
    - forc-doc : 0.46.1
    - forc-explore : 0.28.1
    - forc-fmt : 0.46.1
    - forc-index : 0.23.0
    - forc-lsp : 0.46.1
    - forc-tx : 0.46.1
    - forc-wallet : 0.3.0
  fuel-core : 0.20.5
  fuel-core-keygen : Error getting version string
  fuel-indexer : 0.23.0

fuels versions
---------------
forc : 0.45
forc-wallet : 0.45

The error output:

forc index build
▹▸▹▹▹ ⏰ Building indexer...                                                                                                                   Compiling secp256k1-sys v0.8.1
   Compiling anyhow v1.0.75
   Compiling fuel-vm v0.35.3
   Compiling clap_derive v3.2.25
   Compiling syn v2.0.39
   Compiling postcard v1.0.8
   Compiling heapless v0.7.16
   Compiling tracing v0.1.40
   Compiling indexmap v1.9.3
   Compiling serde_with v1.14.0
▹▹▸▹▹ ⏰ Building indexer...                                                                                                                   Compiling hashbrown v0.12.3
▹▹▹▸▹ ⏰ Building indexer...                                                                                                                   Compiling cobs v0.2.3
The following warnings were emitted during compilation:

warning: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
warning: 1 error generated.
warning: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
warning: 1 error generated.

error: failed to run custom build command for `secp256k1-sys v0.8.1`

Caused by:
  process didn't exit successfully: `/Users/bengreenberg/Dev/fuel/hello-indexer/target/release/build/secp256k1-sys-f471911d3f2140fa/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("wasm32-unknown-unknown")
  OPT_LEVEL = Some("3")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown
  CC_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown
  CC_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
  CFLAGS_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
  CFLAGS_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown
  CC_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown
  CC_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
  CFLAGS_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
  CFLAGS_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm/wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_API=" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-DENABLE_MODULE_RECOVERY=1" "-o" "/Users/bengreenberg/Dev/fuel/hello-indexer/target/wasm32-unknown-unknown/release/build/secp256k1-sys-5689534f498b4979/out/wasm/wasm.o" "-c" "wasm/wasm.c"
  cargo:warning=error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'

  cargo:warning=1 error generated.

  exit status: 1
  running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm/wasm-sysroot" "-I" "wasm/wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_API=" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-DENABLE_MODULE_RECOVERY=1" "-o" "/Users/bengreenberg/Dev/fuel/hello-indexer/target/wasm32-unknown-unknown/release/build/secp256k1-sys-5689534f498b4979/out/wasm/wasm.o" "-c" "wasm/wasm.c"
  cargo:warning=error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'

  cargo:warning=1 error generated.

  exit status: 1

  --- stderr

  error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm/wasm-sysroot" "-I" "wasm/wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_API=" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-DENABLE_MODULE_RECOVERY=1" "-o" "/Users/bengreenberg/Dev/fuel/hello-indexer/target/wasm32-unknown-unknown/release/build/secp256k1-sys-5689534f498b4979/out/wasm/wasm.o" "-c" "wasm/wasm.c" with args "clang" did not execute successfully (status code exit status: 1).

warning: build failed, waiting for other jobs to finish...
▹▹▹▹▸ ⏰ Building indexer...                                                                                                                ▹▸▹▹▹ ⏰ Building indexer...                                                                                                                ▸▹▹▹▹ ⏰ Building indexer...                                                                                                                ▹▹▹▹▸ ⏰ Building indexer...                                                                                                                ▪▪▪▪▪ ❌ Build failed.                                                                                                                      Error: ❌ Failed to build index.