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

Conversation

stanhu
Copy link
Contributor

@stanhu stanhu commented Jan 24, 2025

Try the workaround mentioned in rust-lang/rust-bindgen#2500 (comment).

Previous attempt: #47

Closes #54

@stanhu stanhu force-pushed the sh-remove-clang-pin branch from 352f1b9 to 09cb870 Compare January 24, 2025 20:05
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 -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.

@stanhu stanhu marked this pull request as ready for review January 24, 2025 20:41
@stanhu stanhu force-pushed the sh-remove-clang-pin branch from 09cb870 to af3df1a Compare January 24, 2025 20:51
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 -D__AVX512VLFP16INTRIN_H -D__AVX512FP16INTRIN_H"
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.

@ianks
Copy link
Contributor

ianks commented Jan 26, 2025

Great find, this was the source of so many headaches

@ianks ianks merged commit 4305ea2 into oxidize-rb:main Jan 26, 2025
@ianks
Copy link
Contributor

ianks commented Jan 26, 2025

@stanhu
Copy link
Contributor Author

stanhu commented Jan 26, 2025

Awesome, thanks! Finally see a full green build in https://github.com/oxidize-rb/rb-sys/actions/runs/12976870600.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clang-15 no longer available
3 participants