Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
292fdd5
Fix Ruby 3.3+ ARM64 segfault during shutdown
phillip-haydon Jan 1, 2026
99e6a2a
Remove Ruby 5.x version constraints
phillip-haydon Jan 1, 2026
e3a0b38
Update build tooling for Ruby 3.0+ and rake-compiler-dock 1.11.1
phillip-haydon Jan 7, 2026
a3707f9
Fix flaky tests for Ruby 3.x compatibility
phillip-haydon Jan 7, 2026
144334d
Fix additional test failures for Ruby 3.x
phillip-haydon Jan 7, 2026
a4fee99
Fix Bundler version compatibility for TeamCity
phillip-haydon Jan 7, 2026
6960e91
Fix build script for Ruby 2.7 host compatibility
phillip-haydon Jan 7, 2026
c690193
Build script: Install Ruby 3.1 and dependencies if missing
phillip-haydon Jan 7, 2026
717af1a
Fix build script: proper Ruby version check without bc dependency
phillip-haydon Jan 7, 2026
fc595dc
Fix build script: avoid eval/source, use direct git clone for rbenv
phillip-haydon Jan 7, 2026
cd38a27
Install build dependencies before building Ruby
phillip-haydon Jan 7, 2026
81c366b
Bump required Ruby to 3.2 (multi_xml requires >= 3.1.2)
phillip-haydon Jan 8, 2026
748dd9d
Install debase-ruby_core_source globally in Docker containers
phillip-haydon Jan 8, 2026
b350090
Use cross native:PLATFORM to avoid host Ruby 4.0.0 compilation
phillip-haydon Jan 8, 2026
92f7153
Build native only, manually package gem to avoid host Ruby compilation
phillip-haydon Jan 8, 2026
0ed5fef
Run unit tests with Ruby 3.2 after build
phillip-haydon Jan 8, 2026
f08fd20
Fix GCC compatibility: old-style function def and clang-only flags
phillip-haydon Jan 8, 2026
8409a3f
Fix C99 old-style function definitions and Ruby warnings
phillip-haydon Jan 8, 2026
127f854
Fix Invalid attribute name error to show symbol name instead of pointer
phillip-haydon Jan 9, 2026
2eec172
Fix GCC 12+ compilation: C99 function definitions, rax.c use-after-fr…
phillip-haydon Feb 7, 2026
e86fa65
Bump version to 1.1.15.pre3
phillip-haydon Feb 9, 2026
27f3223
Update darwin build config for Ruby 3.x, add comprehensive README
phillip-haydon Feb 9, 2026
a2f706b
Add rake gem:all task to build all 7 platform gems in one command
phillip-haydon Feb 9, 2026
2353c5e
Update Gemfile.lock for Ruby 3.3.7
phillip-haydon Feb 10, 2026
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
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gemspec

gem 'irb'

# Required for Ruby 3.4+ (removed from default gems)
gem 'mutex_m'
gem 'ostruct'
gem 'csv'
104 changes: 63 additions & 41 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,84 +2,104 @@ PATH
remote: .
specs:
raygun-apm (1.1.15.pre1)
debase-ruby_core_source (>= 3.3.6, < 5.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (6.1.3.2)
activesupport (= 6.1.3.2)
activesupport (6.1.3.2)
activemodel (6.1.7.10)
activesupport (= 6.1.7.10)
activesupport (6.1.7.10)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
benchmark_driver (0.15.17)
bson (4.12.1)
concurrent-ruby (1.1.8)
debase-ruby_core_source (0.10.14)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
base64 (0.3.0)
benchmark_driver (0.15.18)
bigdecimal (3.3.1)
bson (5.2.0)
cgi (0.5.1)
concurrent-ruby (1.3.6)
csv (3.3.5)
date (3.5.1)
debase-ruby_core_source (3.4.1)
domain_name (0.6.20240107)
erb (4.0.4)
cgi (>= 0.3.3)
excon (0.73.0)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
ffi (1.15.5-x64-mingw32)
http-accept (1.7.0)
http-cookie (1.0.3)
http-cookie (1.1.0)
domain_name (~> 0.5)
httparty (0.18.1)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
httpclient (2.8.3)
i18n (1.8.10)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
io-console (0.5.9)
irb (1.3.5)
reline (>= 0.1.5)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0225)
io-console (0.8.2)
irb (1.16.0)
pp (>= 0.6.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
logger (1.7.0)
mime-types (3.7.0)
logger
mime-types-data (~> 3.2025, >= 3.2025.0507)
mime-types-data (3.2025.0924)
minitest (5.14.4)
mongo (2.14.0)
bson (>= 4.8.2, < 5.0.0)
mongoid (7.1.8)
mongo (2.22.0)
base64
bson (>= 4.14.1, < 6.0.0)
mongoid (7.1.11)
activemodel (>= 5.1, < 6.2)
mongo (>= 2.7.0, < 3.0.0)
multi_xml (0.6.0)
ruby2_keywords (~> 0.0.5)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
multipart-post (2.1.1)
mutex_m (0.3.0)
netrc (0.11.0)
rake (13.0.3)
rake-compiler (1.1.1)
ostruct (0.6.3)
pp (0.6.3)
prettyprint
prettyprint (0.2.0)
psych (5.3.1)
date
stringio
rake (13.0.6)
rake-compiler (1.1.9)
rake
rake-compiler-dock (1.2.1)
reline (0.2.5)
rake-compiler-dock (1.2.2)
rdoc (7.0.3)
erb
psych (>= 4.0.0)
tsort
reline (0.6.3)
io-console (~> 0.5)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rest-client (2.1.0-x64-mingw32)
ffi (~> 1.9)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
tzinfo (2.0.4)
ruby2_keywords (0.0.5)
stringio (3.2.0)
tsort (0.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
zeitwerk (2.4.2)
zeitwerk (2.6.18)

PLATFORMS
arm64-darwin-25
ruby
x64-mingw32

DEPENDENCIES
benchmark_driver (~> 0.15.9)
bundler (~> 2.2.15)
debase-ruby_core_source (~> 0.10.14)
bundler (>= 2.2.15)
csv
debase-ruby_core_source (>= 3.3.6, < 5.0)
excon (~> 0.73.0)
faraday (~> 1.0.1)
httparty (~> 0.18.0)
Expand All @@ -88,11 +108,13 @@ DEPENDENCIES
minitest (~> 5.14.4)
mongoid (~> 7.1.2)
multipart-post (~> 2.1.1)
mutex_m
ostruct
rake (~> 13.0.3)
rake-compiler (~> 1.1.1)
rake-compiler-dock (~> 1.2.1)
raygun-apm!
rest-client (~> 2.1.0)

BUNDLED WITH
2.2.33
2.6.9
8 changes: 4 additions & 4 deletions ext/raygun/bipbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ int bipbuf_unused(const bipbuf_t* me)
{
if (1 == me->b_inuse)
/* distance between region B and region A */
return me->a_start - me->b_end;
return (int)(me->a_start - me->b_end);
else
return me->size - me->a_end;
return (int)(me->size - me->a_end);
}

int bipbuf_size(const bipbuf_t* me)
{
return me->size;
return (int)me->size;
}

int bipbuf_used(const bipbuf_t* me)
{
return (me->a_end - me->a_start) + me->b_end;
return (int)((me->a_end - me->a_start) + me->b_end);
}

void bipbuf_init(bipbuf_t* me, const unsigned int size)
Expand Down
50 changes: 45 additions & 5 deletions ext/raygun/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,28 @@

# Makefile generator helper - from standard library
require 'mkmf'
# References core headers extracted by Ruby minor version in https://github.com/os97673/debase-ruby_core_source . Required for some of the lower level profiler features
require 'debase/ruby_core_source'

# References core headers extracted by Ruby minor version in https://github.com/os97673/debase-ruby_core_source
# Required for some of the lower level profiler features (vm_core.h, rb_thread_t, etc.)
begin
require 'debase/ruby_core_source'
rescue LoadError => e
STDERR.puts "=" * 70
STDERR.puts "Raygun APM: Failed to load debase-ruby_core_source"
STDERR.puts ""
STDERR.puts "This gem is required to compile the native extension against Ruby VM internals."
STDERR.puts "Please ensure debase-ruby_core_source >= 3.3.6 is installed:"
STDERR.puts ""
STDERR.puts " gem install debase-ruby_core_source"
STDERR.puts ""
STDERR.puts "Error: #{e.message}"
STDERR.puts "=" * 70
exit(1)
end

# Verify we have headers for the current Ruby version
ruby_version = "#{RUBY_VERSION}"
STDERR.puts "[Raygun APM] Building native extension for Ruby #{ruby_version}"

headers = proc do
have_header('ruby.h') &&
Expand All @@ -25,6 +45,13 @@
append_cflags '-fdeclspec'
append_cflags '-fms-extensions'
append_cflags '-ggdb3'
# Disable warnings that cause issues with third-party code (rax, bipbuffer) on 64-bit platforms
# These are safe truncations for buffer sizes that won't exceed 32-bit limits
append_cflags '-Wno-shorten-64-to-32'
# Clang-specific: disable unknown warning option errors for GCC-only pragmas in third-party code
append_cflags '-Wno-unknown-warning-option'
# Disable const qualifier warnings in third-party rax.c debug code
append_cflags '-Wno-incompatible-pointer-types-discards-qualifiers'
# Enables additional flags, stack protection and debug symbols
if ENV['DEBUG']
have_library 'ssp'
Expand Down Expand Up @@ -54,7 +81,20 @@

# Check for the presence of headers in ruby_core_headers for the version currently compiled for
unless Debase::RubyCoreSource.create_makefile_with_core(headers, 'raygun_ext')
STDERR.print("Makefile creation failed\n")
STDERR.print("One or more ruby headers not found\n")
STDERR.puts "=" * 70
STDERR.puts "Raygun APM: Makefile creation failed"
STDERR.puts ""
STDERR.puts "One or more Ruby VM headers (vm_core.h) were not found for Ruby #{ruby_version}."
STDERR.puts ""
STDERR.puts "This usually means debase-ruby_core_source does not yet have headers"
STDERR.puts "for your Ruby version. Please try updating the gem:"
STDERR.puts ""
STDERR.puts " gem update debase-ruby_core_source"
STDERR.puts ""
STDERR.puts "If the problem persists, please report this issue at:"
STDERR.puts " https://github.com/MindscapeHQ/raygun-apm-ruby/issues"
STDERR.puts "=" * 70
exit(1)
end
end

STDERR.puts "[Raygun APM] Native extension configured successfully"
18 changes: 18 additions & 0 deletions ext/raygun/raygun_coercion.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,31 @@
#pragma GCC diagnostic ignored "-Wpedantic"
#pragma GCC diagnostic ignored "-Woverflow"
#include <ruby/ruby.h>
#include <ruby/version.h>
#include <ruby/encoding.h>
#include <ruby/debug.h>
#include <ruby/thread.h>
#include "vm_core.h"
#include <ruby/thread_native.h>
#pragma GCC diagnostic pop

// Ruby version comparison helper
#ifndef RUBY_API_VERSION_MAJOR
# define RUBY_API_VERSION_MAJOR RUBY_VERSION_MAJOR
# define RUBY_API_VERSION_MINOR RUBY_VERSION_MINOR
# define RUBY_API_VERSION_TEENY RUBY_VERSION_TEENY
#endif

#define RG_RUBY_VER_GE(maj, min) \
((RUBY_API_VERSION_MAJOR > (maj)) || \
(RUBY_API_VERSION_MAJOR == (maj) && RUBY_API_VERSION_MINOR >= (min)))

// Compile-time Ruby version checks
#if RUBY_API_VERSION_MAJOR < 2 || \
(RUBY_API_VERSION_MAJOR == 2 && RUBY_API_VERSION_MINOR < 5)
# error "Raygun APM requires Ruby >= 2.5.0"
#endif

#include "raygun.h"
#include "raygun_errors.h"

Expand Down
Loading