solang icon indicating copy to clipboard operation
solang copied to clipboard

'lld/Common/Driver.h' file not found

Open ascjones opened this issue 3 years ago • 6 comments

Cannot build directly from cargo build or cargo install because of this missing header file: https://github.com/hyperledger-labs/solang/blob/c046e64db8890d0db83d65cbfd2bb0918b7ffd1e/src/linker/linker.cpp#L2

Looking 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.

ascjones avatar Jul 06 '22 14:07 ascjones

lld/Common/Driver.h is the header file for the llvm linker, lld, which solang uses as a library.

seanyoung avatar Jul 06 '22 15:07 seanyoung

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?

seanyoung avatar Jul 06 '22 15:07 seanyoung

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?

ascjones avatar Jul 06 '22 16:07 ascjones

Sometimes it's from a old cache from sccache(or cachepot), try unsetting and do a cargo clean works for me.

extraymond avatar Aug 15 '22 15:08 extraymond

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.

xermicus avatar Jun 29 '23 09:06 xermicus