Skip to content

Add Clang compilation CI job on Ubuntu#2926

Merged
soutaro merged 2 commits intoruby:masterfrom
Shopify:compile-clang
Apr 8, 2026
Merged

Add Clang compilation CI job on Ubuntu#2926
soutaro merged 2 commits intoruby:masterfrom
Shopify:compile-clang

Conversation

@soutaro
Copy link
Copy Markdown
Member

@soutaro soutaro commented Apr 7, 2026

Summary

  • Add clang_compile job to the Ruby CI workflow that compiles the C extension with Clang on macOS
  • Nullability annotations (RBS_NULLABLE / RBS_NONNULL) expand to _Nullable / _Nonnull only on Clang — this job ensures they are actually checked in CI
  • Tests Ruby 4.0 and head on macos-latest where Ruby is built with Apple Clang

Test plan

  • Verify the clang_compile job runs and passes
  • Confirm -Wnullable-to-nonnull-conversion is accepted as CFLAGS

🤖 Generated with Claude Code

@soutaro soutaro added the no-milestone This PR doesn't associate with a milestone. label Apr 7, 2026
@soutaro soutaro marked this pull request as draft April 7, 2026 14:46
Add a clang_compile job to verify that the C extension compiles
cleanly with Clang, enabling nullability checks via
-Wnullable-to-nonnull-conversion. The job runs on macOS where
Ruby is built with Apple Clang, so mkmf's flag checks use the
correct compiler.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@soutaro soutaro marked this pull request as ready for review April 8, 2026 04:05
- run: bundle exec rake clean compile_c99

clang_compile:
runs-on: macos-latest
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We use macos runner, not ubuntu, to make sure ruby is built with clang.

@soutaro soutaro enabled auto-merge April 8, 2026 04:05
@soutaro soutaro merged commit 5ddaf8f into ruby:master Apr 8, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-milestone This PR doesn't associate with a milestone.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant