Open AuTsing opened 2 weeks ago
The above comment asking you to download a file is malware to steal your account; do not under any circumstances download or run it. The post needs to be removed. If you have attempted to run it please have your system cleaned and your account secured immediately.
I wonder if we need to set up bindgen to look in the right place for clang. Could you try temporarily setting CLANG_PATH
to the downloaded clang location? (iirc it is in target/xyz/clang
)
@devsnek Thanks for your answer. I have tried setting env CLANG_PATH, but it didn't work with the same error message.
After I looked through the doc of bindgen.
I found that bindgen uses the clang installed locally(https://rust-lang.github.io/rust-bindgen/requirements.html#requirements).
I didn't install them at first, so the error message show Unable to find libclang
.
And I installed clang with apt install llvm-dev libclang-dev clang
.
I build x86_64-unknown-linux-gnu
successfully.
Although it has been successfully compiled, I‘m confused about some issues. The rusty_v8 will automatically download and use clang, but bindgen will not use it, bindgen will use the locally clang. So maybe we should point out that install these requirements before we build? Or maybe we should configure bindgen to use the clang download automatically(Actually I didn't know how to configure it, I tried different ways but it didn't work)?
I looked into this some more and it turns out that the clang we download from chromium does not include libclang shared libraries. I'm discussing with them whether these can be included, in which case it should be fairly trivial to set up build.rs
to automatically use them instead of the system clang.
Since v0.95.0, a new feature #1507 has been merged. I got some errors when compiling v8.
Error message:
This error occurs in v8 build.rs running
build_binding
. I guess this is because bindgen denps on clang, but I haven't configured it.My build host is WSL Ubuntu 22.04. My build steps are as follows:
V8_FROM_SOURCE=1 cargo build -vv
.This set of steps works before v0.94.0.
Acctually, I was able to build successfully in github action. So I think this may be caused by my environment not being configured. At first I wanted to build for Android, I encountered a problem that the header file could not be found. Then I tired build for x86_64-unknown-linux-gnu, I encountered the similar problem.
According to README:
Clang can be automatically downloaded and configured. Maybe the new version need to configure clang?