8000 Fix error at Ruby CI by soutaro · Pull Request #2445 · ruby/rbs · GitHub
[go: up one dir, main page]

Skip to content

Fix error at Ruby CI #2445

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

Merged
merged 6 commits into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add rake task to compile without C23 extensions
  • Loading branch information
soutaro committed May 8, 2025
commit c5a3a8acfecc1d39e591f2ab3c67eb0f124b72f4
8 changes: 8 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -437,3 +437,11 @@ task :changelog do
puts " (🤑 There is no *unreleased* pull request associated to the milestone.)"
end
end

desc "Compile extension without C23 extensions"
task :compile_c99 do
ENV["TEST_NO_C23"] = "true"
Rake::Task[:"compile"].invoke
ensure
ENV.delete("TEST_NO_C23")
end
4 changes: 4 additions & 0 deletions ext/rbs_extension/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@

append_cflags ['-std=gnu99', '-Wimplicit-fallthrough', '-Wunused-result']
append_cflags ['-O0', '-g'] if ENV['DEBUG']
if ENV["TEST_NO_C23"]
Copy link
Member Author
@soutaro soutaro May 8, 2025

Choose a reason for hiding this comment

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

Using append_cflags doesn't work because the compilation with -Wc2x-extensions fails. (I guess this is because ruby.h issues diagnostics without C23 extensions.)

puts "Adding -Wc2x-extensions to CFLAGS"
$CFLAGS << " -Werror -Wc2x-extensions"
end

create_makefile 'rbs_extension'
0