FuelLabs / fuel-indexer

*Archived* 🗃 The Fuel indexer is a standalone service that can be used to index various components of the Fuel blockchain.
140 stars 67 forks source link

enhancement: Added message to compiler error when on Apple M1 #1302

Closed dadepo closed 1 year ago

dadepo commented 1 year ago

Currently opening as draft:

I might even go as far to say we maybe should read the output of a failed forc index build and look for wasm-related output in order to present this message their as well

Not sure I totally understand the requirement here and whether the changes in this PR already satisfies this.

Description

When compilation fails and host is Apple M1, print out error message Informing user about possible missing environment vars.

Closes #889

Currently the message printed is


▪▪▪▪▪ ❌ Build failed.
For Apple Silicon macOS users the preinstalled llvm has limited WASM targets,
please install a binary with better support from Homebrew (brew install llvm)
and configuring rustc with necessary environment variables:

export LIBCLANG_PATH='/opt/homebrew/opt/llvm/lib'
export LDFLAGS='-L/opt/homebrew/opt/llvm/lib'
export CPPFLAGS='-I/opt/homebrew/opt/llvm/include'                                                                                                                                   Error: ❌ Failed to build index.

Changelog

ra0x3 commented 1 year ago

@dadepo

dadepo commented 1 year ago

@dadepo

  • I think this is fair
  • However, I do think this message should only be logged when the -v --verbose flag is included

@ra0x3 Updated to as suggested. I only extended the error message for one of the 3 error paths, as I was not sure if the other two can be due to the missing env variables.

ra0x3 commented 1 year ago

@dadepo

dadepo commented 1 year ago

@lostman Thanks. I have accepted your suggestions.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.