-
Notifications
You must be signed in to change notification settings - Fork 717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libclang not found when building using github actions for windows target #1797
Comments
Perhaps related: #918. |
Yeah, you need to somehow install libclang on that windows machine. |
@virtualritz, I do not think |
I think these machines supposedly do have clang on them, so I think there is probably more that can be done, as https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md mentions:
However, I don't exactly know where the clangs in question are located, unfortunately. Digging around in a local install of MSVC with these components does produce a clang (it was a while ago when I did this, so I don't remember where), but the one on the server seems not to be located in the same place, possibly because it's enterprise edition, or possibly becuase it's windows server, IDK. |
I'm trying to build a project on a Github runner and am running into the same problem. Doing some debugging with |
I don't know if this is significant, but the Github runners by default load the user's files onto the |
I was able to locate it ato some point inside Unsure why though, meant to follow up on it. |
Good news! 🎉 I have found at least a partial solution. It looks like on the Github runners, the libclang DLL relies on other DLLs in the same folder but that folder is never searched. The underlying error was one returned by Windows itself when trying to load the DLL which, annoyingly enough, can be caused both by a missing file and by missing dependencies. Adding the folder to For future Googlers, the program that ended up tracking down the problem was procmon. Basically it shows you all the interactions between applications and the kernel, including those extra DLLs that the program tried unsuccessfully to load. I didn't thoroughly look through the logs as there was a lot of information, but some examples of culprits were things like |
I had to add this step:
|
Suggested as a fix in this issue: rust-lang/rust-bindgen#1797
EDIT: Didn't understand the problem, I think the solution is just to set |
Edit: you are right, one needs to install clang first. For me the following worked : jobs:
build:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- os: ubuntu-latest
- os: macos-latest
- os: windows-latest
steps:
- name: Install LLVM and Clang # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797
uses: KyleMayes/install-llvm-action@32c4866ebb71e0949e8833eb49beeebed48532bd
if: matrix.config.os == 'windows-latest'
with:
version: "11.0"
directory: ${{ runner.temp }}/llvm
- name: Set LIBCLANG_PATH
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
if: matrix.config.os == 'windows-latest'
- uses: actions/checkout@v2
with:
submodules: recursive
- name: install dependencies
run: ./install-dependencies.sh
- name: Build
run: cargo build
- name: Run tests
run: cargo test
> I had to add this step: [...] (@saschanaz)
When I tried that, it failed with :
|
Ah yeah, that means you didn't install LLVM yourself: https://github.com/marketplace/actions/install-llvm-and-clang |
Had this frustrating issue. Lovasoa's fix did make it work :) |
I'm trying to use github actions to CI build my crate for several platforms. The
windows
target build fails onbindgen
with:This works all fine for the
macos
andubuntu
targets btw.The text was updated successfully, but these errors were encountered: