Open ascjones opened 2 years ago
lld/Common/Driver.h
is the header file for the llvm linker, lld, which solang uses as a library.
It would be nice if we could somehow build llvm (including lld) automatically when you run cargo build
. I haven't seen any way of doing this. Maybe https://crates.io/crates/llvmenv?
lld/Common/Driver.h
is the header file for the llvm linker, lld, which solang uses as a library.
Yes of course, but it is assumed that it exists on the search path.
It would be nice if we could somehow build llvm (including lld) automatically when you run cargo build. I haven't seen any way of doing this. Maybe https://crates.io/crates/llvmenv?
I've actually tried running this but it doesn't seem to solve the issue of having this header file on the search path?
Sometimes it's from a old cache from sccache(or cachepot), try unsetting and do a cargo clean
works for me.
We should check that the right LLVM version is available in build.rs
and report that back to the user. I think this would avoid confusion.
Having to run this command while building LLVM worked for me: cmake -S llvm -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=lld -DCMAKE_INSTALL_PREFIX=$HOME/llvm-15.0.7
. Along with building LLVM, LLD is also build.
Cannot build directly from
cargo build
orcargo install
because of this missing header file: https://github.com/hyperledger-labs/solang/blob/c046e64db8890d0db83d65cbfd2bb0918b7ffd1e/src/linker/linker.cpp#L2Looking at the docker image it seems this header file might be coming from the
llvm13.0/bin
folder copied here https://github.com/hyperledger-labs/solang/blob/main/.github/Dockerfile#L36?Anyway it would be nice to have this listed as a prerequisite or automatically resolved as part of the build somehow.