solang icon indicating copy to clipboard operation
solang copied to clipboard

docs(readme): add section with build instructions

Open petermetz opened this issue 3 years ago • 3 comments

I tried cloning the project and then doing a $ cargo build which resulted in thread 'main' panicked at 'could not execute llvm-config: Os { code: 2, kind: NotFound, message: "No such file or directory" }', build.rs:10:14

I could make it go away by installing llvm [1] (and in hindsight it should've been obvious that it is a dependency) but still, the documentation should have a section for newcomers setting up the project from scratch on the most popular OS' such as Linux (Debian/Ubuntu is where my heart is at) macOS and maybe even Windows (if it works on it)

[1]: $ sudo apt install llvm

Full log output:

$ cargo build
   Compiling syn v1.0.98
   Compiling serde v1.0.141
   Compiling tinyvec_macros v0.1.0
   Compiling pin-project-lite v0.2.9
   Compiling futures-sink v0.3.21
   Compiling matches v0.1.9
   Compiling percent-encoding v2.1.0
   Compiling ryu v1.0.10
   Compiling itoa v1.0.2
   Compiling unicode-bidi v0.3.8
   Compiling pin-utils v0.1.0
   Compiling futures-io v0.3.21
   Compiling unicode-xid v0.2.3
   Compiling either v1.7.0
   Compiling bitflags v1.3.2
   Compiling os_str_bytes v6.2.0
   Compiling termcolor v1.1.3
   Compiling bytes v1.2.1
   Compiling tower-service v0.3.2
   Compiling nodrop v0.1.14
   Compiling tower-layer v0.3.1
   Compiling remove_dir_all v0.5.3
   Compiling tap v1.0.1
   Compiling fastrand v1.8.0
   Compiling funty v1.1.0
   Compiling lalrpop-util v0.19.8
   Compiling unicode-width v0.1.9
   Compiling strsim v0.10.0
   Compiling textwrap v0.15.0
   Compiling cpufeatures v0.2.2
   Compiling constant_time_eq v0.1.5
   Compiling wyz v0.2.0
   Compiling hex v0.4.3
   Compiling base58 v0.2.0
   Compiling parity-wasm v0.45.0
   Compiling funty v2.0.0
   Compiling instant v0.1.12
   Compiling tracing-core v0.1.29
   Compiling phf_shared v0.10.0
   Compiling tinyvec v1.6.0
   Compiling form_urlencoded v1.0.1
   Compiling itertools v0.10.3
   Compiling clap_lex v0.2.4
   Compiling codespan-reporting v0.11.1
   Compiling typenum v1.15.0
   Compiling futures-core v0.3.21
   Compiling futures-task v0.3.21
   Compiling solang v0.1.12 (/home/peter/a/solang)
error: failed to run custom build command for `solang v0.1.12 (/home/peter/a/solang)`

Caused by:
  process didn't exit successfully: `/home/peter/a/solang/target/debug/build/solang-075f3594234e76a0/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'could not execute llvm-config: Os { code: 2, kind: NotFound, message: "No such file or directory" }', build.rs:10:14
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

petermetz avatar Aug 02 '22 18:08 petermetz

There is a section in the documentation that talks about the LLVM dependency (https://solang.readthedocs.io/en/latest/installing.html#building-solang-from-source) when building from source.

Be aware that installing LLVM using sudo apt install llvm will not install the correct libraries. Solang needs Solana's LLVM fork, so you need to follow this instructions to install it.

LucasSte avatar Aug 02 '22 18:08 LucasSte

I agree, on the other hand, that the documentation could be better organized. The section Building Solang from Git looks like it is an individual section that does not depend on the previous instructions.

LucasSte avatar Aug 02 '22 18:08 LucasSte

Oh, my bad! Yeah, I guess it would nice to have a direct link to these sections from the readme, so that surface-searchers like yours truly will find it instead of opening an issue. :-)

petermetz avatar Aug 02 '22 18:08 petermetz