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 #55

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions setup-ruby-and-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ runs:
working-directory: ${{ inputs.working-directory }}
cache-version: ${{ inputs.cache-version }}
rubygems: ${{ inputs.rubygems }}
# for now we have to use clang-15 for mingw builds, since our bindgen is too old to work with clang-16
mingw: clang-15

- name: Install helpers
shell: bash
Expand Down Expand Up @@ -349,23 +347,13 @@ runs:
exit 1
fi

# Add stdckdint.h from LLVM 18 to prevent Ruby 3.4's header from erroring
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
# The preprocessor definitions are necessary to work around an incompatibility with
# C headers included in clang 16+ and bindgen: https://github.com/rust-lang/rust-bindgen/issues/2500.
bindgen_extra_clang_args="--target=${{ steps.derive-toolchain.outputs.toolchain }} --sysroot=$msys_root -D__AVX512VLFP16INTRIN_H -D__AVX512FP16INTRIN_H"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it did! Not sure what the exact implications of defining those headers are, but it sounds reasonable to me.

I'm willing to merge this, but I'll wait a bit to see if Ian has something to add.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oxidize-rb/oxi-test#13 fixes the ruby-head errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think defining those preprocessor headers effectively disables the ability to use of AVX-512 FP16 intrinsics.

I see that these intrinsics were added in clang 14 (llvm/llvm-project@6f7f5b5), but in clang 16 these intrinsics may have been included by default if SSE2 is available: llvm/llvm-project@08388ad.


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

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"
Expand Down