Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ jobs:
memcheck:
runs-on: ubuntu-24.04
env:
BUNDLER_VERSION: '0' # https://github.com/ruby/ruby/pull/16909
BUNDLE_WITH: 'memcheck'
BUNDLER_VERSION: '0'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Seems that newer bundler need this regardless when running with ruby-head, so I just removed the comment.

steps:
- uses: actions/checkout@v7
- name: Install valgrind
Expand Down
11 changes: 4 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ gem "test-unit"
platforms :mri, :windows do
gem "ffi"
gem "irb"
gem "ruby_memcheck"
gem "rdoc"

group :memcheck, optional: true do
gem "ruby_memcheck"
end
end

gem "onigmo", platforms: :ruby

# Until a nokogiri release includes sparklemotion/nokogiri#3530, aarch64-mingw-ucrt
# source-builds of libxml2 fail in libtool. Pin to main on that platform only.
if RUBY_PLATFORM =~ /aarch64.*mingw/
gem "nokogiri", github: "sparklemotion/nokogiri", branch: "main"
end

gem "lrama"
19 changes: 10 additions & 9 deletions rakelib/test.rake
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@ return if RUBY_ENGINE == "jruby" || RUBY_ENGINE == "truffleruby"
# Don't bother trying to configure memcheck on old versions of Ruby.
return if RUBY_VERSION < "3.0"

# Only attempt to configure memcheck if the gem is installed.
begin
require "ruby_memcheck"
rescue LoadError
return
end

namespace :test do
RubyMemcheck.config(use_only_ruby_free_at_exit: false)
RubyMemcheck::TestTask.new(valgrind_internal: :compile, &config)
begin
require "ruby_memcheck"
RubyMemcheck.config(use_only_ruby_free_at_exit: false)
RubyMemcheck::TestTask.new(valgrind_internal: :compile, &config)
rescue LoadError
task :valgrind_internal do
puts "\e[31mruby_memcheck gem not available. Try running with BUNDLE_WITH=memcheck\e[0m"
exit 1
end
end

# Hide test:valgrind_internal from rake -T
Rake::Task["test:valgrind_internal"].clear_comments
Expand Down