Skip to content

build: support ruby 3.1 and modern libpulsar#2

Open
gmiklos-ltg wants to merge 3 commits into
masterfrom
build/ruby-31-libpulsar-compat
Open

build: support ruby 3.1 and modern libpulsar#2
gmiklos-ltg wants to merge 3 commits into
masterfrom
build/ruby-31-libpulsar-compat

Conversation

@gmiklos-ltg

Copy link
Copy Markdown
Member

Summary

  • add Ruby 3.1 and old Rake compatibility shims so the native build runs again
  • update libpulsar integration for modern 3.7.x and 4.2.x style APIs plus cross-platform discovery
  • add repo-local mise patching for Ruby 3.1.7 on current macOS and document Linux Docker verification

Test Plan

  • mise exec -- bundle 1.17.3 exec rspec spec/pulsar/client_configuration_spec.rb
  • mise exec -- bundle 1.17.3 exec rake compile
  • mise exec -- bundle 1.17.3 exec ruby -e 'require "pulsar/client"; puts Pulsar::Client::VERSION'
  • docker run --rm --entrypoint /bin/bash -v "/Users/gabriel.miklos/Desktop/external-to-voyager/pulsar-client-ruby:/workspace" -w /workspace 127178877223.dkr.ecr.us-east-2.amazonaws.com/learn-test/learn-base-image:1774966705 -lc 'bundle install && bundle exec rake compile && bundle exec ruby -e "require "pulsar/client"; puts Pulsar::Client::VERSION"'

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the gem’s native build and configuration behavior to work with Ruby 3.1 and newer libpulsar releases, including more portable libpulsar discovery and removal of the now-obsolete use_tls toggle.

Changes:

  • Refactor both extconf entrypoints to discover libpulsar via --with-pulsar-* overrides first, then platform defaults, and require C++17.
  • Remove use_tls from Ruby configuration flow/specs and from the native bindings API surface.
  • Add repo-local mise Ruby 3.1.7 patching and expand development documentation for macOS and Ubuntu build verification.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
spec/pulsar/ext/extconf.rb Fixture extconf: add cross-platform libpulsar discovery and header/library checks.
spec/pulsar/client_configuration_spec.rb Remove assertions tied to deprecated use_tls.
README.md Document TLS behavior change + add mise and Ubuntu/Docker build notes.
Rakefile Add Ruby 3 / old Rake FileUtils keyword-arg shim.
patches/ruby-3.1.7-darwin-socket.patch New patch to enable Ruby 3.1.7 build on current macOS via mise.
mise.toml Pin Ruby 3.1.7 and apply the repo-local patch.
lib/pulsar/client_configuration.rb Remove use_tls population and env/client.conf inference.
ext/bindings/extconf.rb Main extension extconf: cross-platform libpulsar discovery + C++17 default.
ext/bindings/client.hpp Remove use_tls methods; track TLS trust cert path in wrapper state.
ext/bindings/client.cpp Remove use_tls binding and adjust TLS trust cert getter/setter behavior.
docs/superpowers/specs/2026-06-19-ubuntu-compile-design.md New design note for Ubuntu-friendly build discovery.
docs/superpowers/plans/2026-06-19-ubuntu-compile-plan.md New implementation plan documenting the extconf refactor steps.
AGENTS.md New repo guidance for contributors/agents.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ext/bindings/extconf.rb
Comment on lines +4 to +8
DEFAULT_PULSAR_DIRS = if RbConfig::CONFIG['host_os'] =~ /darwin/
['/opt/homebrew/opt/libpulsar']
else
['/usr', '/usr/local']
end.freeze
Comment on lines +4 to +8
DEFAULT_PULSAR_DIRS = if RbConfig::CONFIG['host_os'] =~ /darwin/
['/opt/homebrew/opt/libpulsar']
else
['/usr', '/usr/local']
end.freeze
Comment thread Rakefile
Comment on lines +8 to +24
module FileUtilsExt
def mkdir_p(*args, **kwargs, &block)
super(*args, **kwargs, &block)
end

def chdir(*args, **kwargs, &block)
super(*args, **kwargs, &block)
end

def cp(*args, **kwargs, &block)
super(*args, **kwargs, &block)
end

def install(*args, **kwargs, &block)
super(*args, **kwargs, &block)
end
end
Comment thread AGENTS.md
## Setup And Build

- This gem links against `libpulsar`; local work needs both the runtime library and C++ headers installed before `bundle install` or `rake compile` will succeed.
- `ext/bindings/extconf.rb` links with `-lpulsar` and forces `-std=c++11`.
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.

2 participants