Skip to content
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

Stop pinning clang in windows ucrt #47

Closed
wants to merge 9 commits into from
Closed
14 changes: 11 additions & 3 deletions setup-ruby-and-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -349,19 +349,27 @@ runs:
exit 1
fi

libclang_path="$msys_root/opt/llvm-15/bin"
bindgen_extra_clang_args="--target=${{ steps.derive-toolchain.outputs.toolchain }} --sysroot=$msys_root"
libclang_path=$msys_root/opt/llvm-15/bin

extra_includes=$msys_root/opt/rb-sys/include
mkdir -p $msys_root/opt/rb-sys/include
cp 'C:\Program Files\LLVM\lib\clang\18\include\stdckdint.h' $extra_includes

bindgen_extra_clang_args="--target=${{ steps.derive-toolchain.outputs.toolchain }} --sysroot=$msys_root -I$extra_includes"

echo "::info::List clang include dir"
echo "int main() { return 0; }" > foo.c && clang foo.c -v

echo "::info::Listing files in $libclang_path"
ls -la "$libclang_path"
echo "::info::Listing files in $msys_root"
ls -la "$msys_root"

# We can't use llvm-16 just yet due to backwards compatibility issues, so we have to workaround for now
echo MSYS_ROOT="$msys_root" >> $GITHUB_ENV
echo LIBCLANG_PATH="$libclang_path" >> $GITHUB_ENV
echo "$libclang_path" >> $GITHUB_PATH
echo BINDGEN_EXTRA_CLANG_ARGS="$bindgen_extra_clang_args" >> $GITHUB_ENV


echo "::info::Set LIBCLANG_PATH to $libclang_path"
echo "::info::Set BINDGEN_EXTRA_CLANG_ARGS to $bindgen_extra_clang_args"